mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 10:03:49 +03:00
conf: Skip post parse callbacks when creating copy
When creating a copy of virDomainDef we save ourselves the trouble of writing deep-copy functions and just format and parse back domain/device XML. However, the XML we are parsing was already fully formatted - there is no reason to run post parse callbacks (which fill in blanks - there are none!). Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
c0f90799bc
commit
581b7756af
@ -24680,7 +24680,8 @@ virDomainDefCopy(virDomainDefPtr src,
|
|||||||
virDomainDefPtr ret;
|
virDomainDefPtr ret;
|
||||||
unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
|
unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE;
|
||||||
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
|
||||||
|
VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE;
|
||||||
|
|
||||||
if (migratable)
|
if (migratable)
|
||||||
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE;
|
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE | VIR_DOMAIN_DEF_FORMAT_MIGRATABLE;
|
||||||
@ -25167,7 +25168,8 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
|
|||||||
xmlStr = virBufferContentAndReset(&buf);
|
xmlStr = virBufferContentAndReset(&buf);
|
||||||
ret = virDomainDeviceDefParse(xmlStr, def, caps, xmlopt,
|
ret = virDomainDeviceDefParse(xmlStr, def, caps, xmlopt,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
|
||||||
|
VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(xmlStr);
|
VIR_FREE(xmlStr);
|
||||||
|
@ -3380,7 +3380,8 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
|
||||||
|
VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user