]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Do not require \n in vshDebug messages
authorJiri Denemark <jdenemar@redhat.com>
Thu, 20 Feb 2025 13:04:08 +0000 (14:04 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 24 Feb 2025 10:14:11 +0000 (11:14 +0100)
Having to put a newline at the end of each debug message in virsh has
always felt strange.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
12 files changed:
tools/virsh-domain-monitor.c
tools/virsh-domain.c
tools/virsh-interface.c
tools/virsh-network.c
tools/virsh-nwfilter.c
tools/virsh-pool.c
tools/virsh-secret.c
tools/virsh-util.c
tools/virsh-volume.c
tools/virsh.c
tools/virt-admin.c
tools/vsh.c

index 9ee9090c11cb7cee3aed1b26221e90509cee1c09..76843005b2e82aaced84bf0780a964bf127e4d67 100644 (file)
@@ -1224,7 +1224,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
 
     /* Check and display whether the domain is persistent or not */
     persistent = virDomainIsPersistent(dom);
-    vshDebug(ctl, VSH_ERR_DEBUG, "Domain persistent flag value: %d\n",
+    vshDebug(ctl, VSH_ERR_DEBUG, "Domain persistent flag value: %d",
              persistent);
     if (persistent < 0)
         vshPrint(ctl, "%-15s %s\n", _("Persistent:"), _("unknown"));
index f3da2f903ff0850500c1d370e0a56e80f43d2972..171bc0ce1730bf4df566475cda7b0233aad48f58 100644 (file)
@@ -4254,7 +4254,7 @@ virshWatchTimeout(gpointer opaque)
     struct virshWatchData *data = opaque;
 
     /* suspend the domain when migration timeouts. */
-    vshDebug(data->ctl, VSH_ERR_DEBUG, "watchJob: timeout\n");
+    vshDebug(data->ctl, VSH_ERR_DEBUG, "watchJob: timeout");
     if (data->timeout_func)
         (data->timeout_func)(data->ctl, data->dom, data->opaque);
 
@@ -4266,7 +4266,7 @@ static void
 virshWatchSetTimeout(struct virshWatchData *data)
 {
     vshDebug(data->ctl, VSH_ERR_DEBUG,
-             "watchJob: setting timeout of %d secs\n", data->timeout_secs);
+             "watchJob: setting timeout of %d secs", data->timeout_secs);
 
     data->timeout_src = g_timeout_source_new_seconds(data->timeout_secs);
     g_source_set_callback(data->timeout_src,
@@ -4291,7 +4291,7 @@ virshWatchProgress(gpointer opaque)
     pthread_sigmask(SIG_BLOCK, &sigmask, &oldsigmask);
 #endif /* !WIN32 */
     vshDebug(data->ctl, VSH_ERR_DEBUG, "%s",
-             "watchJob: progress update\n");
+             "watchJob: progress update");
     ret = virDomainGetJobInfo(data->dom, &jobinfo);
 #ifndef WIN32
     pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL);
@@ -4308,7 +4308,7 @@ virshWatchProgress(gpointer opaque)
             vshTTYDisableInterrupt(data->ctl);
             data->jobStarted = true;
             vshDebug(data->ctl, VSH_ERR_DEBUG,
-                     "watchJob: job started\n");
+                     "watchJob: job started");
         }
 
         if (data->jobStarted) {
@@ -4317,7 +4317,7 @@ virshWatchProgress(gpointer opaque)
                     virshWatchSetTimeout(data);
             } else if (!data->verbose) {
                 vshDebug(data->ctl, VSH_ERR_DEBUG,
-                         "watchJob: disabling callback\n");
+                         "watchJob: disabling callback");
                 return G_SOURCE_REMOVE;
             }
         }
