[libvirt] [PATCH 4/7] qemu: Use virStorageSourceIsEmpty in qemuDomainBlockCommit

Peter Krempa posted 7 patches 6 years, 6 months ago
[libvirt] [PATCH 4/7] qemu: Use virStorageSourceIsEmpty in qemuDomainBlockCommit
Posted by Peter Krempa 6 years, 6 months ago
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>
---
 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 482f915b67..042efae49f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17949,7 +17949,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);
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 4/7] qemu: Use virStorageSourceIsEmpty in qemuDomainBlockCommit
Posted by Ján Tomko 6 years, 6 months ago
On Tue, Jul 23, 2019 at 02:08:48PM +0200, Peter Krempa wrote:
>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>
>---
> src/qemu/qemu_driver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list