032100
From 02ebd15a48da7a53560bbea5e530a5b9c929daee Mon Sep 17 00:00:00 2001
032100
Message-Id: <02ebd15a48da7a53560bbea5e530a5b9c929daee@dist-git>
032100
From: Michal Privoznik <mprivozn@redhat.com>
032100
Date: Thu, 7 Jul 2022 17:44:32 +0200
032100
Subject: [PATCH] virsh: Implement --config for iothreadset
032100
MIME-Version: 1.0
032100
Content-Type: text/plain; charset=UTF-8
032100
Content-Transfer-Encoding: 8bit
032100
032100
Our man page already documents that iothreadset has --config
032100
argument. Well, it doesn't really. Normally, I'd just fix the man
032100
page, but with recent work on the API it's possible to tweak
032100
values for inactive XML too. Therefore, implement the --config
032100
argument for the command.
032100
032100
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
032100
Reviewed-by: Ján Tomko <jtomko@redhat.com>
032100
(cherry picked from commit 3ff558c1c171f66da84b10c81937c1a6895ec6fb)
032100
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2059511
032100
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
032100
---
032100
 tools/virsh-domain.c | 8 ++++++++
032100
 1 file changed, 8 insertions(+)
032100
032100
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
032100
index 43034f2f81..da63cc95ff 100644
032100
--- a/tools/virsh-domain.c
032100
+++ b/tools/virsh-domain.c
032100
@@ -7831,6 +7831,7 @@ static const vshCmdOptDef opts_iothreadset[] = {
032100
      .type = VSH_OT_INT,
032100
      .help = N_("upper boundary for worker thread pool")
032100
     },
032100
+    VIRSH_COMMON_OPT_DOMAIN_CONFIG,
032100
     VIRSH_COMMON_OPT_DOMAIN_LIVE,
032100
     VIRSH_COMMON_OPT_DOMAIN_CURRENT,
032100
     {.name = NULL}
032100
@@ -7842,6 +7843,8 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd)
032100
     g_autoptr(virshDomain) dom = NULL;
032100
     int id = 0;
032100
     bool ret = false;
032100
+    bool current = vshCommandOptBool(cmd, "current");
032100
+    bool config = vshCommandOptBool(cmd, "config");
032100
     bool live = vshCommandOptBool(cmd, "live");
032100
     unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
032100
     virTypedParameterPtr params = NULL;
032100
@@ -7852,8 +7855,13 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd)
032100
     int thread_val;
032100
     int rc;
032100
 
032100
+    VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
032100
+    VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
032100
+
032100
     if (live)
032100
         flags |= VIR_DOMAIN_AFFECT_LIVE;
032100
+    if (config)
032100
+        flags |= VIR_DOMAIN_AFFECT_CONFIG;
032100
 
032100
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
032100
         return false;
032100
-- 
032100
2.35.1
032100