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.
|
/* If 'virt' supports PCI, it supports multibus.
|
||||||
* No extra conditions here for simplicity.
|
* No extra conditions here for simplicity.
|
||||||
*/
|
*/
|
||||||
if (STREQ(def->os.machine, "virt") ||
|
if (qemuDomainMachineIsVirt(def))
|
||||||
STRPREFIX(def->os.machine, "virt-"))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6807,8 +6807,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
|
|||||||
if (def->gic_version != VIR_GIC_VERSION_NONE) {
|
if (def->gic_version != VIR_GIC_VERSION_NONE) {
|
||||||
if ((def->os.arch != VIR_ARCH_ARMV7L &&
|
if ((def->os.arch != VIR_ARCH_ARMV7L &&
|
||||||
def->os.arch != VIR_ARCH_AARCH64) ||
|
def->os.arch != VIR_ARCH_AARCH64) ||
|
||||||
(STRNEQ(def->os.machine, "virt") &&
|
!qemuDomainMachineIsVirt(def)) {
|
||||||
!STRPREFIX(def->os.machine, "virt-"))) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("gic-version option is available "
|
_("gic-version option is available "
|
||||||
"only for ARM virt machine"));
|
"only for ARM virt machine"));
|
||||||
|
@ -1761,10 +1761,8 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
|
|||||||
case VIR_ARCH_AARCH64:
|
case VIR_ARCH_AARCH64:
|
||||||
addDefaultUSB = false;
|
addDefaultUSB = false;
|
||||||
addDefaultMemballoon = false;
|
addDefaultMemballoon = false;
|
||||||
if (STREQ(def->os.machine, "virt") ||
|
if (qemuDomainMachineIsVirt(def))
|
||||||
STRPREFIX(def->os.machine, "virt-")) {
|
|
||||||
addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
|
addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_ARCH_PPC64:
|
case VIR_ARCH_PPC64:
|
||||||
@ -1906,8 +1904,7 @@ qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def)
|
|||||||
switch (def->os.arch) {
|
switch (def->os.arch) {
|
||||||
case VIR_ARCH_ARMV7L:
|
case VIR_ARCH_ARMV7L:
|
||||||
case VIR_ARCH_AARCH64:
|
case VIR_ARCH_AARCH64:
|
||||||
if (STREQ(def->os.machine, "virt") ||
|
if (qemuDomainMachineIsVirt(def)) {
|
||||||
STRPREFIX(def->os.machine, "virt-")) {
|
|
||||||
/* GIC is always available to ARM virt machines */
|
/* GIC is always available to ARM virt machines */
|
||||||
def->features[VIR_DOMAIN_FEATURE_GIC] = VIR_TRISTATE_SWITCH_ON;
|
def->features[VIR_DOMAIN_FEATURE_GIC] = VIR_TRISTATE_SWITCH_ON;
|
||||||
}
|
}
|
||||||
@ -2039,8 +2036,7 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
|
|||||||
if (STREQ(def->os.machine, "versatilepb"))
|
if (STREQ(def->os.machine, "versatilepb"))
|
||||||
return "smc91c111";
|
return "smc91c111";
|
||||||
|
|
||||||
if (STREQ(def->os.machine, "virt") ||
|
if (qemuDomainMachineIsVirt(def))
|
||||||
STRPREFIX(def->os.machine, "virt-"))
|
|
||||||
return "virtio";
|
return "virtio";
|
||||||
|
|
||||||
/* Incomplete. vexpress (and a few others) use this, but not all
|
/* 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
|
static bool
|
||||||
qemuCheckMemoryDimmConflict(const virDomainDef *def,
|
qemuCheckMemoryDimmConflict(const virDomainDef *def,
|
||||||
const virDomainMemoryDef *mem)
|
const virDomainMemoryDef *mem)
|
||||||
|
@ -584,6 +584,7 @@ bool qemuDomainMachineIsQ35(const virDomainDef *def);
|
|||||||
bool qemuDomainMachineIsI440FX(const virDomainDef *def);
|
bool qemuDomainMachineIsI440FX(const virDomainDef *def);
|
||||||
bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
|
bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
|
||||||
bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
|
bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
|
||||||
|
bool qemuDomainMachineIsVirt(const virDomainDef *def);
|
||||||
bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
|
bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
|
||||||
|
|
||||||
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
|
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
|
||||||
|
@ -407,8 +407,7 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(STRPREFIX(def->os.machine, "vexpress-") ||
|
if (!(STRPREFIX(def->os.machine, "vexpress-") ||
|
||||||
STREQ(def->os.machine, "virt") ||
|
qemuDomainMachineIsVirt(def)))
|
||||||
STRPREFIX(def->os.machine, "virt-")))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
|
||||||
@ -1342,8 +1341,7 @@ qemuDomainSupportsPCI(virDomainDefPtr def,
|
|||||||
if (STREQ(def->os.machine, "versatilepb"))
|
if (STREQ(def->os.machine, "versatilepb"))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ((STREQ(def->os.machine, "virt") ||
|
if (qemuDomainMachineIsVirt(def) &&
|
||||||
STRPREFIX(def->os.machine, "virt-")) &&
|
|
||||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
|
virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user