]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add qemu functions for storage source private data handling
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Mar 2018 14:13:26 +0000 (15:13 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Mar 2018 09:04:56 +0000 (10:04 +0100)
The qemu driver registered the helpers from util code, but it will be
necessary to format also some qemu-specific data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_domain.c

index 72831a49a809c95b43ac57813fec3883a0ac5a82..e07eac1c96c6d7686b533eb7f23bcc2a6176ccb3 100644 (file)
@@ -1951,6 +1951,28 @@ qemuDomainObjPrivateFree(void *data)
 }
 
 
+static int
+qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt,
+                                  virStorageSourcePtr src)
+{
+    if (virStorageSourcePrivateDataParseRelPath(ctxt, src) < 0)
+        return -1;
+
+    return 0;
+}
+
+
+static int
+qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src,
+                                   virBufferPtr buf)
+{
+    if (virStorageSourcePrivateDataFormatRelPath(src, buf) < 0)
+        return -1;
+
+    return 0;
+}
+
+
 static void
 qemuDomainObjPrivateXMLFormatVcpus(virBufferPtr buf,
                                    virDomainDefPtr def)
@@ -2538,8 +2560,8 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
     .chrSourceNew = qemuDomainChrSourcePrivateNew,
     .parse = qemuDomainObjPrivateXMLParse,
     .format = qemuDomainObjPrivateXMLFormat,
-    .storageParse = virStorageSourcePrivateDataParseRelPath,
-    .storageFormat = virStorageSourcePrivateDataFormatRelPath,
+    .storageParse = qemuStorageSourcePrivateDataParse,
+    .storageFormat = qemuStorageSourcePrivateDataFormat,
 };