From dad1dc8eb719948305822b0171fc32a276819a30 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) --- 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 c572e997aa..36d31921a9 100644 --- a/src/onedb/fsck/vm.rb +++ b/src/onedb/fsck/vm.rb @@ -54,10 +54,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| @@ -69,6 +78,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')