mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
use new macro helpers to check flag requirements
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
ff3f93bcc2
commit
6e3f9cbc9c
@ -221,12 +221,9 @@ virDomainSnapshotCreateXML(virDomainPtr domain,
|
||||
virCheckNonNullArgGoto(xmlDesc, error);
|
||||
virCheckReadOnlyGoto(conn->flags, error);
|
||||
|
||||
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT) &&
|
||||
!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)) {
|
||||
virReportInvalidArg(flags, "%s",
|
||||
_("use of 'current' flag in requires 'redefine' flag"));
|
||||
goto error;
|
||||
}
|
||||
VIR_REQUIRE_FLAG_GOTO(VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT,
|
||||
VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE,
|
||||
error);
|
||||
|
||||
VIR_EXCLUSIVE_FLAGS_GOTO(VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE,
|
||||
VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA,
|
||||
|
@ -14943,12 +14943,9 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
||||
VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC |
|
||||
VIR_DOMAIN_SNAPSHOT_CREATE_LIVE, NULL);
|
||||
|
||||
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) &&
|
||||
!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("quiesce requires disk-only"));
|
||||
return NULL;
|
||||
}
|
||||
VIR_REQUIRE_FLAG_RET(VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE,
|
||||
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY,
|
||||
NULL);
|
||||
|
||||
if ((redefine && !(flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT)) ||
|
||||
(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA))
|
||||
|
Loading…
x
Reference in New Issue
Block a user