]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: handle more machines with a single builtin IDE controller
authorGuido Günther <agx@sigxcpu.org>
Sat, 21 Nov 2015 18:58:56 +0000 (19:58 +0100)
committerGuido Günther <agx@sigxcpu.org>
Mon, 23 Nov 2015 08:39:29 +0000 (09:39 +0100)
like I440FX by moving the condition into qemuDomainMachineHasBuiltinIDE
and adding more machines.

Reference: http://bugs.debian.org/805189

src/qemu/qemu_command.c
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h

index ef5ef932e1e64a346872b528d99b97337345dffc..4d00fd963d4527f7f14d84849d464837c8b64ba7 100644 (file)
@@ -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, the first (and currently
-         * only) IDE controller is an integrated controller hardcoded
-         * with id "ide"
+        /* for any machine based on e.g. I440FX or G3Beige, the
+         * first (and currently only) IDE controller is an integrated
+         * controller hardcoded with id "ide"
          */
-        if (qemuDomainMachineIsI440FX(domainDef) && controller->idx == 0)
+        if (qemuDomainMachineHasBuiltinIDE(domainDef) &&
+            controller->idx == 0)
             return VIR_STRDUP(controller->info.alias, "ide");
     } else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
         /* for any Q35 machine, the first SATA controller is the
@@ -4914,14 +4915,15 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
         break;
 
     case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
-        /* Since we currently only support the integrated IDE controller
-         * on 440fx, 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 various boards, if we ever get to here, it's
+         * because some other machinetype had an IDE controller
+         * specified, or one with a single IDE contraller had multiple
+         * ide controllers specified.
          */
-        if (qemuDomainMachineIsI440FX(domainDef))
+        if (qemuDomainMachineHasBuiltinIDE(domainDef))
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("Only a single IDE controller is unsupported "
+                           _("Only a single IDE controller is supported "
                              "for this machine type"));
         else
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -9900,9 +9902,9 @@ qemuBuildCommandLine(virConnectPtr conn,
                     cont->idx == 0 && qemuDomainMachineIsQ35(def))
                         continue;
 
-                /* first IDE controller on i440fx machines is implicit */
+                /* first IDE controller is implicit on various machines */
                 if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE &&
-                    cont->idx == 0 && qemuDomainMachineIsI440FX(def))
+                    cont->idx == 0 && qemuDomainMachineHasBuiltinIDE(def))
                         continue;
 
                 if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
index 0861bfd81165b10b27e8b3db2f2db0c4bd7f20a4..18513f9bb4f59846647cc57342595956df333e13 100644 (file)
@@ -3724,6 +3724,16 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
 }
 
 
+bool
+qemuDomainMachineHasBuiltinIDE(const virDomainDef *def)
+{
+    return qemuDomainMachineIsI440FX(def) ||
+        STREQ(def->os.machine, "malta") ||
+        STREQ(def->os.machine, "sun4u") ||
+        STREQ(def->os.machine, "g3beige");
+}
+
+
 /**
  * qemuDomainUpdateCurrentMemorySize:
  *
index 8b6b1a3e37d598a53ffeb98cb328cd1fcb7800a2..271dce9bc382cb1d2e40f27301b487b4c8decfa5 100644 (file)
@@ -479,6 +479,7 @@ bool qemuDomainMachineIsQ35(const virDomainDef *def);
 bool qemuDomainMachineIsI440FX(const virDomainDef *def);
 bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
 bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
+bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
 
 int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
                                       virDomainObjPtr vm);