[PATCH 2/4] qemu_domain: Format qemuDomainObjPrivate::originalMemlock

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

 



Now that qemuDomainObjPrivate struct gained new member format it
into XML and parse it so that the value is preserved across
daemon restarts.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 4edae9cca9..9602a42196 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2386,6 +2386,12 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
     if (qemuDomainObjPrivateXMLFormatBackups(buf, vm) < 0)
         return -1;
 
+    if (priv->originalMemlock > 0) {
+        virBufferAsprintf(buf,
+                          "<originalMemlock>%llu</originalMemlock>\n",
+                          priv->originalMemlock);
+    }
+
     return 0;
 }
 
@@ -3102,6 +3108,13 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
 
     priv->memPrealloc = virXPathBoolean("boolean(./memPrealloc)", ctxt) == 1;
 
+    if (virXPathULongLong("string(./originalMemlock)",
+                          ctxt, &priv->originalMemlock) == -2) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("failed to parse agent timeout"));
+        goto error;
+    }
+
     return 0;
 
  error:
-- 
2.35.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