mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemu: attach/detach device: Move 'virCheckFlags' to top level functions
Move the flag check to the top level to allow programatic introspection of supported flags. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
1 parent
227f4570d8
commit
a55ca07c8a
1 file changed
+6
-6
@@ -7423,9 +7423,6 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObj *vm,
|
||||
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
||||
cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
/* The config and live post processing address auto-generation algorithms
|
||||
@@ -7518,6 +7515,9 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
|
||||
virDomainObj *vm = NULL;
|
||||
int ret = -1;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
||||
if (!(vm = qemuDomainObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
@@ -7666,9 +7666,6 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver,
|
||||
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
|
||||
g_autoptr(virDomainDef) vmdef = NULL;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
||||
cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
if ((flags & VIR_DOMAIN_AFFECT_CONFIG) &&
|
||||
@@ -7802,6 +7799,9 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
|
||||
virDomainObj *vm = NULL;
|
||||
int ret = -1;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
|
||||
VIR_DOMAIN_AFFECT_CONFIG, -1);
|
||||
|
||||
if (!(vm = qemuDomainObjFromDomain(dom)))
|
||||
goto cleanup;
|
||||
|
||||
|
||||
Reference in new issue
Block a user