From: Jim Fehlig Date: Mon, 24 Jan 2022 19:03:20 +0000 (-0700) Subject: libxl: Add lock process indicator to saved VM state X-Git-Tag: v8.1.0-rc1~314 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31e937fb3b7d0aa040a879394eff700bc1108251;p=thirdparty%2Flibvirt.git libxl: Add lock process indicator to saved VM state Commit fa58f571ee added a lock processes indicator to the libxlDomainObjPrivate struct to note that a lock process was successfully started for the VM. However, the commit neglected to add the indicator to the VM's saved state file. As a result, the indicator is lost on libvirtd restart, along with the knowledge of whether a lock process was started for the VM. This change adds support for the indicator in the domainObjPrivate data parse and format callbacks, ensuring its value survives libvirtd restarts. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index feca60f7d2..577985b5ea 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -226,6 +226,7 @@ libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, libxlDomainObjPrivate *priv = vm->privateData; priv->lockState = virXPathString("string(./lockstate)", ctxt); + priv->lockProcessRunning = virXPathBoolean("boolean(./lockProcessRunning)", ctxt); return 0; } @@ -239,6 +240,9 @@ libxlDomainObjPrivateXMLFormat(virBuffer *buf, if (priv->lockState) virBufferAsprintf(buf, "%s\n", priv->lockState); + if (priv->lockProcessRunning) + virBufferAddLit(buf, "\n"); + return 0; }