]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainQemuMonitorCommand: Add top-level flag validation
authorPeter Krempa <pkrempa@redhat.com>
Thu, 2 Apr 2026 14:46:46 +0000 (16:46 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 14 May 2026 10:13:10 +0000 (12:13 +0200)
The implementation uses 'qemuDomainQemuMonitorCommandWithFiles'
internally. To have a top level flag validation for the upcoming flag
introspection export the supported flags as a macro and add a
'virCheckFlags'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index e75d45140045808e8a785b2186b082c48428323e..6ab17b89d44fcc0c47137b6a5cc9fe358eaeb867 100644 (file)
@@ -13726,6 +13726,9 @@ qemuDomainBackupGetXMLDesc(virDomainPtr domain,
 }
 
 
+#define QEMU_DOMAIN_MONITOR_COMMAND_FLAGS \
+    VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP
+
 static int
 qemuDomainQemuMonitorCommandWithFiles(virDomainPtr domain,
                                       const char *cmd,
@@ -13743,7 +13746,7 @@ qemuDomainQemuMonitorCommandWithFiles(virDomainPtr domain,
     bool hmp;
     int fd = -1;
 
-    virCheckFlags(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP, -1);
+    virCheckFlags(QEMU_DOMAIN_MONITOR_COMMAND_FLAGS, -1);
 
     /* currently we don't pass back any fds */
     if (outfds)
@@ -13797,6 +13800,8 @@ qemuDomainQemuMonitorCommand(virDomainPtr domain,
                              char **result,
                              unsigned int flags)
 {
+    virCheckFlags(QEMU_DOMAIN_MONITOR_COMMAND_FLAGS, -1);
+
     return qemuDomainQemuMonitorCommandWithFiles(domain, cmd, 0, NULL, NULL, NULL, result, flags);
 }