render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 287db7fde2511199afa62af511acff4b00607c11 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <287db7fde2511199afa62af511acff4b00607c11@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 4 Feb 2020 15:07:39 +0100
fbe740
Subject: [PATCH] qemu: Fix value of 'device' argument for block-commit
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
When using blockdev configurations the 'device' argument of
fbe740
'blockdev-commit' must correspond to the topmost node in the block node
fbe740
graph. Libvirt didn't do this properly in case when 'copy_on_read'
fbe740
option was enabled on the disk.
fbe740
fbe740
Use qemuDomainDiskGetTopNodename to fix it when calling block-commit.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit 69908db0f62444e51bb8aae157b5ae48f45e2fe4)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1792195
fbe740
Message-Id: <0e7223fc993570a108cd849e9d65c476b2294d99.1580824112.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_driver.c | 2 +-
fbe740
 1 file changed, 1 insertion(+), 1 deletion(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
fbe740
index 6a209ccb75..e651c9e819 100644
fbe740
--- a/src/qemu/qemu_driver.c
fbe740
+++ b/src/qemu/qemu_driver.c
fbe740
@@ -18815,7 +18815,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
fbe740
         jobname = job->name;
fbe740
         nodetop = topSource->nodeformat;
fbe740
         nodebase = baseSource->nodeformat;
fbe740
-        device = disk->src->nodeformat;
fbe740
+        device = qemuDomainDiskGetTopNodename(disk);
fbe740
         if (!backingPath && top_parent &&
fbe740
             !(backingPath = qemuBlockGetBackingStoreString(baseSource)))
fbe740
             goto endjob;
fbe740
-- 
fbe740
2.25.0
fbe740