mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
virDomainSnapshotRedefineValidate: Fix validation of VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY flag
External snapshot with memory is created without using the VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY flag, but rather with properly configuring the XML. When redefining the code should be checking the same thing as by definition an external snapshot with memory is not a disk-only snapshot. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ebfe9b1a15
commit
82e0a1878e
@ -478,7 +478,8 @@ virDomainSnapshotRedefineValidate(virDomainSnapshotDef *def,
|
||||
bool external = def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT ||
|
||||
virDomainSnapshotDefIsExternal(def);
|
||||
|
||||
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) && !external) {
|
||||
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) &&
|
||||
def->state != VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT) {
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("disk-only flag for snapshot %s requires "
|
||||
"disk-snapshot state"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user