mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00:00
qemu: domain: Store nodenames of slice in status XML
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 <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
bbf5d05cfd
commit
f36d751fa6
@ -2322,6 +2322,9 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
|
|||||||
src->nodeformat = virXPathString("string(./nodenames/nodename[@type='format']/@name)", ctxt);
|
src->nodeformat = virXPathString("string(./nodenames/nodename[@type='format']/@name)", ctxt);
|
||||||
src->tlsAlias = virXPathString("string(./objects/TLSx509/@alias)", 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)
|
if (src->pr)
|
||||||
src->pr->mgralias = virXPathString("string(./reservations/@mgralias)", ctxt);
|
src->pr->mgralias = virXPathString("string(./reservations/@mgralias)", ctxt);
|
||||||
|
|
||||||
@ -2375,6 +2378,10 @@ qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
|
|||||||
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='storage' name='%s'/>\n", src->nodestorage);
|
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='storage' name='%s'/>\n", src->nodestorage);
|
||||||
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='format' name='%s'/>\n", src->nodeformat);
|
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='format' name='%s'/>\n", src->nodeformat);
|
||||||
|
|
||||||
|
if (src->sliceStorage)
|
||||||
|
virBufferEscapeString(&nodenamesChildBuf, "<nodename type='slice-storage' name='%s'/>\n",
|
||||||
|
src->sliceStorage->nodename);
|
||||||
|
|
||||||
virXMLFormatElement(buf, "nodenames", NULL, &nodenamesChildBuf);
|
virXMLFormatElement(buf, "nodenames", NULL, &nodenamesChildBuf);
|
||||||
|
|
||||||
if (src->pr)
|
if (src->pr)
|
||||||
|
@ -312,6 +312,9 @@
|
|||||||
<backingStore type='file' index='1'>
|
<backingStore type='file' index='1'>
|
||||||
<format type='qcow2'/>
|
<format type='qcow2'/>
|
||||||
<source file='/var/lib/libvirt/images/base.qcow2'>
|
<source file='/var/lib/libvirt/images/base.qcow2'>
|
||||||
|
<slices>
|
||||||
|
<slice type='storage' offset='1234' size='3456'/>
|
||||||
|
</slices>
|
||||||
<seclabel model='dac' relabel='yes'>
|
<seclabel model='dac' relabel='yes'>
|
||||||
<label>qemu:qemu</label>
|
<label>qemu:qemu</label>
|
||||||
</seclabel>
|
</seclabel>
|
||||||
@ -322,6 +325,7 @@
|
|||||||
<nodenames>
|
<nodenames>
|
||||||
<nodename type='storage' name='test-storage'/>
|
<nodename type='storage' name='test-storage'/>
|
||||||
<nodename type='format' name='test-format'/>
|
<nodename type='format' name='test-format'/>
|
||||||
|
<nodename type='slice-storage' name='test-slice-storage'/>
|
||||||
</nodenames>
|
</nodenames>
|
||||||
<reservations mgralias='test-alias'/>
|
<reservations mgralias='test-alias'/>
|
||||||
<relPath>base.qcow2</relPath>
|
<relPath>base.qcow2</relPath>
|
||||||
|
Loading…
Reference in New Issue
Block a user