]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: hotplug: Remove code handling possible missing disk source format
authorPeter Krempa <pkrempa@redhat.com>
Thu, 4 Oct 2018 13:32:37 +0000 (15:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 8 Oct 2018 13:35:18 +0000 (15:35 +0200)
qemu media changing code tried to assume old media's format for the new
one if that was not specified. Since the format will always be present
it does not make sense to keep the code around.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_hotplug.c

index ad7023c0857769c8f0f9552723a92a5b4ffa31d1..8123c12a262f73653624ac90ad53dddbe6c9d4da 100644 (file)
@@ -250,14 +250,9 @@ qemuDomainChangeMediaLegacy(virQEMUDriverPtr driver,
         if (qemuGetDriveSourceString(newsrc, NULL, &sourcestr) < 0)
             goto cleanup;
 
-        if (virStorageSourceGetActualType(newsrc) != VIR_STORAGE_TYPE_DIR) {
-            if (newsrc->format > 0) {
-                format = virStorageFileFormatTypeToString(newsrc->format);
-            } else {
-                if (disk->src->format > 0)
-                    format = virStorageFileFormatTypeToString(disk->src->format);
-            }
-        }
+        if (virStorageSourceGetActualType(newsrc) != VIR_STORAGE_TYPE_DIR)
+            format = virStorageFileFormatTypeToString(newsrc->format);
+
         qemuDomainObjEnterMonitor(driver, vm);
         rc = qemuMonitorChangeMedia(priv->mon,
                                     driveAlias,