qemu: domain: Identify blockjobs by storage nodename in VM status XML

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>
This commit is contained in:
Peter Krempa 2021-03-04 16:12:20 +01:00
parent 37d5a141b6
commit 8bc0d3fb7a
2 changed files with 10 additions and 10 deletions

View 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:

View File

@ -238,14 +238,14 @@
<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'>
@ -301,7 +301,7 @@
</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>