From nobody Thu Nov 21 16:10:17 2024 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 1716210086338506.5501836562387; Mon, 20 May 2024 06:01:26 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 9A9A61C25; Mon, 20 May 2024 09:01:24 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7C71719DD; Mon, 20 May 2024 09:00:34 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CF7FF1BE6; Mon, 20 May 2024 09:00:30 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 3DCF319AA for ; Mon, 20 May 2024 09:00:30 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-141-XA2Kn_8BMwm875RtnVcaNQ-1; Mon, 20 May 2024 09:00:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1A3C8008A4 for ; Mon, 20 May 2024 13:00:27 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32E57200A35C for ; Mon, 20 May 2024 13:00:26 +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.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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=1716210029; 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; bh=IecrdtIYSYpn9j4DlXb7VwU+1ToPfF0qotrcPUN30xk=; b=KGZ1Pw696TH0tMXy4GH2tNQLFCaayca1lEwNFd7Ej7cNXNBy/iCoaVNbBmeo5IhMbrq+ie 7r6DgLOCNTCwbNjvDJqA0KapIU6hyl8JE8sDRbJwK4ILkZ18UsdIr/NbN45wfxG3fil8iG XUgSMLb5CAuAFF0xvBLGXgdXxPRvozg= X-MC-Unique: XA2Kn_8BMwm875RtnVcaNQ-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH] virt-host-validate: Improve translatability of messages printed by 'virHostMsgCheck()' Date: Mon, 20 May 2024 15:00:26 +0200 Message-ID: <402b57a0ba5c7c87214c5ea6e769331222ec88eb.1716210026.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: O5EHKCC7ZKY2CNOFLXPQP7R5HS54VXVJ X-Message-ID-Hash: O5EHKCC7ZKY2CNOFLXPQP7R5HS54VXVJ X-MailFrom: pkrempa@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: 1716210089513100001 Content-Type: text/plain; charset="utf-8" Move the word 'Checking' into the appropriate formatting strings and mark all outstanding ones for translation. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/637 Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tools/virt-host-validate-bhyve.c | 2 +- tools/virt-host-validate-ch.c | 2 +- tools/virt-host-validate-common.c | 18 +++++++++--------- tools/virt-host-validate-qemu.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/virt-host-validate-bhyve.c b/tools/virt-host-validate-bh= yve.c index db1cdd8e2c..adb5ae1717 100644 --- a/tools/virt-host-validate-bhyve.c +++ b/tools/virt-host-validate-bhyve.c @@ -28,7 +28,7 @@ #include "virt-host-validate-common.h" #define MODULE_STATUS(mod, err_msg, err_code) \ - virHostMsgCheck("BHYVE", _("for %1$s module"), #mod); \ + virHostMsgCheck("BHYVE", _("Checking for %1$s module"), #mod); \ if (mod ## _loaded) { \ virHostMsgPass(); \ } else { \ diff --git a/tools/virt-host-validate-ch.c b/tools/virt-host-validate-ch.c index 9d235ed7ab..3f96423836 100644 --- a/tools/virt-host-validate-ch.c +++ b/tools/virt-host-validate-ch.c @@ -57,7 +57,7 @@ int virHostValidateCh(void) } if (hasVirtFlag) { - virHostMsgCheck("CH", "%s", _("for hardware virtualization")); + virHostMsgCheck("CH", "%s", _("Checking for hardware virtualizatio= n")); if (hasHwVirt) { virHostMsgPass(); } else { diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index c8a23e2e99..58d8dbbaa1 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -66,7 +66,7 @@ void virHostMsgCheck(const char *prefix, msg =3D g_strdup_vprintf(format, args); va_end(args); - fprintf(stdout, _("%1$6s: Checking %2$-60s: "), prefix, msg); + fprintf(stdout, "%1$6s: %2$-60s: ", prefix, msg); } static bool virHostMsgWantEscape(void) @@ -137,7 +137,7 @@ int virHostValidateDeviceExists(const char *hvname, virHostValidateLevel level, const char *hint) { - virHostMsgCheck(hvname, "if device %s exists", dev_name); + virHostMsgCheck(hvname, _("Checking if device '%1$s' exists"), dev_nam= e); if (access(dev_name, F_OK) < 0) { virHostMsgFail(level, "%s", hint); @@ -154,7 +154,7 @@ int virHostValidateDeviceAccessible(const char *hvname, virHostValidateLevel level, const char *hint) { - virHostMsgCheck(hvname, "if device %s is accessible", dev_name); + virHostMsgCheck(hvname, _("Checking if device '%1$s' is accessible"), = dev_name); if (access(dev_name, R_OK|W_OK) < 0) { virHostMsgFail(level, "%s", hint); @@ -173,7 +173,7 @@ int virHostValidateNamespace(const char *hvname, { char nspath[100]; - virHostMsgCheck(hvname, "for namespace %s", ns_name); + virHostMsgCheck(hvname, _("Checking for namespace '%1$s'"), ns_name); g_snprintf(nspath, sizeof(nspath), "/proc/self/ns/%s", ns_name); @@ -256,7 +256,7 @@ int virHostValidateLinuxKernel(const char *hvname, uname(&uts); - virHostMsgCheck(hvname, _("for Linux >=3D %1$d.%2$d.%3$d"), + virHostMsgCheck(hvname, _("Checking for Linux >=3D %1$d.%2$d.%3$d"), ((version >> 16) & 0xff), ((version >> 8) & 0xff), (version & 0xff)); @@ -302,7 +302,7 @@ int virHostValidateCGroupControllers(const char *hvname, if (!(controllers & flag)) continue; - virHostMsgCheck(hvname, "for cgroup '%s' controller support", cg_n= ame); + virHostMsgCheck(hvname, _("Checking for cgroup '%1$s' controller s= upport"), cg_name); if (!virCgroupHasController(group, i)) { ret =3D VIR_HOST_VALIDATE_FAILURE(level); @@ -337,7 +337,7 @@ int virHostValidateIOMMU(const char *hvname, struct dirent *dent; int rc; - virHostMsgCheck(hvname, "%s", _("for device assignment IOMMU support")= ); + virHostMsgCheck(hvname, "%s", _("Checking for device assignment IOMMU = support")); flags =3D virHostValidateGetCPUFlags(); @@ -423,7 +423,7 @@ int virHostValidateIOMMU(const char *hvname, if (!S_ISDIR(sb.st_mode)) return 0; - virHostMsgCheck(hvname, "%s", _("if IOMMU is enabled by kernel")); + virHostMsgCheck(hvname, "%s", _("Checking if IOMMU is enabled by kerne= l")); if (sb.st_nlink <=3D 2) { if (bootarg) virHostMsgFail(level, @@ -483,7 +483,7 @@ int virHostValidateSecureGuests(const char *hvname, else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_= SEV)) hasAMDSev =3D true; - virHostMsgCheck(hvname, "%s", _("for secure guest support")); + virHostMsgCheck(hvname, "%s", _("Checking for secure guest support")); if (ARCH_IS_S390(arch)) { if (hasFac158) { if (!virFileIsDir("/sys/firmware/uv")) { diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qem= u.c index 3eeee516d3..b685fa01ba 100644 --- a/tools/virt-host-validate-qemu.c +++ b/tools/virt-host-validate-qemu.c @@ -64,7 +64,7 @@ int virHostValidateQEMU(void) } if (hasVirtFlag) { - virHostMsgCheck("QEMU", "%s", _("for hardware virtualization")); + virHostMsgCheck("QEMU", "%s", _("Checking for hardware virtualizat= ion")); if (hasHwVirt) { virHostMsgPass(); } else { @@ -86,7 +86,7 @@ int virHostValidateQEMU(void) } if (arch =3D=3D VIR_ARCH_PPC64 || arch =3D=3D VIR_ARCH_PPC64LE) { - virHostMsgCheck("QEMU", "%s", _("for PowerPC KVM module loaded")); + virHostMsgCheck("QEMU", "%s", _("Checking for PowerPC KVM module l= oaded")); if (!virHostKernelModuleIsLoaded("kvm_hv")) virHostMsgFail(VIR_HOST_VALIDATE_WARN, --=20 2.45.0