]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: hotplug: Don't pretend that we support secrets for media change
authorPeter Krempa <pkrempa@redhat.com>
Thu, 4 Oct 2018 12:34:01 +0000 (14:34 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 8 Oct 2018 10:37:07 +0000 (12:37 +0200)
Old media changing code does not bother setting up the secrets for new
media or actually removing/adding of the corresponding objects.

Additionally it uses secrets setup for the old image to be removed as
the secret for the new image which is wrong.

Remove the support for secrets while changing media for the legacy
approach. The only reasonable way to fix it is when using blockdev.

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

index 86afda636ea753cd2ee23f5531c1f2b72b66bbd5..ad7023c0857769c8f0f9552723a92a5b4ffa31d1 100644 (file)
@@ -210,8 +210,6 @@ qemuDomainChangeMediaLegacy(virQEMUDriverPtr driver,
     char *driveAlias = NULL;
     qemuDomainObjPrivatePtr priv = vm->privateData;
     qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
-    qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src);
-    qemuDomainSecretInfoPtr secinfo = NULL;
     const char *format = NULL;
     char *sourcestr = NULL;
 
@@ -221,9 +219,6 @@ qemuDomainChangeMediaLegacy(virQEMUDriverPtr driver,
         goto cleanup;
     }
 
-    if (srcPriv)
-        secinfo = srcPriv->secinfo;
-
     if (!(driveAlias = qemuAliasDiskDriveFromDisk(disk)))
         goto cleanup;
 
@@ -252,7 +247,7 @@ qemuDomainChangeMediaLegacy(virQEMUDriverPtr driver,
     }
 
     if (!virStorageSourceIsEmpty(newsrc)) {
-        if (qemuGetDriveSourceString(newsrc, secinfo, &sourcestr) < 0)
+        if (qemuGetDriveSourceString(newsrc, NULL, &sourcestr) < 0)
             goto cleanup;
 
         if (virStorageSourceGetActualType(newsrc) != VIR_STORAGE_TYPE_DIR) {