Now that we have a saner replacement for checking if the disk source is
the same use it instead of formatting qemu command-line chunks.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 34 ----------------------------------
src/qemu/qemu_domain.h | 3 ---
src/qemu/qemu_driver.c | 2 +-
3 files changed, 1 insertion(+), 38 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f8a621a5c9..acf5cc8dd2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8555,40 +8555,6 @@ qemuDomainDiskChainElementPrepare(virQEMUDriverPtr driver,
}
-bool
-qemuDomainDiskSourceDiffers(virDomainDiskDefPtr disk,
- virDomainDiskDefPtr origDisk)
-{
- char *diskSrc = NULL, *origDiskSrc = NULL;
- bool diskEmpty, origDiskEmpty;
- bool ret = true;
-
- diskEmpty = virStorageSourceIsEmpty(disk->src);
- origDiskEmpty = virStorageSourceIsEmpty(origDisk->src);
-
- if (diskEmpty && origDiskEmpty)
- return false;
-
- if (diskEmpty ^ origDiskEmpty)
- return true;
-
- /* This won't be a network storage, so no need to get the diskPriv
- * in order to fetch the secret, thus NULL for param2 */
- if (qemuGetDriveSourceString(disk->src, NULL, &diskSrc) < 0 ||
- qemuGetDriveSourceString(origDisk->src, NULL, &origDiskSrc) < 0)
- goto cleanup;
-
- /* So far in qemu disk sources are considered different
- * if either path to disk or its format changes. */
- ret = virDomainDiskGetFormat(disk) != virDomainDiskGetFormat(origDisk) ||
- STRNEQ_NULLABLE(diskSrc, origDiskSrc);
- cleanup:
- VIR_FREE(diskSrc);
- VIR_FREE(origDiskSrc);
- return ret;
-}
-
-
/*
* Makes sure the @disk differs from @orig_disk only by the source
* path and nothing else. Fields that are being checked and the
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 22c3a51354..bff293fc0a 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -720,9 +720,6 @@ int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
virDomainDiskDefPtr disk,
bool report_broken);
-bool qemuDomainDiskSourceDiffers(virDomainDiskDefPtr disk,
- virDomainDiskDefPtr origDisk);
-
bool qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk,
virDomainDiskDefPtr orig_disk);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 64e2c274c2..dea548f982 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7871,7 +7871,7 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm,
if (!qemuDomainDiskChangeSupported(disk, orig_disk))
goto cleanup;
- if (qemuDomainDiskSourceDiffers(disk, orig_disk)) {
+ if (!virStorageSourceIsSameLocation(disk->src, orig_disk->src)) {
/* Disk source can be changed only for removable devices */
if (disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM &&
disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
--
2.16.2