render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From c23ec1c095a13e1279660ea9b27290c9ae0f3849 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <c23ec1c095a13e1279660ea9b27290c9ae0f3849@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 23 Jun 2020 12:24:03 +0200
fbe740
Subject: [PATCH] qemu: blockjob: Remove 'disabledBitmapsBase' field from
fbe740
 commit job private data
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
New semantics of the bitmap handling don't need this. Remove the field
fbe740
and all uses of it including the status XML.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit 057e4bc591093a333624acb9ed065f8f796cca1e)
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804593
fbe740
Message-Id: <d003ac3f3f67fba9944e600cdf09f0aa4bb1001a.1592906423.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_blockjob.c                      | 39 -------------------
fbe740
 src/qemu/qemu_blockjob.h                      |  3 --
fbe740
 src/qemu/qemu_domain.c                        | 22 -----------
fbe740
 src/qemu/qemu_driver.c                        |  3 +-
fbe740
 .../blockjob-blockdev-in.xml                  |  4 --
fbe740
 5 files changed, 1 insertion(+), 70 deletions(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
fbe740
index c63a691a0e..d106165175 100644
fbe740
--- a/src/qemu/qemu_blockjob.c
fbe740
+++ b/src/qemu/qemu_blockjob.c
fbe740
@@ -285,7 +285,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
fbe740
                           virStorageSourcePtr topparent,
fbe740
                           virStorageSourcePtr top,
fbe740
                           virStorageSourcePtr base,
fbe740
-                          char ***disabledBitmapsBase,
fbe740
                           bool delete_imgs,
fbe740
                           unsigned int jobflags)
fbe740
 {
fbe740
@@ -311,7 +310,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
fbe740
     job->data.commit.top = top;
fbe740
     job->data.commit.base = base;
fbe740
     job->data.commit.deleteCommittedImages = delete_imgs;
fbe740
-    job->data.commit.disabledBitmapsBase = g_steal_pointer(disabledBitmapsBase);
fbe740
     job->jobflags = jobflags;
fbe740
 
fbe740
     if (qemuBlockJobRegister(job, vm, disk, true) < 0)
fbe740
@@ -1363,40 +1361,6 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver,
fbe740
 }
fbe740
 
fbe740
 
fbe740
-static void
fbe740
-qemuBlockJobProcessEventFailedCommitCommon(virDomainObjPtr vm,
fbe740
-                                           qemuBlockJobDataPtr job,
fbe740
-                                           qemuDomainAsyncJob asyncJob)
fbe740
-{
fbe740
-    qemuDomainObjPrivatePtr priv = vm->privateData;
fbe740
-    g_autoptr(virJSONValue) actions = virJSONValueNewArray();
fbe740
-    char **disabledBitmaps = job->data.commit.disabledBitmapsBase;
fbe740
-
fbe740
-    if (!disabledBitmaps || !*disabledBitmaps)
fbe740
-        return;
fbe740
-
fbe740
-    for (; *disabledBitmaps; disabledBitmaps++) {
fbe740
-        qemuMonitorTransactionBitmapEnable(actions,
fbe740
-                                           job->data.commit.base->nodeformat,
fbe740
-                                           *disabledBitmaps);
fbe740
-    }
fbe740
-
fbe740
-    if (qemuBlockReopenReadWrite(vm, job->data.commit.base, asyncJob) < 0)
fbe740
-        return;
fbe740
-
fbe740
-    if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
fbe740
-        return;
fbe740
-
fbe740
-    qemuMonitorTransaction(priv->mon, &actions);
fbe740
-
fbe740
-    if (qemuDomainObjExitMonitor(priv->driver, vm) < 0)
fbe740
-        return;
fbe740
-
fbe740
-    if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) < 0)
fbe740
-        return;
fbe740
-}
fbe740
-
fbe740
-
fbe740
 static void
fbe740
 qemuBlockJobProcessEventConcludedCreate(virQEMUDriverPtr driver,
fbe740
                                         virDomainObjPtr vm,
fbe740
@@ -1504,8 +1468,6 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
fbe740
     case QEMU_BLOCKJOB_TYPE_COMMIT:
fbe740
         if (success)
fbe740
             qemuBlockJobProcessEventCompletedCommit(driver, vm, job, asyncJob);
fbe740
-        else
fbe740
-            qemuBlockJobProcessEventFailedCommitCommon(vm, job, asyncJob);
fbe740
         break;
fbe740
 
fbe740
     case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT:
fbe740
@@ -1513,7 +1475,6 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
fbe740
             qemuBlockJobProcessEventCompletedActiveCommit(driver, vm, job, asyncJob);
fbe740
         } else {
fbe740
             qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job);
fbe740
-            qemuBlockJobProcessEventFailedCommitCommon(vm, job, asyncJob);
fbe740
         }
fbe740
         break;
fbe740
 
fbe740
diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
fbe740
index ee83d318f3..4045878568 100644
fbe740
--- a/src/qemu/qemu_blockjob.h
fbe740
+++ b/src/qemu/qemu_blockjob.h
fbe740
@@ -88,8 +88,6 @@ struct _qemuBlockJobCommitData {
fbe740
     virStorageSourcePtr top;
fbe740
     virStorageSourcePtr base;
fbe740
     bool deleteCommittedImages;
fbe740
-    char **disabledBitmapsBase; /* a NULL-terminated list of bitmap names which
fbe740
-                                   were disabled in @base for the commit job */
fbe740
 };
