qemu: migration: Validate migration XML

There's no point in skiping the validation step:
- on the source, the VM is parsed for ABI stability checking, thus the
  equivalent config was validated when the VM was started

- on the destination, the XML will be validated inside qemuProcessInit
  very soon after it is parsed

This fixes problems such as if the user uses a relative path in the disk
source or omits the source, as the disk migration code reasonably
expects that all checks were performed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2023-12-05 16:17:57 +01:00
parent d96858b0e8
commit b99c709d8d

View File

@ -2523,8 +2523,7 @@ qemuMigrationSrcBeginXML(virDomainObj *vm,
g_autoptr(virDomainDef) def = NULL;
if (!(def = virDomainDefParseString(xmlin, driver->xmlopt, priv->qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
return NULL;
if (!qemuDomainCheckABIStability(driver, vm, def))
@ -3316,8 +3315,7 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
newdef = virDomainDefParseString(xmlout, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (!newdef)
goto cleanup;
@ -3843,8 +3841,7 @@ qemuMigrationAnyPrepareDef(virQEMUDriver *driver,
if (!(def = virDomainDefParseString(dom_xml, driver->xmlopt,
qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
if (dname) {