]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Identify blockjobs by storage nodename in VM status XML
authorPeter Krempa <pkrempa@redhat.com>
Thu, 4 Mar 2021 15:12:20 +0000 (16:12 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Oct 2023 12:16:15 +0000 (14:16 +0200)
Use the node name of the storage access driver to identify the block job
volumes. This will prepare the blockjob code for the possibility that the
format layer may be missing. Our lookup code can find either of them,
thus we can safely switch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml

index eec7bed28bd0ab42e760facc5259f4045a756e1e..918b5a14e106a26f218c455779458e8c780e66ae 100644 (file)
@@ -2288,13 +2288,13 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobData *job,
     g_auto(virBuffer) disabledBitmapsBuf = VIR_BUFFER_INIT_CHILD(buf);
 
     if (job->data.commit.base)
-        virBufferAsprintf(buf, "<base node='%s'/>\n", job->data.commit.base->nodeformat);
+        virBufferAsprintf(buf, "<base node='%s'/>\n", job->data.commit.base->nodestorage);
 
     if (job->data.commit.top)
-        virBufferAsprintf(buf, "<top node='%s'/>\n", job->data.commit.top->nodeformat);
+        virBufferAsprintf(buf, "<top node='%s'/>\n", job->data.commit.top->nodestorage);
 
     if (job->data.commit.topparent)
-        virBufferAsprintf(buf, "<topparent node='%s'/>\n", job->data.commit.topparent->nodeformat);
+        virBufferAsprintf(buf, "<topparent node='%s'/>\n", job->data.commit.topparent->nodestorage);
 
     if (job->data.commit.deleteCommittedImages)
         virBufferAddLit(buf, "<deleteCommittedImages/>\n");
@@ -2357,7 +2357,7 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
     switch ((qemuBlockJobType) job->type) {
         case QEMU_BLOCKJOB_TYPE_PULL:
             if (job->data.pull.base)
-                virBufferAsprintf(&childBuf, "<base node='%s'/>\n", job->data.pull.base->nodeformat);
+                virBufferAsprintf(&childBuf, "<base node='%s'/>\n", job->data.pull.base->nodestorage);
             break;
 
         case QEMU_BLOCKJOB_TYPE_COMMIT:
index b62b3149c23503d2cb60b68672f7801698afc29d..380ef053d2b83dbdabf7c0ac66165be17085751c 100644 (file)
     <blockjob name='broken-test' type='broken' state='ready' brokentype='commit'/>
     <blockjob name='commit-vdc-libvirt-9-format' type='commit' state='running' jobflags='0x0'>
       <disk dst='vdc'/>
-      <base node='libvirt-11-format'/>
-      <top node='libvirt-9-format'/>
-      <topparent node='libvirt-2-format'/>
+      <base node='libvirt-11-storage'/>
+      <top node='libvirt-9-storage'/>
+      <topparent node='libvirt-2-storage'/>
     </blockjob>
     <blockjob name='commit-vde-libvirt-17-format' type='active-commit' state='ready'>
       <disk dst='vde'/>
-      <base node='libvirt-19-format'/>
-      <top node='libvirt-17-format'/>
+      <base node='libvirt-19-storage'/>
+      <top node='libvirt-17-storage'/>
       <deleteCommittedImages/>
     </blockjob>
     <blockjob name='copy-vdd-libvirt-4321-format' type='copy' state='ready' jobflags='0x0' shallownew='yes'>
     </blockjob>
     <blockjob name='pull-vdb-libvirt-3-format' type='pull' state='running'>
       <disk dst='vdb'/>
-      <base node='libvirt-14-format'/>
+      <base node='libvirt-14-storage'/>
     </blockjob>
     <blockjob name='test-orphan-job0' type='copy' state='ready'>
       <chains>