@@ -4339,7 +4339,7 @@ virshWatchInterrupt(GIOChannel *source G_GNUC_UNUSED,
     gsize nread = 0;
 
     vshDebug(data->ctl, VSH_ERR_DEBUG,
-             "watchJob: stdin data %d\n", condition);
+             "watchJob: stdin data %d", condition);
     if (condition & G_IO_IN) {
         g_io_channel_read_chars(data->stdin_ioc,
                                 &retchar,
@@ -4348,7 +4348,7 @@ virshWatchInterrupt(GIOChannel *source G_GNUC_UNUSED,
                                 NULL);
 
         vshDebug(data->ctl, VSH_ERR_DEBUG,
-                 "watchJob: got %zu characters\n", nread);
+                 "watchJob: got %zu characters", nread);
         if (nread == 1 &&
             vshTTYIsInterruptCharacter(data->ctl, retchar)) {
             virDomainAbortJob(data->dom);
@@ -4407,7 +4407,7 @@ virshWatchJob(vshControl *ctl,
     /* don't poll on STDIN if we are not using a terminal */
     if (vshTTYAvailable(ctl)) {
         vshDebug(ctl, VSH_ERR_DEBUG, "%s",
-                 "watchJob: on TTY, enabling Ctrl-c processing\n");
+                 "watchJob: on TTY, enabling Ctrl-c processing");
 #ifdef WIN32
         data.stdin_ioc = g_io_channel_win32_new_fd(STDIN_FILENO);
 #else
@@ -4429,7 +4429,7 @@ virshWatchJob(vshControl *ctl,
     g_main_loop_run(eventLoop);
 
     vshDebug(ctl, VSH_ERR_DEBUG,
-             "watchJob: job done, status %d\n", *job_err);
+             "watchJob: job done, status %d", *job_err);
     if (*job_err == 0 && verbose) /* print [100 %] */
         virshPrintJobProgress(label, 0, 1);
 
@@ -6118,7 +6118,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
                      _("Optional flags or --rawstats are not supported by the daemon"));
             goto cleanup;
         }
-        vshDebug(ctl, VSH_ERR_DEBUG, "detailed statistics not supported\n");
+        vshDebug(ctl, VSH_ERR_DEBUG, "detailed statistics not supported");
         vshResetLibvirtError();
         rc = virDomainGetJobInfo(dom, &info);
     }
@@ -11158,16 +11158,16 @@ virshMigrateTimeout(vshControl *ctl,
     case VIRSH_MIGRATE_TIMEOUT_DEFAULT: /* unreachable */
     case VIRSH_MIGRATE_TIMEOUT_SUSPEND:
         vshDebug(ctl, VSH_ERR_DEBUG,
-                 "migration timed out; suspending domain\n");
+                 "migration timed out; suspending domain");
         if (virDomainSuspend(dom) < 0)
-            vshDebug(ctl, VSH_ERR_INFO, "suspending domain failed\n");
+            vshDebug(ctl, VSH_ERR_INFO, "suspending domain failed");
         break;
 
     case VIRSH_MIGRATE_TIMEOUT_POSTCOPY:
         vshDebug(ctl, VSH_ERR_DEBUG,
-                 "migration timed out; switching to post-copy\n");
+                 "migration timed out; switching to post-copy");
         if (virDomainMigrateStartPostCopy(dom, 0) < 0)
-            vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed\n");
+            vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed");
         break;
     }
 }
@@ -11182,10 +11182,10 @@ virshMigrateIteration(virConnectPtr conn G_GNUC_UNUSED,
 
     if (iteration == 2) {
         vshDebug(ctl, VSH_ERR_DEBUG,
-                 "iteration %d finished; switching to post-copy\n",
+                 "iteration %d finished; switching to post-copy",
                  iteration - 1);
         if (virDomainMigrateStartPostCopy(dom, 0) < 0)
-            vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed\n");
+            vshDebug(ctl, VSH_ERR_INFO, "switching to post-copy failed");
     }
 }
 
index fda6d55158a6c1592dfdc3946418501913bbc41c..7e3103adf13856230b3f884f83bc6e46f3ee8dcc 100644 (file)
@@ -61,7 +61,7 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd,
     if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
@@ -72,13 +72,13 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd,
 
     /* try it by NAME */
     if (!is_mac && (flags & VIRSH_BYNAME)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface NAME\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface NAME",
                  cmd->def->name, optname);
         iface = virInterfaceLookupByName(priv->conn, n);
 
     /* try it by MAC */
     } else if (is_mac && (flags & VIRSH_BYMAC)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface MAC\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as interface MAC",
                  cmd->def->name, optname);
         iface = virInterfaceLookupByMACString(priv->conn, n);
     }
