]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: process: Don't redetect backing chain on reconnect
authorPeter Krempa <pkrempa@redhat.com>
Wed, 27 Sep 2017 16:06:44 +0000 (18:06 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 6 Oct 2017 06:48:18 +0000 (08:48 +0200)
Skip purging the backing chain and redetecting it when it was not going
to change during the time we were not present.

The decision is based on the new flag which records whether there were
blockjobs running to the status XML.

src/qemu/qemu_process.c

index 4353ad5ec0e824d0c7ecae9a895c5babecae1abb..9f26dfccf887eaeeb031d0b1125e245e3a15cc57 100644 (file)
@@ -6975,12 +6975,16 @@ qemuProcessReconnect(void *opaque)
         if (virStorageTranslateDiskSourcePool(conn, disk) < 0)
             goto error;
 
-        /* XXX we should be able to restore all data from XML in the future.
-         * This should be the only place that calls qemuDomainDetermineDiskChain
-         * with @report_broken == false to guarantee best-effort domain
-         * reconnect */
-        if (qemuDomainDetermineDiskChain(driver, obj, disk, true, false) < 0)
-            goto error;
+        /* backing chains need to be refreshed only if they could change */
+        if (priv->reconnectBlockjobs != VIR_TRISTATE_BOOL_NO) {
+            /* This should be the only place that calls
+             * qemuDomainDetermineDiskChain with @report_broken == false
+             * to guarantee best-effort domain reconnect */
+            if (qemuDomainDetermineDiskChain(driver, obj, disk, true, false) < 0)
+                goto error;
+        } else {
+            VIR_DEBUG("skipping backing chain detection for '%s'", disk->dst);
+        }
 
         dev.type = VIR_DOMAIN_DEVICE_DISK;
         dev.data.disk = disk;