[PATCH v3 10/15] qemu: domain: Store nodenames of slice in status XML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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 d24d1c81db..534a91cf82 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2322,6 +2322,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);

@@ -2375,6 +2378,10 @@ qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
     virBufferEscapeString(&nodenamesChildBuf, "<nodename type='storage' name='%s'/>\n", src->nodestorage);
     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);

     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 @@
         <backingStore type='file' index='1'>
           <format type='qcow2'/>
           <source file='/var/lib/libvirt/images/base.qcow2'>
+            <slices>
+              <slice type='storage' offset='1234' size='3456'/>
+            </slices>
             <seclabel model='dac' relabel='yes'>
               <label>qemu:qemu</label>
             </seclabel>
@@ -322,6 +325,7 @@
               <nodenames>
                 <nodename type='storage' name='test-storage'/>
                 <nodename type='format' name='test-format'/>
+                <nodename type='slice-storage' name='test-slice-storage'/>
               </nodenames>
               <reservations mgralias='test-alias'/>
               <relPath>base.qcow2</relPath>
-- 
2.24.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux