]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Use qemuAliasFromDisk to generate drive alias
authorJohn Ferlan <jferlan@redhat.com>
Mon, 1 Aug 2016 12:26:42 +0000 (08:26 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 2 Aug 2016 14:11:11 +0000 (10:11 -0400)
The qemuDomainSnapshotCreateSingleDiskActive open coded generating the
disk drive alias. Let's use the common function.

src/qemu/qemu_driver.c

index 8a8e593ee9544c5e8307a0d10730a7d5b410b4b8..c048cea58c17f6bca13d154c0386e289afccf505 100644 (file)
@@ -13806,7 +13806,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)))