]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Use virStorageSourceIsEmpty in qemuDomainBlockCommit
authorPeter Krempa <pkrempa@redhat.com>
Mon, 22 Jul 2019 11:53:59 +0000 (13:53 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 25 Jul 2019 11:21:32 +0000 (13:21 +0200)
The block commit API checked 'disk->src->path' to see whether there
is a reasonable disk source to be committed. As the top image can be
e.g. backed by NBD the check is not good enough. Replace it by
virStorageSourceIsEmpty.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index 5f14b92a81ff4c463b88b7069bb5af9c8288da77..889c0b85e6738674d700d661e28f544e7f22790d 100644 (file)
@@ -17979,7 +17979,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
     if (!(device = qemuAliasDiskDriveFromDisk(disk)))
         goto endjob;
 
-    if (!disk->src->path) {
+    if (virStorageSourceIsEmpty(disk->src)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
                        _("disk %s has no source file to be committed"),
                        disk->dst);