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

[libvirt] [PATCHv2 21/62] qemu: domain: Don't redetect backing chain when using -blockdev



We need to load the backing chain from the XML when using -blockdev.

Signed-off-by: Peter Krempa <pkrempa redhat com>
---
 src/qemu/qemu_process.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 38e88404aa..d9acb4bd68 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6024,8 +6024,10 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver,
                               virDomainObjPtr vm,
                               unsigned int flags)
 {
+    qemuDomainObjPrivatePtr priv = vm->privateData;
     size_t i;
     bool cold_boot = flags & VIR_QEMU_PROCESS_START_COLD;
+    bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV);

     for (i = vm->def->ndisks; i > 0; i--) {
         size_t idx = i - 1;
@@ -6034,7 +6036,9 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver,
         if (virStorageSourceIsEmpty(disk->src))
             continue;

-        virStorageSourceBackingStoreClear(disk->src);
+        /* backing chain needs to be redetected if we aren't using blockdev */
+        if (!blockdev)
+            virStorageSourceBackingStoreClear(disk->src);

         if (qemuDomainDetermineDiskChain(driver, vm, disk, true) >= 0)
             continue;
@@ -7710,7 +7714,8 @@ qemuProcessReconnect(void *opaque)
             goto error;

         /* backing chains need to be refreshed only if they could change */
-        if (priv->reconnectBlockjobs != VIR_TRISTATE_BOOL_NO) {
+        if (priv->reconnectBlockjobs != VIR_TRISTATE_BOOL_NO &&
+            !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
             /* This should be the only place that calls
              * qemuDomainDetermineDiskChain with @report_broken == false
              * to guarantee best-effort domain reconnect */
-- 
2.16.2


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