mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Introduce qemuDomainMachineIsVirt
Use it everywhere except for virQEMUCapsFillDomainFeatureGICCaps.
This commit is contained in:
parent
204b459c1a
commit
53a868f152
@ -2184,8 +2184,7 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps,
|
||||
/* If 'virt' supports PCI, it supports multibus.
|
||||
* No extra conditions here for simplicity.
|
||||
*/
|
||||
if (STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-"))
|
||||
if (qemuDomainMachineIsVirt(def))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -6807,8 +6807,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
||||
if (def->gic_version != VIR_GIC_VERSION_NONE) {
|
||||
if ((def->os.arch != VIR_ARCH_ARMV7L &&
|
||||
def->os.arch != VIR_ARCH_AARCH64) ||
|
||||
(STRNEQ(def->os.machine, "virt") &&
|
||||
!STRPREFIX(def->os.machine, "virt-"))) {
|
||||
!qemuDomainMachineIsVirt(def)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("gic-version option is available "
|
||||
"only for ARM virt machine"));
|
||||
|
@ -1761,10 +1761,8 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
|
||||
case VIR_ARCH_AARCH64:
|
||||
addDefaultUSB = false;
|
||||
addDefaultMemballoon = false;
|
||||
if (STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-")) {
|
||||
if (qemuDomainMachineIsVirt(def))
|
||||
addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
|
||||
}
|
||||
break;
|
||||
|
||||
case VIR_ARCH_PPC64:
|
||||
@ -1906,8 +1904,7 @@ qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def)
|
||||
switch (def->os.arch) {
|
||||
case VIR_ARCH_ARMV7L:
|
||||
case VIR_ARCH_AARCH64:
|
||||
if (STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-")) {
|
||||
if (qemuDomainMachineIsVirt(def)) {
|
||||
/* GIC is always available to ARM virt machines */
|
||||
def->features[VIR_DOMAIN_FEATURE_GIC] = VIR_TRISTATE_SWITCH_ON;
|
||||
}
|
||||
@ -2039,8 +2036,7 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
|
||||
if (STREQ(def->os.machine, "versatilepb"))
|
||||
return "smc91c111";
|
||||
|
||||
if (STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-"))
|
||||
if (qemuDomainMachineIsVirt(def))
|
||||
return "virtio";
|
||||
|
||||
/* Incomplete. vexpress (and a few others) use this, but not all
|
||||
@ -4653,6 +4649,14 @@ qemuDomainMachineIsS390CCW(const virDomainDef *def)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
qemuDomainMachineIsVirt(const virDomainDef *def)
|
||||
{
|
||||
return STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-");
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
qemuCheckMemoryDimmConflict(const virDomainDef *def,
|
||||
const virDomainMemoryDef *mem)
|
||||
|
@ -584,6 +584,7 @@ bool qemuDomainMachineIsQ35(const virDomainDef *def);
|
||||
bool qemuDomainMachineIsI440FX(const virDomainDef *def);
|
||||
bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
|
||||
bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
|
||||
bool qemuDomainMachineIsVirt(const virDomainDef *def);
|
||||
bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
|
||||
|
||||
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
|
||||
|
@ -407,8 +407,7 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
|
||||
return;
|
||||
|
||||
if (!(STRPREFIX(def->os.machine, "vexpress-") ||
|
||||
STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-")))
|
||||
qemuDomainMachineIsVirt(def)))
|
||||
return;
|
||||
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
|
||||
@ -1342,8 +1341,7 @@ qemuDomainSupportsPCI(virDomainDefPtr def,
|
||||
if (STREQ(def->os.machine, "versatilepb"))
|
||||
return true;
|
||||
|
||||
if ((STREQ(def->os.machine, "virt") ||
|
||||
STRPREFIX(def->os.machine, "virt-")) &&
|
||||
if (qemuDomainMachineIsVirt(def) &&
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
|
||||
return true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user