1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-24 21:34:01 +03:00

B #-: FC hooks iterate over all NICs (#855)

Firecracker hooks (pre and clean) should only process those NICs whose
VN driver matches the driver that actually calls the hook.

Signed-off-by: Ricardo Diaz <rdiaz@opennebula.io>
This commit is contained in:
Ricardo Diaz 2021-02-22 19:27:37 +01:00 committed by GitHub
parent 5359b5c548
commit 9bd455a82c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -39,7 +39,9 @@ def command(cmd)
cmd_str
end
XPATH_NICS = '//TEMPLATE/NIC'
vnmad = File.basename(File.expand_path('..', File.dirname(__FILE__)))
XPATH_NICS = "//TEMPLATE/NIC[VN_MAD='#{vnmad}']"
XPATH_HV = '//HISTORY/VM_MAD'
#----------------------------------------------------------------------------

View File

@ -35,7 +35,9 @@ def command(cmd)
cmd_str
end
XPATH_NICS = '//TEMPLATE/NIC'
vnmad = File.basename(File.expand_path('..', File.dirname(__FILE__)))
XPATH_NICS = "//TEMPLATE/NIC[VN_MAD='#{vnmad}']"
XPATH_HV = '//HISTORY/VM_MAD'
#----------------------------------------------------------------------------
@ -86,4 +88,4 @@ template.elements.each(XPATH_NICS) do |nic_element|
break unless rc.success?
end
exit(-1) unless rc.success?
exit(-1) unless rc.nil? || rc.success?