From: Peter Krempa Date: Thu, 4 Mar 2021 15:12:20 +0000 (+0100) Subject: qemu: domain: Identify blockjobs by storage nodename in VM status XML X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8bc0d3fb7a6f662651799deb8d24d72ddc86c44c;p=libvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index eec7bed28b..918b5a14e1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2288,13 +2288,13 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobData *job, g_auto(virBuffer) disabledBitmapsBuf = VIR_BUFFER_INIT_CHILD(buf); if (job->data.commit.base) - virBufferAsprintf(buf, "\n", job->data.commit.base->nodeformat); + virBufferAsprintf(buf, "\n", job->data.commit.base->nodestorage); if (job->data.commit.top) - virBufferAsprintf(buf, "\n", job->data.commit.top->nodeformat); + virBufferAsprintf(buf, "\n", job->data.commit.top->nodestorage); if (job->data.commit.topparent) - virBufferAsprintf(buf, "\n", job->data.commit.topparent->nodeformat); + virBufferAsprintf(buf, "\n", job->data.commit.topparent->nodestorage); if (job->data.commit.deleteCommittedImages) virBufferAddLit(buf, "\n"); @@ -2357,7 +2357,7 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload, switch ((qemuBlockJobType) job->type) { case QEMU_BLOCKJOB_TYPE_PULL: if (job->data.pull.base) - virBufferAsprintf(&childBuf, "\n", job->data.pull.base->nodeformat); + virBufferAsprintf(&childBuf, "\n", job->data.pull.base->nodestorage); break; case QEMU_BLOCKJOB_TYPE_COMMIT: diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml index b62b3149c2..380ef053d2 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -238,14 +238,14 @@ - - - + + + - - + + @@ -301,7 +301,7 @@ - +