1. Add a debuginfo print patch on Libvirtd, if privateData.format does not
exist, log it:
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -30186,6 +30186,11 @@ virDomainObjFormat(virDomainObjPtr obj,
xmlopt->privateData.format(&buf, obj) < 0)
return NULL;
+ if (!xmlopt->privateData.format) {
+ VIR_WARN("PrivateData formatter driver does not exist");
+ }
+
2. Add a private patch(Not the complete code):
Stop process if malformed config found
Malformed material may prevent the virtual machine from
loading in its live state, according to the configuration
XML. If such a scenario was found by the Libvirt service
during startup, report an error and terminate.
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ba5eb7ad1b..9a97fa63fd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -951,7 +951,7 @@ qemuStateInitialize(bool privileged,
/* Get all the running persistent or transient configs first */
if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
cfg->stateDir,
- NULL, true, false,
+ NULL, true, true,
qemu_driver->xmlopt,
NULL, NULL) < 0)
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1286,14 +1286,14 @@ bhyveStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(bhyve_driver->domains,
BHYVE_STATE_DIR,
- NULL, true,
+ NULL, true, false,
bhyve_driver->xmlopt,
NULL, NULL) < 0)
goto cleanup;
if (virDomainObjListLoadAllConfigs(bhyve_driver->domains,
BHYVE_CONFIG_DIR,
- BHYVE_AUTOSTART_DIR, false,
+ BHYVE_AUTOSTART_DIR, false, false,
bhyve_driver->xmlopt,
NULL, NULL) < 0)
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -584,6 +584,7 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
const char *configDir,
const char *autostartDir,
bool liveStatus,
+ bool liveStatusErrorFatal,
virDomainXMLOptionPtr xmlopt,
virDomainLoadConfigNotify notify,
void *opaque)
@@ -630,9 +631,14 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
virDomainObjEndAPI(&dom);
} else {
VIR_ERROR(_("Failed to load config for domain '%s'"), entry->d_name);
+ if (liveStatus && liveStatusErrorFatal) {
+ ret = -1;
+ goto end;
+ }
}
}
+end:
VIR_DIR_CLOSE(dir);
virObjectRWUnlock(doms);
diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h
index 6150e13aa4..1ff3679c50 100644
--- a/src/conf/virdomainobjlist.h
+++ b/src/conf/virdomainobjlist.h
@@ -66,6 +66,7 @@ int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
const char *configDir,
const char *autostartDir,
bool liveStatus,
+ bool liveStatusErrorFatal,
virDomainXMLOptionPtr xmlopt,
virDomainLoadConfigNotify notify,
void *opaque);
...
3. Launch the migration and use "systemctl restart libvirt" to restart Libvirtd
once after migration enters the perform phase.
4. Search the log message:
$ cat /var/log/zbs/libvirtd.log |egrep "PrivateData formatter driver does not exist|remoteDispatchDomainMigratePerform3Params"
2025-09-22 03:06:12.517+0000: 1124258: debug : virThreadJobSet:94 : Thread 1124258 (rpc-worker) is now running job remoteDispatchDomainMigratePerform3Params
2025-09-22 03:06:12.517+0000: 1124258: debug : remoteDispatchDomainMigratePerform3ParamsHelper:8804 : server=0x556317979660 client=0x55631799eff0 msg=0x55631799c010 rerr=0x7f08c688b9c0 args=0x7f08a800a820 ret=0x7f08a80053b0
2025-09-22 03:06:21.959+0000: 1124258: warning : virDomainObjFormat:30190 : PrivateData formatter driver does not exist
2025-09-22 03:06:25.141+0000: 1124258: warning : virDomainObjFormat:30190 : PrivateData formatter driver does not exist
2025-09-22 03:06:25.141+0000: 1124258: warning : virDomainObjFormat:30190 : PrivateData formatter driver does not exist
2025-09-22 03:06:25.153+0000: 1124258: warning : virDomainObjFormat:30190 : PrivateData formatter driver does not exist
2025-09-22 03:06:25.153+0000: 1124258: debug : virThreadJobClear:119 : Thread 1124258 (rpc-worker) finished job remoteDispatchDomainMigratePerform3Params with ret=-1
Migration rpc-worker routine print the message
5. Here we see the status XML:
<domstatus state='running' reason='migrated' pid='1092202'>
<taint flag='custom-argv'/>
<taint flag='custom-ga-command'/>
<domain type='kvm' id='1' xmlns:qemu='
http://libvirt.org/schemas/domain/qemu/1.0'>
<name>88030027-a5ce-4c19-aacc-5f1decf0b647</name>
<uuid>6c677d6f-d140-48ca-b4ae-aff7fa7e4c50</uuid>
<description>SmartX</description>
<maxMemory slots='255' unit='KiB'>4194304000</maxMemory>
...