fbe740
 
fbe740
 
fbe740
@@ -187,7 +185,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
fbe740
                           virStorageSourcePtr topparent,
fbe740
                           virStorageSourcePtr top,
fbe740
                           virStorageSourcePtr base,
fbe740
-                          char ***disabledBitmapsBase,
fbe740
                           bool delete_imgs,
fbe740
                           unsigned int jobflags);
fbe740
 
fbe740
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
fbe740
index a92183334f..1e968368ae 100644
fbe740
--- a/src/qemu/qemu_domain.c
fbe740
+++ b/src/qemu/qemu_domain.c
fbe740
@@ -2594,7 +2594,6 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDataPtr job,
fbe740
                                       virBufferPtr buf)
fbe740
 {
fbe740
     g_auto(virBuffer) disabledBitmapsBuf = VIR_BUFFER_INIT_CHILD(buf);
fbe740
-    char **bitmaps = job->data.commit.disabledBitmapsBase;
fbe740
 
fbe740
     if (job->data.commit.base)
fbe740
         virBufferAsprintf(buf, "<base node='%s'/>\n", job->data.commit.base->nodeformat);
fbe740
@@ -2608,9 +2607,6 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDataPtr job,
fbe740
     if (job->data.commit.deleteCommittedImages)
fbe740
         virBufferAddLit(buf, "<deleteCommittedImages/>\n");
fbe740
 
fbe740
-    while (bitmaps && *bitmaps)
fbe740
-        virBufferEscapeString(&disabledBitmapsBuf, "<bitmap name='%s'/>\n", *(bitmaps++));
fbe740
-
fbe740
     virXMLFormatElement(buf, "disabledBaseBitmaps", NULL, &disabledBitmapsBuf);
fbe740
 }
fbe740
 
fbe740
@@ -3238,9 +3234,6 @@ static int
fbe740
 qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job,
fbe740
                                                xmlXPathContextPtr ctxt)
fbe740
 {
fbe740
-    g_autofree xmlNodePtr *nodes = NULL;
fbe740
-    ssize_t nnodes;
fbe740
-
fbe740
     if (job->type == QEMU_BLOCKJOB_TYPE_COMMIT) {
fbe740
         qemuDomainObjPrivateXMLParseBlockjobNodename(job,
fbe740
                                                      "string(./topparent/@node)",
fbe740
@@ -3267,21 +3260,6 @@ qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job,
fbe740
         !job->data.commit.base)
fbe740
         return -1;
fbe740
 
fbe740
-    if ((nnodes = virXPathNodeSet("./disabledBaseBitmaps/bitmap", ctxt, &nodes)) > 0) {
fbe740
-        size_t i;
fbe740
-
fbe740
-        job->data.commit.disabledBitmapsBase = g_new0(char *, nnodes + 1);
fbe740
-
fbe740
-        for (i = 0; i < nnodes; i++) {
fbe740
-            char *tmp;
fbe740
-
fbe740
-            if (!(tmp = virXMLPropString(nodes[i], "name")))
fbe740
-                return -1;
fbe740
-
fbe740
-            job->data.commit.disabledBitmapsBase[i] = g_steal_pointer(&tmp);
fbe740
-        }
fbe740
-    }
fbe740
-
fbe740
     return 0;
fbe740
 }
fbe740
 
fbe740
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
fbe740
index 983d4a04a8..ed5498d2bc 100644
fbe740
--- a/src/qemu/qemu_driver.c
fbe740
+++ b/src/qemu/qemu_driver.c
fbe740
@@ -18757,7 +18757,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
fbe740
     const char *nodebase = NULL;
fbe740
     bool persistjob = false;
fbe740
     bool blockdev = false;
fbe740
-    VIR_AUTOSTRINGLIST bitmapDisableList = NULL;
fbe740
 
fbe740
     virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
fbe740
                   VIR_DOMAIN_BLOCK_COMMIT_ACTIVE |
fbe740
@@ -18919,7 +18918,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
fbe740
     }
fbe740
 
fbe740
     if (!(job = qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSource,
fbe740
-                                          baseSource, &bitmapDisableList,
fbe740
+                                          baseSource,
fbe740
                                           flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE,
fbe740
                                           flags)))
fbe740
         goto endjob;
fbe740
diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
fbe740
index cc17a17ff4..ca6d110179 100644
fbe740
--- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
fbe740
+++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
fbe740
@@ -243,10 +243,6 @@
fbe740
       <base node='libvirt-19-format'/>
fbe740
       <top node='libvirt-17-format'/>
fbe740
       <deleteCommittedImages/>
fbe740
-      <disabledBaseBitmaps>
fbe740
-        <bitmap name='test'/>
fbe740
-        <bitmap name='test1'/>
fbe740
-      </disabledBaseBitmaps>
fbe740
     </blockjob>
fbe740
     <blockjob name='create-libvirt-1337-storage' type='create' state='running'>
fbe740
       <create mode='storage'/>
fbe740
-- 
fbe740
2.27.0
fbe740