1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-20 09:58:15 +03:00

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 <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-10-04 15:32:37 +02:00
parent 6a84053789
commit 7fec0e59d3

View 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,