From 8bc0d3fb7a6f662651799deb8d24d72ddc86c44c Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 4 Mar 2021 16:12:20 +0100 Subject: [PATCH] qemu: domain: Identify blockjobs by storage nodename in VM status XML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/qemu/qemu_domain.c | 8 ++++---- tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) 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 @@ - +