From: Peter Krempa Date: Thu, 4 Oct 2018 13:32:37 +0000 (+0200) Subject: qemu: hotplug: Remove code handling possible missing disk source format X-Git-Tag: v4.9.0-rc1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fec0e59d394d1b55509d5c07c2edd21746612f5;p=thirdparty%2Flibvirt.git qemu: hotplug: Remove code handling possible missing disk source format 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 --- diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index ad7023c085..8123c12a26 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -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,