qemu: Fix (managed)save and snapshots with host mode CPU

When host-model and host-passthrouh CPU modes were introduced, qemu
driver was properly modify to update guest CPU definition during
migration so that we use the right CPU at the destination. However,
similar treatment is needed for (managed)save and snapshots since they
need to save the exact CPU so that a domain can be properly restored.
To avoid repetition of such situation, all places that need live XML
share the code which generates it.

As a side effect, this patch fixes error reporting from
qemuDomainSnapshotWriteMetadata().
This commit is contained in:
Jiri Denemark
2012-03-09 16:42:46 +01:00
parent 98deac7dcc
commit 041109afef
5 changed files with 30 additions and 17 deletions

View File

@@ -13561,7 +13561,8 @@ char *virDomainSnapshotDefFormat(const char *domain_uuid,
virBuffer buf = VIR_BUFFER_INITIALIZER;
int i;
virCheckFlags(VIR_DOMAIN_XML_SECURE, NULL);
virCheckFlags(VIR_DOMAIN_XML_SECURE |
VIR_DOMAIN_XML_UPDATE_CPU, NULL);
flags |= VIR_DOMAIN_XML_INACTIVE;