index 6fcc7fd8ee32cc4a4fef9f97d53afffe26d7258e..da396c000235a3c5df570c9157595f9123c138b8 100644 (file)
@@ -68,7 +68,7 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd,
     if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
@@ -76,13 +76,13 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd,
 
     /* try it by UUID */
     if ((flags & VIRSH_BYUUID) && strlen(n) == VIR_UUID_STRING_BUFLEN-1) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID",
                  cmd->def->name, optname);
         network = virNetworkLookupByUUIDString(priv->conn, n);
     }
     /* try it by NAME */
     if (!network && (flags & VIRSH_BYNAME)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network NAME\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network NAME",
                  cmd->def->name, optname);
         network = virNetworkLookupByName(priv->conn, n);
     }
@@ -106,13 +106,13 @@ virshCommandOptNetworkPort(vshControl *ctl, const vshCmd *cmd,
     if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
         *name = n;
 
-    vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID\n",
+    vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as network UUID",
              cmd->def->name, optname);
     port = virNetworkPortLookupByUUIDString(net, n);
 
index 56133d65667bc5b96797e24ef7e76ae24c174cb0..3745abb67e57f44cf9d991709cfce500959dbc7b 100644 (file)
@@ -41,7 +41,7 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd,
     if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
@@ -49,13 +49,13 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd,
 
     /* try it by UUID */
     if ((flags & VIRSH_BYUUID) && strlen(n) == VIR_UUID_STRING_BUFLEN-1) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter UUID\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter UUID",
                  cmd->def->name, optname);
         nwfilter = virNWFilterLookupByUUIDString(priv->conn, n);
     }
     /* try it by NAME */
     if (!nwfilter && (flags & VIRSH_BYNAME)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter NAME\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter NAME",
                  cmd->def->name, optname);
         nwfilter = virNWFilterLookupByName(priv->conn, n);
     }
@@ -450,13 +450,13 @@ virshCommandOptNWFilterBindingBy(vshControl *ctl,
     if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
         *name = n;
 
-    vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter binding port dev\n",
+    vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as nwfilter binding port dev",
              cmd->def->name, optname);
     binding = virNWFilterBindingLookupByPortDev(priv->conn, n);
 
index 4cd7b7ba0b020513900cbfc56f8c3ffc56ab0d52..33b130564ea8c08c6828becf77c4a85b4b61f719 100644 (file)
@@ -186,7 +186,7 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
     if (cmd->skipChecks && !n)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
@@ -194,13 +194,13 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
 
     /* try it by UUID */
     if ((flags & VIRSH_BYUUID) && strlen(n) == VIR_UUID_STRING_BUFLEN-1) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool UUID\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool UUID",
                  cmd->def->name, optname);
         pool = virStoragePoolLookupByUUIDString(priv->conn, n);
     }
     /* try it by NAME */
     if (!pool && (flags & VIRSH_BYNAME)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool NAME\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as pool NAME",
                  cmd->def->name, optname);
         pool = virStoragePoolLookupByName(priv->conn, n);
     }
@@ -1211,7 +1211,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED)
         /* Retrieve the persistence status of the pool */
         if (details) {
             persistent = virStoragePoolIsPersistent(list->pools[i]);
-            vshDebug(ctl, VSH_ERR_DEBUG, "Persistent flag value: %d\n",
+            vshDebug(ctl, VSH_ERR_DEBUG, "Persistent flag value: %d",
                      persistent);
             if (persistent < 0)
                 poolInfoTexts[i].persistent = g_strdup(_("unknown"));
@@ -1545,7 +1545,7 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
 
         /* Check and display whether the pool is persistent or not */
         persistent = virStoragePoolIsPersistent(pool);
-        vshDebug(ctl, VSH_ERR_DEBUG, "Pool persistent flag value: %d\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "Pool persistent flag value: %d",
                  persistent);
         if (persistent < 0)
             vshPrint(ctl, "%-15s %s\n", _("Persistent:"),  _("unknown"));
index 6655d3211e432c7b14b1d38207eab121fb33dcb4..7c81c108451a7a652a1c1288bd0a7d7582e1f55a 100644 (file)
@@ -45,7 +45,7 @@ virshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name)
         return NULL;
 
     vshDebug(ctl, VSH_ERR_DEBUG,
-             "%s: found option <%s>: %s\n", cmd->def->name, optname, n);
+             "%s: found option <%s>: %s", cmd->def->name, optname, n);
 
     if (name != NULL)
         *name = n;
