[RFC PATCH 39/41] qemu: blockjob: Remove 'disabledBitmapsBase' field from commit job private data

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

 



New semantics of the bitmap handling don't need this. Remove the field
and all uses of it including the status XML.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c                      | 44 -------------------
 src/qemu/qemu_blockjob.h                      |  3 --
 src/qemu/qemu_domain.c                        | 22 ----------
 src/qemu/qemu_driver.c                        |  3 +-
 .../blockjob-blockdev-in.xml                  |  4 --
 5 files changed, 1 insertion(+), 75 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index ef22bc60ab..801d88a9fb 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -85,11 +85,6 @@ qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job)
         virObjectUnref(job->data.backup.store);
         g_free(job->data.backup.bitmap);
     }
-
-    if (job->type == QEMU_BLOCKJOB_TYPE_COMMIT ||
-        job->type == QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT) {
-        virStringListFree(job->data.commit.disabledBitmapsBase);
-    }
 }


@@ -291,7 +286,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
                           virStorageSourcePtr topparent,
                           virStorageSourcePtr top,
                           virStorageSourcePtr base,
-                          char ***disabledBitmapsBase,
                           bool delete_imgs,
                           unsigned int jobflags)
 {
@@ -317,7 +311,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
     job->data.commit.top = top;
     job->data.commit.base = base;
     job->data.commit.deleteCommittedImages = delete_imgs;
-    job->data.commit.disabledBitmapsBase = g_steal_pointer(disabledBitmapsBase);
     job->jobflags = jobflags;

     if (qemuBlockJobRegister(job, vm, disk, true) < 0)
@@ -1405,40 +1398,6 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver,
 }


-static void
-qemuBlockJobProcessEventFailedCommitCommon(virDomainObjPtr vm,
-                                           qemuBlockJobDataPtr job,
-                                           qemuDomainAsyncJob asyncJob)
-{
-    qemuDomainObjPrivatePtr priv = vm->privateData;
-    g_autoptr(virJSONValue) actions = virJSONValueNewArray();
-    char **disabledBitmaps = job->data.commit.disabledBitmapsBase;
-
-    if (!disabledBitmaps || !*disabledBitmaps)
-        return;
-
-    for (; *disabledBitmaps; disabledBitmaps++) {
-        qemuMonitorTransactionBitmapEnable(actions,
-                                           job->data.commit.base->nodeformat,
-                                           *disabledBitmaps);
-    }
-
-    if (qemuBlockReopenReadWrite(vm, job->data.commit.base, asyncJob) < 0)
-        return;
-
-    if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
-        return;
-
-    qemuMonitorTransaction(priv->mon, &actions);
-
-    if (qemuDomainObjExitMonitor(priv->driver, vm) < 0)
-        return;
-
-    if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) < 0)
-        return;
-}
-
-
 static void
 qemuBlockJobProcessEventConcludedCreate(virQEMUDriverPtr driver,
                                         virDomainObjPtr vm,
@@ -1578,8 +1537,6 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
     case QEMU_BLOCKJOB_TYPE_COMMIT:
         if (success)
             qemuBlockJobProcessEventCompletedCommit(driver, vm, job, asyncJob);
-        else
-            qemuBlockJobProcessEventFailedCommitCommon(vm, job, asyncJob);
         break;

     case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT:
@@ -1587,7 +1544,6 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job,
             qemuBlockJobProcessEventCompletedActiveCommit(driver, vm, job, asyncJob);
         } else {
             qemuBlockJobProcessEventFailedActiveCommit(driver, vm, job);
-            qemuBlockJobProcessEventFailedCommitCommon(vm, job, asyncJob);
         }
         break;

diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h
index 0b9da7dd5b..89747b30c0 100644
--- a/src/qemu/qemu_blockjob.h
+++ b/src/qemu/qemu_blockjob.h
@@ -89,8 +89,6 @@ struct _qemuBlockJobCommitData {
     virStorageSourcePtr top;
     virStorageSourcePtr base;
     bool deleteCommittedImages;
-    char **disabledBitmapsBase; /* a NULL-terminated list of bitmap names which
-                                   were disabled in @base for the commit job */
 };


@@ -196,7 +194,6 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
                           virStorageSourcePtr topparent,
                           virStorageSourcePtr top,
                           virStorageSourcePtr base,
-                          char ***disabledBitmapsBase,
                           bool delete_imgs,
                           unsigned int jobflags);

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bceeaf0342..e8ab42db70 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2634,7 +2634,6 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDataPtr job,
                                       virBufferPtr buf)
 {
     g_auto(virBuffer) disabledBitmapsBuf = VIR_BUFFER_INIT_CHILD(buf);
-    char **bitmaps = job->data.commit.disabledBitmapsBase;

     if (job->data.commit.base)
         virBufferAsprintf(buf, "<base node='%s'/>\n", job->data.commit.base->nodeformat);
@@ -2648,9 +2647,6 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDataPtr job,
     if (job->data.commit.deleteCommittedImages)
         virBufferAddLit(buf, "<deleteCommittedImages/>\n");

-    while (bitmaps && *bitmaps)
-        virBufferEscapeString(&disabledBitmapsBuf, "<bitmap name='%s'/>\n", *(bitmaps++));
-
     virXMLFormatElement(buf, "disabledBaseBitmaps", NULL, &disabledBitmapsBuf);
 }

@@ -3277,9 +3273,6 @@ static int
 qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job,
                                                xmlXPathContextPtr ctxt)
 {
-    g_autofree xmlNodePtr *nodes = NULL;
-    ssize_t nnodes;
-
     if (job->type == QEMU_BLOCKJOB_TYPE_COMMIT) {
         qemuDomainObjPrivateXMLParseBlockjobNodename(job,
                                                      "string(./topparent/@node)",
@@ -3306,21 +3299,6 @@ qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job,
         !job->data.commit.base)
         return -1;

-    if ((nnodes = virXPathNodeSet("./disabledBaseBitmaps/bitmap", ctxt, &nodes)) > 0) {
-        size_t i;
-
-        job->data.commit.disabledBitmapsBase = g_new0(char *, nnodes + 1);
-
-        for (i = 0; i < nnodes; i++) {
-            char *tmp;
-
-            if (!(tmp = virXMLPropString(nodes[i], "name")))
-                return -1;
-
-            job->data.commit.disabledBitmapsBase[i] = g_steal_pointer(&tmp);
-        }
-    }
-
     return 0;
 }

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 98a60ec2e2..516be76b8f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -18441,7 +18441,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
     const char *nodebase = NULL;
     bool persistjob = false;
     bool blockdev = false;
-    VIR_AUTOSTRINGLIST bitmapDisableList = NULL;

     virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW |
                   VIR_DOMAIN_BLOCK_COMMIT_ACTIVE |
@@ -18606,7 +18605,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
     }

     if (!(job = qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSource,
-                                          baseSource, &bitmapDisableList,
+                                          baseSource,
                                           flags & VIR_DOMAIN_BLOCK_COMMIT_DELETE,
                                           flags)))
         goto endjob;
diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
index cc17a17ff4..ca6d110179 100644
--- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
+++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
@@ -243,10 +243,6 @@
       <base node='libvirt-19-format'/>
       <top node='libvirt-17-format'/>
       <deleteCommittedImages/>
-      <disabledBaseBitmaps>
-        <bitmap name='test'/>
-        <bitmap name='test1'/>
-      </disabledBaseBitmaps>
     </blockjob>
     <blockjob name='create-libvirt-1337-storage' type='create' state='running'>
       <create mode='storage'/>
-- 
2.26.2




[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