[PATCH RFC 20/22] qemu: Add support for networked disks for block pull/block rebase

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

 



Now that we are able to select images from the backing chain via indexed
access we should also convert possible network sources to
qemu-compatible strings before passing them to qemu.
---
 src/qemu/qemu_driver.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b0a79e4..e9cf5d5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14901,6 +14901,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
     virDomainDiskDefPtr disk;
     virStorageSourcePtr baseSource = NULL;
     unsigned int baseIndex = 0;
+    char *basePath = NULL;

     if (!virDomainObjIsActive(vm)) {
         virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -14969,9 +14970,16 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
                                                   base, baseIndex, NULL))))
         goto endjob;

+    if (baseIndex) {
+        if (qemuGetDriveSourceString(baseSource, NULL, &basePath) < 0)
+            goto endjob;
+    } else {
+        if (VIR_STRDUP(basePath, base) < 0)
+            goto endjob;
+    }
+
     qemuDomainObjEnterMonitor(driver, vm);
-    ret = qemuMonitorBlockJob(priv->mon, device,
-                              baseIndex ? baseSource->path : base,
+    ret = qemuMonitorBlockJob(priv->mon, device, basePath,
                               bandwidth, info, mode, async);
     qemuDomainObjExitMonitor(driver, vm);
     if (ret < 0)
@@ -15042,6 +15050,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
     }

  cleanup:
+    VIR_FREE(basePath);
     VIR_FREE(device);
     if (vm)
         virObjectUnlock(vm);
-- 
1.9.2

--
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]