index ab350f0326d408f43289460a5eafd125e1286d68..55ab71f26aca6034c0624b9acdec6d6c7ffa3833 100644 (file)
@@ -39,7 +39,7 @@ virshLookupDomainInternal(vshControl *ctl,
     /* try it by ID */
     if (flags & VIRSH_BYID) {
         if (virStrToLong_i(name, NULL, 10, &id) == 0 && id >= 0) {
-            vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> looks like ID\n",
+            vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> looks like ID",
                      cmdname);
             dom = virDomainLookupByID(priv->conn, id);
         }
@@ -48,14 +48,14 @@ virshLookupDomainInternal(vshControl *ctl,
     /* try it by UUID */
     if (!dom && (flags & VIRSH_BYUUID) &&
         strlen(name) == VIR_UUID_STRING_BUFLEN-1) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain UUID\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain UUID",
                  cmdname);
         dom = virDomainLookupByUUIDString(priv->conn, name);
     }
 
     /* try it by NAME */
     if (!dom && (flags & VIRSH_BYNAME)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain NAME\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <domain> trying as domain NAME",
                  cmdname);
         dom = virDomainLookupByName(priv->conn, name);
     }
@@ -90,7 +90,7 @@ virshCommandOptDomainBy(vshControl *ctl,
     if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
         return NULL;
 
-    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
index 8805b8c06b92b20415be00c356753232e0474bcf..430961fef2a5559aeda9bad841b50c14d15eff65 100644 (file)
@@ -109,7 +109,7 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
         }
     }
 
-    vshDebug(ctl, VSH_ERR_DEBUG, "%s: found option <%s>: %s\n",
+    vshDebug(ctl, VSH_ERR_DEBUG, "%s: found option <%s>: %s",
              cmd->def->name, optname, n);
 
     if (name)
@@ -117,19 +117,19 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
 
     /* try it by name */
     if (pool && (flags & VIRSH_BYNAME)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol name\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol name",
                  cmd->def->name, optname);
         vol = virStorageVolLookupByName(pool, n);
     }
     /* try it by key */
     if (!vol && (flags & VIRSH_BYUUID)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol key\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol key",
                  cmd->def->name, optname);
         vol = virStorageVolLookupByKey(priv->conn, n);
     }
     /* try it by path */
     if (!vol && (flags & VIRSH_BYUUID)) {
-        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol path\n",
+        vshDebug(ctl, VSH_ERR_DEBUG, "%s: <%s> trying as vol path",
                  cmd->def->name, optname);
         vol = virStorageVolLookupByPath(priv->conn, n);
     }
