From nobody Tue Dec 16 17:13:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1740065422373360.64995654621885; Thu, 20 Feb 2025 07:30:22 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3CD582256; Thu, 20 Feb 2025 10:30:21 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 37A332245; Thu, 20 Feb 2025 10:26:59 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id E17BA2206; Thu, 20 Feb 2025 10:26:52 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CB3BC21B1 for ; Thu, 20 Feb 2025 10:26:36 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-1AONRk6aMC2KdWK5js7Bww-1; Thu, 20 Feb 2025 10:26:35 -0500 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 68429180087F for ; Thu, 20 Feb 2025 15:26:34 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E6B8719412A3 for ; Thu, 20 Feb 2025 15:26:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740065196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1LbB96w2HmVZ8TORmeqGUM9AIz8SyQsk8a3WJ8aX/zY=; b=O5umHqK848KO/owXbZGPPb3xCaQOiXUxt4gAr0UpLZxT/t1KuFaXZKRIrdXGOJZEYPzLOq n3uljZbzHoEak9H/bu6U7LZH6YH/DifAFc30ibbGT0vMTbjB8NT9SvCJCb+wdFnU/02az6 WWgnSc6hCbeYS70hBFv2w64zFD88LnQ= X-MC-Unique: 1AONRk6aMC2KdWK5js7Bww-1 X-Mimecast-MFC-AGG-ID: 1AONRk6aMC2KdWK5js7Bww_1740065194 From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 08/13] virsh: Do not require \n in vshDebug messages Date: Thu, 20 Feb 2025 16:26:10 +0100 Message-ID: <64aeb1983143a1b506f7ece490ef3463df5a7d7c.1740064957.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rrktRn5r6zYG6rzfUOPGuSU6P_6T98InUNZZmfqC5-Y_1740065194 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: B4VNYOHUJMSO6LVGD522TAIDOMVP2H3J X-Message-ID-Hash: B4VNYOHUJMSO6LVGD522TAIDOMVP2H3J X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1740065423679019100 Content-Type: text/plain; charset="utf-8" Having to put a newline at the end of each debug message in virsh has always felt strange. Signed-off-by: Jiri Denemark --- tools/virsh-domain-monitor.c | 2 +- tools/virsh-domain.c | 32 ++++++++++++++++---------------- tools/virsh-interface.c | 6 +++--- tools/virsh-network.c | 10 +++++----- tools/virsh-nwfilter.c | 10 +++++----- tools/virsh-pool.c | 10 +++++----- tools/virsh-secret.c | 2 +- tools/virsh-util.c | 8 ++++---- tools/virsh-volume.c | 20 ++++++++++---------- tools/virsh.c | 4 ++-- tools/virt-admin.c | 2 +- tools/vsh.c | 8 ++++---- 12 files changed, 57 insertions(+), 57 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 9ee9090c11..76843005b2 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1224,7 +1224,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) =20 /* Check and display whether the domain is persistent or not */ persistent =3D 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")); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index f3da2f903f..171bc0ce17 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -4254,7 +4254,7 @@ virshWatchTimeout(gpointer opaque) struct virshWatchData *data =3D opaque; =20 /* 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); =20 @@ -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); =20 data->timeout_src =3D 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 =3D virDomainGetJobInfo(data->dom, &jobinfo); #ifndef WIN32 pthread_sigmask(SIG_SETMASK, &oldsigmask, NULL); @@ -4308,7 +4308,7 @@ virshWatchProgress(gpointer opaque) vshTTYDisableInterrupt(data->ctl); data->jobStarted =3D true; vshDebug(data->ctl, VSH_ERR_DEBUG, - "watchJob: job started\n"); + "watchJob: job started"); } =20 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 =3D 0; =20 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); =20 vshDebug(data->ctl, VSH_ERR_DEBUG, - "watchJob: got %zu characters\n", nread); + "watchJob: got %zu characters", nread); if (nread =3D=3D 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 =3D g_io_channel_win32_new_fd(STDIN_FILENO); #else @@ -4429,7 +4429,7 @@ virshWatchJob(vshControl *ctl, g_main_loop_run(eventLoop); =20 vshDebug(ctl, VSH_ERR_DEBUG, - "watchJob: job done, status %d\n", *job_err); + "watchJob: job done, status %d", *job_err); if (*job_err =3D=3D 0 && verbose) /* print [100 %] */ virshPrintJobProgress(label, 0, 1); =20 @@ -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 =3D 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; =20 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_U= NUSED, =20 if (iteration =3D=3D 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"); } } =20 diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index fda6d55158..7e3103adf1 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -61,7 +61,7 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd = *cmd, if (vshCommandOptString(ctl, cmd, optname, &n) < 0) return NULL; =20 - 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); =20 if (name) @@ -72,13 +72,13 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCm= d *cmd, =20 /* 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 =3D virInterfaceLookupByName(priv->conn, n); =20 /* 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 =3D virInterfaceLookupByMACString(priv->conn, n); } diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 6fcc7fd8ee..da396c0002 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -68,7 +68,7 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *c= md, if (vshCommandOptString(ctl, cmd, optname, &n) < 0) return NULL; =20 - 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); =20 if (name) @@ -76,13 +76,13 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd = *cmd, =20 /* try it by UUID */ if ((flags & VIRSH_BYUUID) && strlen(n) =3D=3D 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 =3D 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 =3D virNetworkLookupByName(priv->conn, n); } @@ -106,13 +106,13 @@ virshCommandOptNetworkPort(vshControl *ctl, const vsh= Cmd *cmd, if (vshCommandOptString(ctl, cmd, optname, &n) < 0) return NULL; =20 - 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); =20 if (name) *name =3D n; =20 - 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 =3D virNetworkPortLookupByUUIDString(net, n); =20 diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index 56133d6566..3745abb67e 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -41,7 +41,7 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *= cmd, if (vshCommandOptString(ctl, cmd, optname, &n) < 0) return NULL; =20 - 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); =20 if (name) @@ -49,13 +49,13 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd= *cmd, =20 /* try it by UUID */ if ((flags & VIRSH_BYUUID) && strlen(n) =3D=3D 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 =3D 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 =3D virNWFilterLookupByName(priv->conn, n); } @@ -450,13 +450,13 @@ virshCommandOptNWFilterBindingBy(vshControl *ctl, if (vshCommandOptString(ctl, cmd, optname, &n) < 0) return NULL; =20 - 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); =20 if (name) *name =3D n; =20 - 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 =3D virNWFilterBindingLookupByPortDev(priv->conn, n); =20 diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 4cd7b7ba0b..33b130564e 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -186,7 +186,7 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cm= d, const char *optname, if (cmd->skipChecks && !n) return NULL; =20 - 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); =20 if (name) @@ -194,13 +194,13 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *= cmd, const char *optname, =20 /* try it by UUID */ if ((flags & VIRSH_BYUUID) && strlen(n) =3D=3D 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 =3D 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 =3D 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 =3D 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 =3D g_strdup(_("unknown")); @@ -1545,7 +1545,7 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd) =20 /* Check and display whether the pool is persistent or not */ persistent =3D 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")); diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 6655d3211e..7c81c10845 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -45,7 +45,7 @@ virshCommandOptSecret(vshControl *ctl, const vshCmd *cmd,= const char **name) return NULL; =20 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); =20 if (name !=3D NULL) *name =3D n; diff --git a/tools/virsh-util.c b/tools/virsh-util.c index ab350f0326..55ab71f26a 100644 --- a/tools/virsh-util.c +++ b/tools/virsh-util.c @@ -39,7 +39,7 @@ virshLookupDomainInternal(vshControl *ctl, /* try it by ID */ if (flags & VIRSH_BYID) { if (virStrToLong_i(name, NULL, 10, &id) =3D=3D 0 && id >=3D 0) { - vshDebug(ctl, VSH_ERR_DEBUG, "%s: looks like ID\n", + vshDebug(ctl, VSH_ERR_DEBUG, "%s: looks like ID", cmdname); dom =3D virDomainLookupByID(priv->conn, id); } @@ -48,14 +48,14 @@ virshLookupDomainInternal(vshControl *ctl, /* try it by UUID */ if (!dom && (flags & VIRSH_BYUUID) && strlen(name) =3D=3D VIR_UUID_STRING_BUFLEN-1) { - vshDebug(ctl, VSH_ERR_DEBUG, "%s: trying as domain UUID\n= ", + vshDebug(ctl, VSH_ERR_DEBUG, "%s: trying as domain UUID", cmdname); dom =3D virDomainLookupByUUIDString(priv->conn, name); } =20 /* try it by NAME */ if (!dom && (flags & VIRSH_BYNAME)) { - vshDebug(ctl, VSH_ERR_DEBUG, "%s: trying as domain NAME\n= ", + vshDebug(ctl, VSH_ERR_DEBUG, "%s: trying as domain NAME", cmdname); dom =3D virDomainLookupByName(priv->conn, name); } @@ -90,7 +90,7 @@ virshCommandOptDomainBy(vshControl *ctl, if (vshCommandOptString(ctl, cmd, optname, &n) < 0) return NULL; =20 - 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); =20 if (name) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 8805b8c06b..430961fef2 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -109,7 +109,7 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, } } =20 - 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); =20 if (name) @@ -117,19 +117,19 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *c= md, =20 /* 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 =3D 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 =3D 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 =3D 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 =3D virStorageVolLookupByName(pool, snapshotStrVol); if (snapVol) vshDebug(ctl, VSH_ERR_DEBUG, - "%s: Backing store volume found using '%s' as nam= e\n", + "%s: Backing store volume found using '%s' as nam= e", cmd->def->name, snapshotStrVol); =20 if (snapVol =3D=3D 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 =3D virStorageVolLookupByKey(priv->conn, snapshotStrVo= l); 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 =3D=3D 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 =3D virStorageVolLookupByPath(priv->conn, snapshotStrV= ol); if (snapVol) vshDebug(ctl, VSH_ERR_DEBUG, - "%s: Backing store volume found using '%s' as pat= h\n", + "%s: Backing store volume found using '%s' as pat= h", cmd->def->name, snapshotStrVol); } if (snapVol =3D=3D NULL) { diff --git a/tools/virsh.c b/tools/virsh.c index a958f2b82f..6abae3dae9 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -165,7 +165,7 @@ virshConnect(vshControl *ctl, const char *uri, bool rea= donly) goto cleanup; } vshDebug(ctl, VSH_ERR_INFO, "%s", - _("Failed to setup keepalive on connection\n")); + _("Failed to setup keepalive on connection")); vshResetLibvirtError(); } =20 @@ -769,7 +769,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) /* parse command */ ctl->imode =3D false; if (argc - optind =3D=3D 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); diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 325b7aa827..16c9b2173a 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -1332,7 +1332,7 @@ vshAdmParseArgv(vshControl *ctl, int argc, char **arg= v) /* parse command */ ctl->imode =3D false; if (argc - optind =3D=3D 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); diff --git a/tools/vsh.c b/tools/vsh.c index 812fc81bde..fb00cc40a6 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -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)); } =20 @@ -559,7 +559,7 @@ vshCmdOptAssign(vshControl *ctl, =20 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(v= al)); } =20 @@ -1973,7 +1973,7 @@ vshDebug(vshControl *ctl, int level, const char *form= at, ...) =20 vshOutputLogFile(ctl, level, str); =20 - fputs(str, stdout); + fprintf(stderr, "%s\n", str); fflush(stdout); } =20 --=20 2.48.1