From patchwork Wed Nov 9 15:05:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 1701802 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GMMM+A8T; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N6pFk1LvWz1yqS for ; Thu, 10 Nov 2022 02:06:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DA30160A47; Wed, 9 Nov 2022 15:06:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org DA30160A47 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GMMM+A8T X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IPXgzaY6ekK0; Wed, 9 Nov 2022 15:06:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id F3742605DB; Wed, 9 Nov 2022 15:06:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F3742605DB Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D299BC0032; Wed, 9 Nov 2022 15:06:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id A61C2C002D for ; Wed, 9 Nov 2022 15:06:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6C4A44032D for ; Wed, 9 Nov 2022 15:06:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6C4A44032D Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GMMM+A8T X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DwxmyVCL2PiN for ; Wed, 9 Nov 2022 15:06:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org C86A9402E0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id C86A9402E0 for ; Wed, 9 Nov 2022 15:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668006367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ksW1m2gWtIHHIBy7ds3ZJghzoh3GXG0sRNm7g0t2QBg=; b=GMMM+A8T6tXukE6y/+6u3/BzVOC8vAQujaFOm7koUG03pyVH8ohgvzkxnMh3xmDAOr9Sx4 7hCEVcgTLIjGNBxoGbT8ORIVUNICxhXxCDvrP0u5aeRKc40di3rpI99soT4jq41uD5t98g b6cTpWqs3/IyLAylyKm9TUabOjRhhFE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-apJ0W0N2MXe2YE1zBWxsFQ-1; Wed, 09 Nov 2022 10:06:06 -0500 X-MC-Unique: apJ0W0N2MXe2YE1zBWxsFQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B33F0827980; Wed, 9 Nov 2022 15:06:05 +0000 (UTC) Received: from aldebaran.redhat.com (unknown [10.39.195.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27F5B200BA64; Wed, 9 Nov 2022 15:06:05 +0000 (UTC) From: Timothy Redaelli To: dev@openvswitch.org Date: Wed, 9 Nov 2022 16:05:58 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Ilya Maximets Subject: [ovs-dev] [PATCH v2] rhel: make the version, displayed to the user, customizable X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Since on CentOS/RHEL the builds are based on stable branches and not on tags for debugging purpose it's better to have the downstream version as version so it's easier to know which commits are included in a build. This commit adds --with-version-suffix as ./configure option in order to set an OVS version suffix that should be shown to the user via ovs-vsctl -V and, so, also on database and on ovs-vsctl show. --with-version-suffix is used in Fedora/CentOS/RHEL spec file in order to have the version be aligned with the downstream one. Signed-off-by: Timothy Redaelli --- acinclude.m4 | 13 +++++++++++++ configure.ac | 1 + include/openvswitch/version.h.in | 2 +- lib/ovsdb-error.c | 2 +- lib/util.c | 5 +++-- ovsdb/ovsdb-server.c | 3 ++- python/automake.mk | 2 +- rhel/openvswitch-fedora.spec.in | 1 + vswitchd/bridge.c | 3 ++- 9 files changed, 25 insertions(+), 7 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index aa9af5506..09d528675 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -440,6 +440,19 @@ AC_DEFUN([OVS_CHECK_DPDK], [ AM_CONDITIONAL([DPDK_NETDEV], test "$DPDKLIB_FOUND" = true) ]) +dnl Append a version suffix + +AC_DEFUN([OVS_CHECK_VERSION_SUFFIX], [ + AC_ARG_WITH([version-suffix], + [AS_HELP_STRING([--with-version-suffix=ver_suffix], + [Specify a version suffix that will be appended + to OVS version])]) + AC_DEFINE_UNQUOTED([VERSION_SUFFIX], ["$with_version_suffix"], + [Package version suffix]) + AC_SUBST([VERSION_SUFFIX], [$with_version_suffix]) + ]) +]) + dnl Checks for net/if_dl.h. dnl dnl (We use this as a proxy for checking whether we're building on FreeBSD diff --git a/configure.ac b/configure.ac index adfd9f006..6c977351d 100644 --- a/configure.ac +++ b/configure.ac @@ -198,6 +198,7 @@ OVS_CHECK_LINUX_SCTP_CT OVS_CHECK_LINUX_VIRTIO_TYPES OVS_CHECK_DPDK OVS_CHECK_PRAGMA_MESSAGE +OVS_CHECK_VERSION_SUFFIX AC_SUBST([CFLAGS]) AC_SUBST([OVS_CFLAGS]) AC_SUBST([OVS_LDFLAGS]) diff --git a/include/openvswitch/version.h.in b/include/openvswitch/version.h.in index 23d8fde4f..231f61e30 100644 --- a/include/openvswitch/version.h.in +++ b/include/openvswitch/version.h.in @@ -19,7 +19,7 @@ #define OPENVSWITCH_VERSION_H 1 #define OVS_PACKAGE_STRING "@PACKAGE_STRING@" -#define OVS_PACKAGE_VERSION "@PACKAGE_VERSION@" +#define OVS_PACKAGE_VERSION "@PACKAGE_VERSION@@VERSION_SUFFIX@" #define OVS_LIB_VERSION @LT_CURRENT@ #define OVS_LIB_REVISION @LT_REVISION@ diff --git a/lib/ovsdb-error.c b/lib/ovsdb-error.c index a75ad36b7..65bbfe876 100644 --- a/lib/ovsdb-error.c +++ b/lib/ovsdb-error.c @@ -150,7 +150,7 @@ ovsdb_internal_error(struct ovsdb_error *inner_error, ds_put_char(&ds, ')'); } - ds_put_format(&ds, " (%s %s)", program_name, VERSION); + ds_put_format(&ds, " (%s %s)", program_name, VERSION VERSION_SUFFIX); if (inner_error) { char *s = ovsdb_error_to_string_free(inner_error); diff --git a/lib/util.c b/lib/util.c index 1195c7982..be350ab66 100644 --- a/lib/util.c +++ b/lib/util.c @@ -614,8 +614,9 @@ ovs_set_program_name(const char *argv0, const char *version) program_name = basename; free(program_version); - if (!strcmp(version, VERSION)) { - program_version = xasprintf("%s (Open vSwitch) "VERSION"\n", + if (!strcmp(version, VERSION VERSION_SUFFIX)) { + program_version = xasprintf("%s (Open vSwitch) "VERSION + VERSION_SUFFIX"\n", program_name); } else { program_version = xasprintf("%s %s\n" diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 7a6bfe0a0..b43d739e8 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -424,7 +424,8 @@ main(int argc, char *argv[]) /* ovsdb-server is usually a long-running process, in which case it * makes plenty of sense to log the version, but --run makes * ovsdb-server more like a command-line tool, so skip it. */ - VLOG_INFO("%s (Open vSwitch) %s", program_name, VERSION); + VLOG_INFO("%s (Open vSwitch) %s", program_name, + VERSION VERSION_SUFFIX); } unixctl_command_register("exit", "", 0, 0, ovsdb_server_exit, &exiting); diff --git a/python/automake.mk b/python/automake.mk index d00911828..81fbc12d2 100644 --- a/python/automake.mk +++ b/python/automake.mk @@ -124,7 +124,7 @@ ovs-uninstall-local: ALL_LOCAL += $(srcdir)/python/ovs/version.py $(srcdir)/python/ovs/version.py: config.status $(AM_V_GEN)$(ro_shell) > $(@F).tmp && \ - echo 'VERSION = "$(VERSION)"' >> $(@F).tmp && \ + echo 'VERSION = "$(VERSION)$(VERSION_SUFFIX)"' >> $(@F).tmp && \ if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi ALL_LOCAL += $(srcdir)/python/ovs/dirs.py diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in index 67268cb78..df296ea08 100644 --- a/rhel/openvswitch-fedora.spec.in +++ b/rhel/openvswitch-fedora.spec.in @@ -176,6 +176,7 @@ This package provides IPsec tunneling support for OVS tunnels. --disable-static \ --enable-shared \ --with-pkidir=%{_sharedstatedir}/openvswitch/pki \ + --with-version-suffix=-%{release} \ PYTHON3=%{__python3} build-aux/dpdkstrip.py \ diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 25ce45e3d..a5409b221 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -3321,7 +3321,8 @@ bridge_run(void) vlog_enable_async(); - VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name, VERSION); + VLOG_INFO_ONCE("%s (Open vSwitch) %s", program_name, + VERSION VERSION_SUFFIX); } }