[PATCH] qemu: domain: Properly lookup top of chain in qemuDomainGetStorageSourceByDevstr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When idx is 0 virStorageFileChainLookup returns the base (bottom) of the
backing chain rather than the top. This is expected by the callers of
qemuDomainGetStorageSourceByDevstr.

Add a special case for idx == 0
---
With this you are not able to specify the top image of a disk when using
virDomainSetBlockThreshold in qemu.

 src/qemu/qemu_domain.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 458bb5f9a..589eb1889 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8605,7 +8605,10 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr,
         goto cleanup;
     }

-    src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);
+    if (idx == 0)
+        src = disk->src;
+    else
+        src = virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL);

  cleanup:
     VIR_FREE(target);
-- 
2.12.1

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux