The VIR_DOMAIN_XML_SECURE flag only has effect on the formatting
of XML so should not be passed to virDomainDefParseNode
The VIR_DOMAIN_XML_UPDATE_CPU flag has to be processed by the
driver code, so should not be passed to virDomainDefFormatInternal
---
src/conf/snapshot_conf.c | 6 ++----
src/qemu/qemu_domain.c | 4 +++-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 1f83b2c..a72ded7 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -286,8 +286,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
def->dom = virDomainDefParseNode(ctxt->node->doc, domainNode,
caps, xmlopt,
expectedVirtTypes,
- (VIR_DOMAIN_XML_INACTIVE |
- VIR_DOMAIN_XML_SECURE));
+ VIR_DOMAIN_XML_INACTIVE);
if (!def->dom)
goto cleanup;
} else {
@@ -676,8 +675,7 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid,
virBuffer buf = VIR_BUFFER_INITIALIZER;
size_t i;
- virCheckFlags(VIR_DOMAIN_XML_SECURE |
- VIR_DOMAIN_XML_UPDATE_CPU, NULL);
+ virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL);
flags |= VIR_DOMAIN_XML_INACTIVE;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 01bf39b..00fbb2f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1748,6 +1748,8 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
cpuUpdate(cpu, caps->host.cpu) < 0)
goto cleanup;
def->cpu = cpu;
+
+ flags &= ~VIR_DOMAIN_XML_UPDATE_CPU;
}
if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) {
@@ -2169,7 +2171,7 @@ qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
virUUIDFormat(vm->def->uuid, uuidstr);
newxml = virDomainSnapshotDefFormat(uuidstr, snapshot->def,
- QEMU_DOMAIN_FORMAT_LIVE_FLAGS, 1);
+ VIR_DOMAIN_XML_SECURE, 1);
if (newxml == NULL)
return -1;
--
2.1.0