From 7fec0e59d394d1b55509d5c07c2edd21746612f5 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 4 Oct 2018 15:32:37 +0200 Subject: [PATCH] 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 --- src/qemu/qemu_hotplug.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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,