From d8e7464dc4169e3a36b35c6bcc8c68a6929063b6 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Mon, 1 Mar 2021 10:32:33 +0100 Subject: [PATCH] B #5269: get network PCI in FSCK (#892) (cherry picked from commit dad1dc8eb719948305822b0171fc32a276819a30) --- src/onedb/fsck/vm.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/onedb/fsck/vm.rb b/src/onedb/fsck/vm.rb index 24ee4eb067..56687ab4b4 100644 --- a/src/onedb/fsck/vm.rb +++ b/src/onedb/fsck/vm.rb @@ -44,10 +44,19 @@ module OneDBFsck # DATA: VNets used by this VM nics = vm_doc.root.xpath("TEMPLATE/NIC") + + # Nic Alias used by this VM vm_doc.root.xpath("TEMPLATE/NIC_ALIAS").each do |nic| nics << nic end + # NIC PCI used by this VM + vm_doc.root.xpath('TEMPLATE/PCI').each do |nic| + next unless nic.xpath('NETWORK_ID') + + nics << nic + end + nics.each do |nic| net_id = nil nic.xpath("NETWORK_ID").each do |nid| @@ -59,6 +68,7 @@ module OneDBFsck log_error("VM #{row[:oid]} is using VNet #{net_id}, "<< "but it does not exist", false) else + mac = nic.at_xpath("MAC").nil? ? nil : nic.at_xpath("MAC").text ar_id_e = nic.at_xpath('AR_ID')