From: Hyman Huang <[email protected]>

When saving the domain status in the path of the virDomainObjSave
function, Libvirtd will omit the private data if the format
interface is not provided.

When the Libvirtd service is starting up and the driver has not
yet been initialized, this behavior is justified.

However, when the service is shutting down, the driver is being
finalized and the interface is being released, a migration job
or another job may call the qemuDomainSaveStatus and save the
domain status at the same time. For the latter, this behavior
causes the XML to be saved without private information (such as
monitor path and qemuCaps), which is required for the Libvirtd
service to manage a VM during startup. As a result, after restarting
the Libvirtd service, a running VM that is being migrated previously
might escape management.

Thus, when formatting the status XML for a running virtual machine,
we need to presume that the "privateData.format" interface is present.

Add a thorough check in the virDomainObjSave path to make sure that
private data in the status XML file always exists for the running VM
so that we won't lose it after restart the Libvirtd service.

Please review, thanks.

Yong

Hyman Huang (1):
  domain_conf: Do not omit private data when formatting the status XML

 src/conf/domain_conf.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

-- 
2.27.0

Reply via email to