@@ -293,36 +293,36 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
         /* Lookup snapshot backing volume.  Try the backing-vol
          *  parameter as a name */
         vshDebug(ctl, VSH_ERR_DEBUG,
-                 "%s: Look up backing store volume '%s' as name\n",
+                 "%s: Look up backing store volume '%s' as name",
                  cmd->def->name, snapshotStrVol);
         snapVol = virStorageVolLookupByName(pool, snapshotStrVol);
         if (snapVol)
                 vshDebug(ctl, VSH_ERR_DEBUG,
-                         "%s: Backing store volume found using '%s' as name\n",
+                         "%s: Backing store volume found using '%s' as name",
                          cmd->def->name, snapshotStrVol);
 
         if (snapVol == NULL) {
             /* Snapshot backing volume not found by name.  Try the
              *  backing-vol parameter as a key */
             vshDebug(ctl, VSH_ERR_DEBUG,
-                     "%s: Look up backing store volume '%s' as key\n",
+                     "%s: Look up backing store volume '%s' as key",
                      cmd->def->name, snapshotStrVol);
             snapVol = virStorageVolLookupByKey(priv->conn, snapshotStrVol);
             if (snapVol)
                 vshDebug(ctl, VSH_ERR_DEBUG,
-                         "%s: Backing store volume found using '%s' as key\n",
+                         "%s: Backing store volume found using '%s' as key",
                          cmd->def->name, snapshotStrVol);
         }
         if (snapVol == NULL) {
             /* Snapshot backing volume not found by key.  Try the
              *  backing-vol parameter as a path */
             vshDebug(ctl, VSH_ERR_DEBUG,
-                     "%s: Look up backing store volume '%s' as path\n",
+                     "%s: Look up backing store volume '%s' as path",
                      cmd->def->name, snapshotStrVol);
             snapVol = virStorageVolLookupByPath(priv->conn, snapshotStrVol);
             if (snapVol)
                 vshDebug(ctl, VSH_ERR_DEBUG,
-                         "%s: Backing store volume found using '%s' as path\n",
+                         "%s: Backing store volume found using '%s' as path",
                          cmd->def->name, snapshotStrVol);
         }
         if (snapVol == NULL) {
index a958f2b82f569bc1c4a08ae9460aa7cc652b8733..6abae3dae904d431d6c862850898eaf37b561805 100644 (file)
@@ -165,7 +165,7 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly)
             goto cleanup;
         }
         vshDebug(ctl, VSH_ERR_INFO, "%s",
-                 _("Failed to setup keepalive on connection\n"));
+                 _("Failed to setup keepalive on connection"));
         vshResetLibvirtError();
     }
 
@@ -769,7 +769,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv)
         /* parse command */
         ctl->imode = false;
         if (argc - optind == 1) {
-            vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"\n", argv[optind]);
+            vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"", argv[optind]);
             return vshCommandStringParse(ctl, argv[optind], NULL);
         } else {
             return vshCommandArgvParse(ctl, argc - optind, argv + optind);
index 325b7aa827544b624fda5103a1848c41ae5f54e6..16c9b2173abb8e57bf900a7a6baa7861be3cce11 100644 (file)
@@ -1332,7 +1332,7 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **argv)
         /* parse command */
         ctl->imode = false;
         if (argc - optind == 1) {
-            vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"\n", argv[optind]);
+            vshDebug(ctl, VSH_ERR_INFO, "commands: \"%s\"", argv[optind]);
             return vshCommandStringParse(ctl, argv[optind], NULL);
         } else {
             return vshCommandArgvParse(ctl, argc - optind, argv + optind);
index 812fc81bdeb7e0f3e543c92cc25296be1f0678c3..fb00cc40a6fba5b6062bccaabb1f5699969cb6c0 100644 (file)
@@ -542,7 +542,7 @@ vshCmdOptAssign(vshControl *ctl,
     case VSH_OT_BOOL:
         /* nothing to do */
         if (report) {
-            vshDebug(ctl, VSH_ERR_INFO, "%s: %s(bool)\n",
+            vshDebug(ctl, VSH_ERR_INFO, "%s: %s(bool)",
                      cmd->def->name, opt->def->name);
         }
         break;
@@ -550,7 +550,7 @@ vshCmdOptAssign(vshControl *ctl,
     case VSH_OT_STRING:
     case VSH_OT_INT:
         if (report) {
-            vshDebug(ctl, VSH_ERR_INFO, "%s: %s(optdata): %s\n",
+            vshDebug(ctl, VSH_ERR_INFO, "%s: %s(optdata): %s",
                      cmd->def->name, opt->def->name, NULLSTR(val));
         }
 
@@ -559,7 +559,7 @@ vshCmdOptAssign(vshControl *ctl,
 
     case VSH_OT_ARGV:
         if (report) {
-            vshDebug(ctl, VSH_ERR_INFO, "%s: %s(argv: %zu): %s\n",
+            vshDebug(ctl, VSH_ERR_INFO, "%s: %s(argv: %zu): %s",
                      cmd->def->name, opt->def->name, opt->nargv, NULLSTR(val));
         }
 
@@ -1973,7 +1973,7 @@ vshDebug(vshControl *ctl, int level, const char *format, ...)
 
     vshOutputLogFile(ctl, level, str);
 
-    fputs(str, stdout);
+    fprintf(stderr, "%s\n", str);
     fflush(stdout);
 }