1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: add helper method for checking if ESP SCSI is builtin

The NCR53C90 ESP SCSI controller is only usable when built-in to the
machine type. This method will facilitate checking that restriction
across many places.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-11-18 16:11:05 +00:00
parent 51a391d879
commit 044eed3f94
2 changed files with 18 additions and 0 deletions

View File

@ -8289,6 +8289,23 @@ qemuDomainMachineHasBuiltinIDE(const char *machine,
}
bool qemuDomainHasBuiltinESP(const virDomainDef *def)
{
/* These machines use ncr53c90 (ESP) SCSI controller built-in */
if (def->os.arch == VIR_ARCH_SPARC) {
return true;
} else if (ARCH_IS_MIPS64(def->os.arch) &&
(STREQ(def->os.machine, "magnum") ||
STREQ(def->os.machine, "pica61"))) {
return true;
} else if (def->os.arch == VIR_ARCH_M68K &&
STREQ(def->os.machine, "q800")) {
return true;
}
return false;
}
static bool
qemuDomainMachineNeedsFDC(const char *machine,
const virArch arch)

View File

@ -780,6 +780,7 @@ bool qemuDomainIsPSeries(const virDomainDef *def);
bool qemuDomainHasPCIRoot(const virDomainDef *def);
bool qemuDomainHasPCIeRoot(const virDomainDef *def);
bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
bool qemuDomainHasBuiltinESP(const virDomainDef *def);
bool qemuDomainNeedsFDC(const virDomainDef *def);
bool qemuDomainSupportsPCI(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps);