mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #3028: Add comments to PCI format. Init pci list in get_*
methods
This commit is contained in:
parent
b1baa06f2b
commit
17c33241a6
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user