diff --git a/include/HostShare.h b/include/HostShare.h index 42c38deb6e..e62907f1eb 100644 --- a/include/HostShare.h +++ b/include/HostShare.h @@ -37,9 +37,18 @@ public: * This class represents a PCI DEVICE list for the host. The list is in the * form: * - * : Three 4-hex digits groups representing :: - * : The corresponding device description - *
: PCI address, bus, slot and function + * PCI address domain + * PCI address bus + * PCI address slot + * PCI address function + *
PCI address, bus, slot and function + * ID of PCI device vendor + * ID of PCI device + * ID of PCI device class + * ID using this device, -1 if free + * + * The monitor probe may report additional information such as VENDOR_NAME, + * DEVICE_NAME, CLASS_NAME... */ class HostSharePCI : public Template { diff --git a/src/host/HostShare.cc b/src/host/HostShare.cc index 8eb017b083..130b32b6bd 100644 --- a/src/host/HostShare.cc +++ b/src/host/HostShare.cc @@ -368,7 +368,7 @@ int HostShare::from_xml_node(const xmlNodePtr node) rc += xpath(running_vms,"/HOST_SHARE/RUNNING_VMS",-1); - // ------------ DS Template --------------- + // ------------ Datastores --------------- ObjectXML::get_nodes("/HOST_SHARE/DATASTORES", content); @@ -388,7 +388,7 @@ int HostShare::from_xml_node(const xmlNodePtr node) return -1; } - // ------------ DS Template --------------- + // ------------ PCI Devices --------------- ObjectXML::get_nodes("/HOST_SHARE/PCI_DEVICES", content); diff --git a/src/scheduler/src/pool/VirtualMachineXML.cc b/src/scheduler/src/pool/VirtualMachineXML.cc index 9532c414f1..97c26a1888 100644 --- a/src/scheduler/src/pool/VirtualMachineXML.cc +++ b/src/scheduler/src/pool/VirtualMachineXML.cc @@ -205,14 +205,12 @@ ostream& operator<<(ostream& os, VirtualMachineXML& vm) void VirtualMachineXML::get_requirements (int& cpu, int& memory, long long& disk, vector &pci) { + pci.clear(); + if (vm_template != 0) { vm_template->get("PCI", pci); } - else - { - pci.clear(); - } if (this->memory == 0 || this->cpu == 0) { diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index d6bbb22767..8f738cdb58 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -1677,6 +1677,8 @@ void VirtualMachine::get_requirements (int& cpu, int& memory, int& disk, istringstream iss; float fcpu; + pci_devs.clear(); + obj_template->get("PCI", pci_devs); if ((get_template_attribute("MEMORY",memory) == false) ||