From 32e26f3aff542e642641c32d9fa65577c891e337 Mon Sep 17 00:00:00 2001 Message-Id: <32e26f3aff542e642641c32d9fa65577c891e337@dist-git> From: Peter Krempa Date: Wed, 19 Feb 2020 15:10:21 +0100 Subject: [PATCH] qemu: domain: Store nodenames of slice in status XML MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The storage slice will require a specific node name in cases when the image format is not raw. Store and format them in the status XML. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko (cherry picked from commit f36d751fa6d091af5f1c2331f607e0ec3d8993fb) https://bugzilla.redhat.com/show_bug.cgi?id=1791788 Message-Id: <83b00663d313ed032a6b7723b8427c3224f2c9c8.1582120424.git.pkrempa@redhat.com> Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 7 +++++++ tests/qemustatusxml2xmldata/modern-in.xml | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 7b414b79c7..948bf3011c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2348,6 +2348,9 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt, src->nodeformat = virXPathString("string(./nodenames/nodename[@type='format']/@name)", ctxt); src->tlsAlias = virXPathString("string(./objects/TLSx509/@alias)", ctxt); + if (src->sliceStorage) + src->sliceStorage->nodename = virXPathString("string(./nodenames/nodename[@type='slice-storage']/@name)", ctxt); + if (src->pr) src->pr->mgralias = virXPathString("string(./reservations/@mgralias)", ctxt); @@ -2407,6 +2410,10 @@ qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src, virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodestorage); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodeformat); + if (src->sliceStorage) + virBufferEscapeString(&nodenamesChildBuf, "\n", + src->sliceStorage->nodename); + virXMLFormatElement(buf, "nodenames", NULL, &nodenamesChildBuf); if (src->pr) diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxml2xmldata/modern-in.xml index 8a2718293f..c8d21ceada 100644 --- a/tests/qemustatusxml2xmldata/modern-in.xml +++ b/tests/qemustatusxml2xmldata/modern-in.xml @@ -312,6 +312,9 @@ + + + @@ -322,6 +325,7 @@ + base.qcow2 -- 2.25.0