mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemu: new functions qemuDomainMachineHasPCI[e]Root()
These functions provide a simple one line method of learning if the current domain has a pci-root or pcie-root bus.
This commit is contained in:
parent
4f949f7486
commit
50adb8a660
@ -5619,6 +5619,36 @@ qemuDomainMachineIsI440FX(const virDomainDef *def)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuDomainMachineHasPCIRoot(const virDomainDef *def)
|
||||
{
|
||||
int root = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0);
|
||||
|
||||
if (root < 0)
|
||||
return false;
|
||||
|
||||
if (def->controllers[root]->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuDomainMachineHasPCIeRoot(const virDomainDef *def)
|
||||
{
|
||||
int root = virDomainControllerFind(def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, 0);
|
||||
|
||||
if (root < 0)
|
||||
return false;
|
||||
|
||||
if (def->controllers[root]->model != VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuDomainMachineNeedsFDC(const virDomainDef *def)
|
||||
{
|
||||
|
@ -658,6 +658,8 @@ virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def);
|
||||
|
||||
bool qemuDomainMachineIsQ35(const virDomainDef *def);
|
||||
bool qemuDomainMachineIsI440FX(const virDomainDef *def);
|
||||
bool qemuDomainMachineHasPCIRoot(const virDomainDef *def);
|
||||
bool qemuDomainMachineHasPCIeRoot(const virDomainDef *def);
|
||||
bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
|
||||
bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
|
||||
bool qemuDomainMachineIsVirt(const virDomainDef *def);
|
||||
|
Loading…
Reference in New Issue
Block a user