[libvirt] [PATCHv3 2b/9] qemu: Use qemuAliasFromDisk to generate drive alias

John Ferlan jferlan at redhat.com
Mon Aug 1 12:29:10 UTC 2016


The qemuDomainSnapshotCreateSingleDiskActive open coded generating the
disk drive alias. Let's use the common function.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index abb777a..b94e6dc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13799,7 +13799,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
         return -1;
     }
 
-    if (virAsprintf(&device, "drive-%s", disk->info.alias) < 0)
+    if (!(device = qemuAliasFromDisk(disk)))
         goto cleanup;
 
     if (!(newDiskSrc = virStorageSourceCopy(snap->src, false)))
-- 
2.7.4




More information about the libvir-list mailing list