feature #3028: Add comments to PCI format. Init pci list in get_*

methods
This commit is contained in:
Ruben S. Montero committed 2015-08-22 17:00:55 +02:00
1 parent b1baa06f2b
commit 17c33241a6
4 files changed
+18 -9

No files matched your search

+12 -3
View File
@@ -37,9 +37,18 @@ public:
* This class represents a PCI DEVICE list for the host. The list is in the
* form:
* <PCI>
* <TYPE>: Three 4-hex digits groups representing <vendor>:<device>:<class>
* <DESCRIPTION>: The corresponding device description
* <ADDRESS>: PCI address, bus, slot and function
* <DOMAIN> PCI address domain
* <BUS> PCI address bus
* <SLOT> PCI address slot
* <FUNCTION> PCI address function
* <ADDRESS> PCI address, bus, slot and function
* <VENDOR> ID of PCI device vendor
* <DEVICE> ID of PCI device
* <CLASS> ID of PCI device class
* <VMID> 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
{
+2 -2
View File
@@ -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);
+2 -4
View File
@@ -205,14 +205,12 @@ ostream& operator<<(ostream& os, VirtualMachineXML& vm)
void VirtualMachineXML::get_requirements (int& cpu, int& memory,
long long& disk, vector<Attribute *> &pci)
{
pci.clear();
if (vm_template != 0)
{
vm_template->get("PCI", pci);
}
else
{
pci.clear();
}
if (this->memory == 0 || this->cpu == 0)
{
+2
View File
@@ -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) ||