From nobody Tue Dec 16 16:56:26 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 1740065566959706.8249871077367; Thu, 20 Feb 2025 07:32:46 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id D3256220E; Thu, 20 Feb 2025 10:32:45 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id F10A5226C; Thu, 20 Feb 2025 10:27:08 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 7F95221C2; Thu, 20 Feb 2025 10:26:57 -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 2DC731985 for ; Thu, 20 Feb 2025 10:26:45 -0500 (EST) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-166-C7IcajePMg6gE2H0Z0YnBw-1; Thu, 20 Feb 2025 10:26:43 -0500 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6466119783B2 for ; Thu, 20 Feb 2025 15:26:42 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E4A4D180087E for ; Thu, 20 Feb 2025 15:26:41 +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=1740065204; 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=WVoL76O29hPJNp1P32SkQI7PmPM5aNhY4XiO3t1u+qI=; b=XdDSg8iaVwuSQe65qEMmID2o1BNnuVU/iAyZz3zdcIsWWKg4kPcVczB9JOY39A632EfyTL GGVLJYS370XQotTe8soMaUMwIag0AJpe78zQWxO+CM/AAkZDzw2qC7nybS8OYMHa2gKkYg QGjaR40ft2s6disY+gCiyeU73CtRU4U= X-MC-Unique: C7IcajePMg6gE2H0Z0YnBw-1 X-Mimecast-MFC-AGG-ID: C7IcajePMg6gE2H0Z0YnBw_1740065202 From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 12/13] virsh: Let prohibit_newline_at_end_of_diagnostic check pass Date: Thu, 20 Feb 2025 16:26:14 +0100 Message-ID: <3a65d92251da2ac9d0603f3752f09723a976d58d.1740064957.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JYEzkWMfeWmm2BY1_yDgn_6nMY_IH6oUxap64nb_D-k_1740065202 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YUBCH24LPUMTUTVNSOJQIGJV6AMOI5S5 X-Message-ID-Hash: YUBCH24LPUMTUTVNSOJQIGJV6AMOI5S5 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: 1740065568539019100 Content-Type: text/plain; charset="utf-8" The prohibit_newline_at_end_of_diagnostic syntax check is confused when another unrelated translatable message with a newline is too close to the function it is supposed to check. Refactoring the code to make the two strings further apart seems like the easiest solution. Signed-off-by: Jiri Denemark --- tools/virsh-domain.c | 9 +++++---- tools/virsh-snapshot.c | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c8c341b3d1..cc5ae60536 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -12307,12 +12307,13 @@ cmdDetachInterface(vshControl *ctl, const vshCmd = *cmd) return ret; =20 cleanup: - if (!ret) { - vshError(ctl, "%s", _("Failed to detach interface")); - } else { + if (ret) { vshPrintExtra(ctl, "%s", _("Interface detached successfully\n")); + return true; } - return ret; + + vshError(ctl, "%s", _("Failed to detach interface")); + return false; } =20 =20 diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 2821cd9e26..dbd849bb3b 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1758,11 +1758,13 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshC= md *cmd) result =3D virDomainRevertToSnapshot(snapshot, flags); } =20 - if (result < 0) + if (result < 0) { vshError(ctl, _("Failed to revert snapshot %1$s"), name); - else - vshPrintExtra(ctl, _("Domain snapshot %1$s reverted\n"), name); - return result >=3D 0; + return false; + } + + vshPrintExtra(ctl, _("Domain snapshot %1$s reverted\n"), name); + return true; } =20 /* --=20 2.48.1