From nobody Thu May 2 00:24:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1510840180773696.1435805325011; Thu, 16 Nov 2017 05:49:40 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C049686AA; Thu, 16 Nov 2017 13:49:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2E46614D8; Thu, 16 Nov 2017 13:49:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 777811800BDC; Thu, 16 Nov 2017 13:49:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAGDnapg014120 for ; Thu, 16 Nov 2017 08:49:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1DA7360460; Thu, 16 Nov 2017 13:49:36 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 98D3660486 for ; Thu, 16 Nov 2017 13:49:35 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 16 Nov 2017 14:49:27 +0100 Message-Id: <767fbbf566cabe976970443ce5e21c0167a2c9ee.1510840039.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] vsh: Make self-test more robust X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 16 Nov 2017 13:49:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are couple of limitations when it comes to option types and flags for the options. For instance, VSH_OT_STRING cannot have VSH_OFLAG_REQ set (commit c7543a728). For some reason this is checked in vshCmddefHelp() but not in vshCmddefCheckInternals(). Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- tools/vsh.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 10a65c39f..75568353d 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -363,12 +363,15 @@ vshCmddefCheckInternals(const vshCmdDef *cmd) =20 if (i > 63) return -1; /* too many options */ - if (opt->type =3D=3D VSH_OT_BOOL) { + + switch (opt->type) { + case VSH_OT_STRING: + case VSH_OT_BOOL: if (opt->flags & VSH_OFLAG_REQ) return -1; /* bool options can't be mandatory */ - continue; - } - if (opt->type =3D=3D VSH_OT_ALIAS) { + break; + + case VSH_OT_ALIAS: { size_t j; char *name =3D (char *)opt->help; /* cast away const */ char *p; @@ -391,10 +394,22 @@ vshCmddefCheckInternals(const vshCmdDef *cmd) } if (!cmd->opts[j].name) return -1; /* alias option must map to a later option name= */ - continue; } - if (opt->type =3D=3D VSH_OT_ARGV && cmd->opts[i + 1].name) - return -1; /* argv option must be listed last */ + break; + case VSH_OT_ARGV: + if (cmd->opts[i + 1].name) + return -1; /* argv option must be listed last */ + break; + + case VSH_OT_DATA: + if (!(opt->flags & VSH_OFLAG_REQ)) + return -1; /* OT_DATA should always be required. */ + break; + + case VSH_OT_INT: + /* nada */ + break; + } } return 0; } --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 00:24:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1510840184054297.0969619898184; Thu, 16 Nov 2017 05:49:44 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 10BC32DB70B; Thu, 16 Nov 2017 13:49:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E421860486; Thu, 16 Nov 2017 13:49:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A881B1800C87; Thu, 16 Nov 2017 13:49:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAGDnahB014130 for ; Thu, 16 Nov 2017 08:49:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id E516060479; Thu, 16 Nov 2017 13:49:36 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AC9260460 for ; Thu, 16 Nov 2017 13:49:36 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 16 Nov 2017 14:49:28 +0100 Message-Id: <419f19d243075ddbb75bc28cb6cecadb08df59fc.1510840039.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] tools: Set CFLAGS for wireshark properly X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 Nov 2017 13:49:42 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We want to set CFLAGS not CPPFLAGS. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- tools/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 7513a73ac..a844dcbbc 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -427,7 +427,7 @@ EXTRA_DIST +=3D \ if WITH_WIRESHARK_DISSECTOR =20 ws_plugin_LTLIBRARIES =3D wireshark/src/libvirt.la -wireshark_src_libvirt_la_CPPFLAGS =3D \ +wireshark_src_libvirt_la_CFLAGS =3D \ -I wireshark/src $(WIRESHARK_DISSECTOR_CFLAGS) wireshark_src_libvirt_la_LDFLAGS =3D -avoid-version -module nodist_wireshark_src_libvirt_la_SOURCES =3D wireshark/src/plugin.c --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 00:24:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1510840186283173.49502862476209; Thu, 16 Nov 2017 05:49:46 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C30973D941; Thu, 16 Nov 2017 13:49:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9ED9F5C6D8; Thu, 16 Nov 2017 13:49:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 819053D380; Thu, 16 Nov 2017 13:49:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAGDnbbF014135 for ; Thu, 16 Nov 2017 08:49:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id B5FC360479; Thu, 16 Nov 2017 13:49:37 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CC9C60460 for ; Thu, 16 Nov 2017 13:49:37 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 16 Nov 2017 14:49:29 +0100 Message-Id: <09d7e6a011e672c89dfdcfeb3507f0f902a5ba7f.1510840039.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] tools: Enable warnings for more binaries/libs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 16 Nov 2017 13:49:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Because WARN_CFLAGS and COVERAGE_CFLAGS are not set globally, we rely on each binary built to include WARN_CFLAGS/COVERAGE_CFLAGS. But it is easy to forget those - e.g. libvirt_shell.la. However, don't enable WARN_FLAGS (i.e. don't include AM_CFLAGS) for wireshark plugin - parts of that code are generated and trigger some warnings. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- tools/Makefile.am | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index a844dcbbc..9bbb1a838 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -25,6 +25,11 @@ INCLUDES =3D \ =20 WARN_CFLAGS +=3D $(STRICT_FRAME_LIMIT_CFLAGS) =20 +AM_CFLAGS =3D \ + $(WARN_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + AM_LDFLAGS =3D \ $(RELRO_LDFLAGS) \ $(NO_INDIRECT_LDFLAGS) \ @@ -182,8 +187,8 @@ virt_host_validate_LDADD =3D \ $(NULL) =20 virt_host_validate_CFLAGS =3D \ + $(AM_CFLAGS) \ $(LIBXML_CFLAGS) \ - $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -208,8 +213,8 @@ virt_login_shell_LDADD =3D \ =20 virt_login_shell_CFLAGS =3D \ -DLIBVIRT_SETUID_RPC_CLIENT \ + $(AM_CFLAGS) \ $(LIBXML_CFLAGS) \ - $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ $(COVERAGE_CFLAGS) =20 @@ -241,7 +246,7 @@ virsh_LDADD =3D \ ../src/libvirt-qemu.la \ libvirt_shell.la virsh_CFLAGS =3D \ - $(WARN_CFLAGS) \ + $(AM_CFLAGS) \ $(PIE_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBXML_CFLAGS) \ @@ -263,7 +268,7 @@ virt_admin_LDADD =3D \ $(LIBXML_LIBS) \ $(NULL) virt_admin_CFLAGS =3D \ - $(WARN_CFLAGS) \ + $(AM_CFLAGS) \ $(PIE_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBXML_CFLAGS) \ @@ -502,9 +507,7 @@ nss_libnss_libvirt_impl_la_SOURCES =3D \ nss_libnss_libvirt_impl_la_CFLAGS =3D \ -DLIBVIRT_NSS \ $(AM_CFLAGS) \ - $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ - $(COVERAGE_CFLAGS) \ $(LIBXML_CFLAGS) =20 nss_libnss_libvirt_impl_la_LIBADD =3D \ @@ -532,9 +535,7 @@ nss_libnss_libvirt_guest_impl_la_CFLAGS =3D \ -DLIBVIRT_NSS \ -DLIBVIRT_NSS_GUEST \ $(AM_CFLAGS) \ - $(WARN_CFLAGS) \ $(PIE_CFLAGS) \ - $(COVERAGE_CFLAGS) \ $(LIBXML_CFLAGS) =20 nss_libnss_libvirt_guest_impl_la_LIBADD =3D \ --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list