]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Use virDomainControllerType in qemuBuildControllerDevStr switch
authorJohn Ferlan <jferlan@redhat.com>
Fri, 1 Dec 2017 13:51:05 +0000 (08:51 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 7 Dec 2017 00:50:11 +0000 (19:50 -0500)
Make sure all types of virDomainControllerType are handled in the
switch statement.

src/qemu/qemu_command.c

index 6a8da1d58646ad88d5635c6fb787140eaec201ae..645802795d23db2f5a3d22f9ae6427580a3d6be1 100644 (file)
@@ -2695,7 +2695,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
         }
     }
 
-    switch (def->type) {
+    switch ((virDomainControllerType) def->type) {
     case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
         switch (model) {
         case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI:
@@ -3140,7 +3140,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
                              "this QEMU binary or machine type"));
         goto error;
 
-    default:
+    case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
+    case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("Unsupported controller type: %s"),
                        virDomainControllerTypeToString(def->type));