mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemu_domain: Format qemuDomainObjPrivate::originalMemlock
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@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
75df6d2c29
commit
21aec91790
@ -2386,6 +2386,12 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
|
|||||||
if (qemuDomainObjPrivateXMLFormatBackups(buf, vm) < 0)
|
if (qemuDomainObjPrivateXMLFormatBackups(buf, vm) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (priv->originalMemlock > 0) {
|
||||||
|
virBufferAsprintf(buf,
|
||||||
|
"<originalMemlock>%llu</originalMemlock>\n",
|
||||||
|
priv->originalMemlock);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3102,6 +3108,13 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
|||||||
|
|
||||||
priv->memPrealloc = virXPathBoolean("boolean(./memPrealloc)", ctxt) == 1;
|
priv->memPrealloc = virXPathBoolean("boolean(./memPrealloc)", ctxt) == 1;
|
||||||
|
|
||||||
|
if (virXPathULongLong("string(./originalMemlock)",
|
||||||
|
ctxt, &priv->originalMemlock) == -2) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("failed to parse original memlock size"));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
Loading…
Reference in New Issue
Block a user