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(a)redhat.com>
---
src/qemu/qemu_domain.c | 17 +++++++++++++++++
src/qemu/qemu_domain.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e85ca80929..1a80aa4c69 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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)
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 8dbec6e33f..6b75b828c0 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -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);
--
2.28.0