]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Implement --config for iothreadset
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 7 Jul 2022 15:44:32 +0000 (17:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 Jul 2022 09:55:06 +0000 (11:55 +0200)
Our man page already documents that iothreadset has --config
argument. Well, it doesn't really. Normally, I'd just fix the man
page, but with recent work on the API it's possible to tweak
values for inactive XML too. Therefore, implement the --config
argument for the command.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain.c

index 43034f2f8109ca8163c83c48f054dd1ba13ea209..da63cc95fff632f291e02194aec4fecf5c892840 100644 (file)
@@ -7831,6 +7831,7 @@ static const vshCmdOptDef opts_iothreadset[] = {
      .type = VSH_OT_INT,
      .help = N_("upper boundary for worker thread pool")
     },
+    VIRSH_COMMON_OPT_DOMAIN_CONFIG,
     VIRSH_COMMON_OPT_DOMAIN_LIVE,
     VIRSH_COMMON_OPT_DOMAIN_CURRENT,
     {.name = NULL}
@@ -7842,6 +7843,8 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd)
     g_autoptr(virshDomain) dom = NULL;
     int id = 0;
     bool ret = false;
+    bool current = vshCommandOptBool(cmd, "current");
+    bool config = vshCommandOptBool(cmd, "config");
     bool live = vshCommandOptBool(cmd, "live");
     unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
     virTypedParameterPtr params = NULL;
@@ -7852,8 +7855,13 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd)
     int thread_val;
     int rc;
 
+    VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
+    VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
+
     if (live)
         flags |= VIR_DOMAIN_AFFECT_LIVE;
+    if (config)
+        flags |= VIR_DOMAIN_AFFECT_CONFIG;
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
         return false;