]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuBuildDiskDeviceStr: Use XML disk bus type names in error message
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 May 2020 14:08:37 +0000 (16:08 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 May 2020 04:54:59 +0000 (06:54 +0200)
There's no point using the qemu-specific disk bus names in the error
message.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index 9836972234d929a7b98b731073b22278e19f86d0..77f0d83054b33ab18f615347fed189e190874d23 100644 (file)
@@ -1581,7 +1581,6 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
                        virQEMUCapsPtr qemuCaps)
 {
     g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER;
-    const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
     const char *contAlias;
     g_autofree char *backendAlias = NULL;
     g_autofree char *scsiVPDDeviceId = NULL;
@@ -1838,7 +1837,8 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
     case VIR_DOMAIN_DISK_BUS_LAST:
     default:
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unsupported disk bus '%s' with device setup"), bus);
+                       _("unsupported disk bus '%s' with device setup"),
+                       NULLSTR(virDomainDiskBusTypeToString(disk->bus)));
         return NULL;
     }