[PATCH 11/17] qemu: Always assume support for QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY

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

 



qemu supports the @allow-write-only-overlay feature since qemu-5.0.
Remove the alternate code paths.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c    |  1 -
 src/qemu/qemu_blockjob.c |  9 +++------
 src/qemu/qemu_driver.c   | 20 ++++++--------------
 3 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index eb0621463e..76e7f4ca83 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3826,7 +3826,6 @@ qemuBlockPivot(virDomainObj *vm,
              * to copy data into the backing chain while the top image is being
              * copied shallow */
             if (reuse && shallow &&
-                virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) &&
                 virStorageSourceHasBacking(disk->mirror)) {

                 if (qemuProcessPrepareHostStorageSourceChain(vm, disk->mirror->backingStore) < 0)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index be18f7b273..7b7d54fdca 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -1268,7 +1268,6 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriver *driver,
                                            qemuBlockJobData *job,
                                            virDomainAsyncJob asyncJob)
 {
-    qemuDomainObjPrivate *priv = vm->privateData;
     g_autoptr(virStorageSource) mirror = NULL;

     VIR_DEBUG("copy job '%s' on VM '%s' aborted", job->name, vm->def->name);
@@ -1283,12 +1282,10 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriver *driver,
         bool reuse = job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT;

         /* In the special case of a shallow copy with reused image we don't
-         * hotplug the full chain when QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY
-         * is supported. Attempting to delete it would thus result in spurious
-         * errors as we'd attempt to blockdev-del images which were not added
-         * yet */
+         * hotplug the full chain. Attempting to delete it would thus result in
+         * spurious errors as we'd attempt to blockdev-del images which were
+         * not added yet */
         if (reuse && shallow &&
-            virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) &&
             virStorageSourceHasBacking(job->disk->mirror))
             g_clear_pointer(&job->disk->mirror->backingStore, virObjectUnref);
     }
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ef731cb072..f974d2fba8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14299,22 +14299,14 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
          * level is being copied. To restore this semantics if
          * blockdev-reopen is supported defer opening of the backing chain
          * of 'mirror' to the pivot step */
-        if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY)) {
-            g_autoptr(virStorageSource) terminator = virStorageSourceNew();
+        g_autoptr(virStorageSource) terminator = virStorageSourceNew();

-            if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0)
-                goto endjob;
-
-            if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
-                                                                             terminator)))
-                goto endjob;
-        } else {
-            if (qemuProcessPrepareHostStorageSourceChain(vm, mirror) < 0)
-                goto endjob;
+        if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0)
+            goto endjob;

-            if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror)))
-                goto endjob;
-        }
+        if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
+                                                                         terminator)))
+            goto endjob;
     } else {
         if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_NONE)))
             goto endjob;
-- 
2.48.1




[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