On 11/20/2015 03:20 PM, Guido Günther wrote:
---
src/qemu/qemu_command.c | 24 ++++++++++++++----------
src/qemu/qemu_domain.c | 6 ++++++
src/qemu/qemu_domain.h | 1 +
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d6b7f09..e467f9c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1054,11 +1054,12 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
*/
return virAsprintf(&controller->info.alias, "pci.%d", controller->idx);
} else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE) {
- /* for any machine based on I440FX or G3Beige, the first (and currently
- * only) IDE controller is an integrated controller hardcoded
- * with id "ide"
+ /* for any machine based on I440FX, G3Beige or Sun4u, the
+ * first (and currently only) IDE controller is an integrated
+ * controller hardcoded with id "ide"
*/
if ((qemuDomainMachineIsI440FX(domainDef) ||
+ qemuDomainMachineIsSun4u(domainDef) ||
qemuDomainMachineIsG3Beige(domainDef)) &&
controller->idx == 0)
return VIR_STRDUP(controller->info.alias, "ide");
@@ -4916,12 +4917,14 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
break;
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
- /* Since we currently only support the integrated IDE controller
- * on 440fx and G3Beige, if we ever get to here, it's because some other
- * machinetype had an IDE controller specified, or a 440fx had
- * multiple ide controllers.
+ /* Since we currently only support the integrated IDE
+ * controller on 440fx, G3Beige and Sun4u, if we ever get to
+ * here, it's because some other machinetype had an IDE
+ * controller specified, or a 440fx had multiple ide
+ * controllers.
*/
- if (qemuDomainMachineIsG3Beige(domainDef))
+ if (qemuDomainMachineIsG3Beige(domainDef) ||
+ qemuDomainMachineIsSun4u(domainDef))
break;
Same comment for this one as for Patch 1/3. (otherwise ACK).
if (qemuDomainMachineIsI440FX(domainDef))
@@ -9905,10 +9908,11 @@ qemuBuildCommandLine(virConnectPtr conn,
cont->idx == 0 && qemuDomainMachineIsQ35(def))
continue;
- /* first IDE controller on i440fx and g3beige machines
- * is implicit */
+ /* first IDE controller on i440fx, G3Beige and Sun4u
+ * machines is implicit */
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE &&
cont->idx == 0 && (qemuDomainMachineIsI440FX(def) ||
+ qemuDomainMachineIsSun4u(def) ||
qemuDomainMachineIsG3Beige(def)))
continue;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bf1f0f1..8eb81c5 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3731,6 +3731,12 @@ qemuDomainMachineIsG3Beige(const virDomainDef *def)
}
+bool
+qemuDomainMachineIsSun4u(const virDomainDef *def)
+{
+ return STREQ(def->os.machine, "sun4u");
+}
+
Do we really need a function for this, as it's only used once? (no
strong opinion either way).
/**
* qemuDomainUpdateCurrentMemorySize:
*
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 1d2245b..d987c24 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -480,6 +480,7 @@ bool qemuDomainMachineIsI440FX(const virDomainDef *def);
bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
bool qemuDomainMachineIsG3Beige(const virDomainDef *def);
+bool qemuDomainMachineIsSun4u(const virDomainDef *def);
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
virDomainObjPtr vm);
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list