From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2EDF0A04A3 for ; Tue, 16 Jun 2020 17:17:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 216AA1BF83; Tue, 16 Jun 2020 17:17:34 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id D795D1BF83 for ; Tue, 16 Jun 2020 17:17:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592320652; 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: in-reply-to:in-reply-to:references:references; bh=cZkhSJ3rz5SmjYt9ffR/lQc6Ir9gx7llBAaPaTAlY18=; b=QlGC5Q2m5ZsTm2DLvEfTNr1ywy88Rw660LhgMNkqB/vCqJ/pLs+BKmng46Kd4EI0EEkwcv x5n6Xa/SKj6NXu2IfiiD3K1FhmJ7WMpTI8eS9WvKLE66BaqvX6OSBNHpTN5P38DHVXVv3F S/RUauRlMDwlMHVmS1MFIUO4fNuPiKU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-69-uW6PACjmN-agxAvKMTIaBA-1; Tue, 16 Jun 2020 11:17:30 -0400 X-MC-Unique: uW6PACjmN-agxAvKMTIaBA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 97D8210059B4; Tue, 16 Jun 2020 15:17:28 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F6755D9D3; Tue, 16 Jun 2020 15:17:24 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org Cc: david.hunt@intel.com, reshma.pattan@intel.com, thomas@monjalon.net, David Marchand , Kevin Traynor Date: Tue, 16 Jun 2020 16:17:12 +0100 Message-Id: <20200616151713.13128-2-ktraynor@redhat.com> In-Reply-To: <20200616151713.13128-1-ktraynor@redhat.com> References: <20200616151713.13128-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 18.11 1/2] examples/vm_power: fix build with -fno-common X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Thomas Monjalon [ upstream commit 96d3d532f9f2e42cf8b620ad3ba9da1f04ccb3f0 ] The variables of the same name are merged together if compiled with -fcommon. It used to be the default. This default behaviour allows to declare a variable in a header file and share the variable in every .o binaries thanks to merge at link-time. If compiling with -fno-common (default in GCC 10), the variable must be shared as extern to avoid multiple re-definitions. Fixes: dff22404aaad ("examples/vm_power_mgr: add VCPU to PCPU mapping") Signed-off-by: Thomas Monjalon Acked-by: David Marchand Acked-by: Kevin Traynor --- examples/vm_power_manager/channel_manager.c | 2 ++ examples/vm_power_manager/channel_manager.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c index 8aabd69c40..c53ad4bf1b 100644 --- a/examples/vm_power_manager/channel_manager.c +++ b/examples/vm_power_manager/channel_manager.c @@ -37,4 +37,6 @@ if ((mask_u64b >> i) & 1) \ +struct libvirt_vm_info lvm_info[MAX_CLIENTS]; + /* Global pointer to libvirt connection */ static virConnectPtr global_vir_conn_ptr; diff --git a/examples/vm_power_manager/channel_manager.h b/examples/vm_power_manager/channel_manager.h index 22905266f8..3c48d6ae66 100644 --- a/examples/vm_power_manager/channel_manager.h +++ b/examples/vm_power_manager/channel_manager.h @@ -44,5 +44,5 @@ struct libvirt_vm_info { }; -struct libvirt_vm_info lvm_info[MAX_CLIENTS]; +extern struct libvirt_vm_info lvm_info[MAX_CLIENTS]; /* Communication Channel Status */ enum channel_status { CHANNEL_MGR_CHANNEL_DISCONNECTED = 0, -- 2.21.3