From patchwork Mon Apr 11 10:43:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 12011 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 5B0A54A63; Mon, 11 Apr 2016 12:43:37 +0200 (CEST) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 46F6F47D2 for ; Mon, 11 Apr 2016 12:43:36 +0200 (CEST) Received: by mail-wm0-f52.google.com with SMTP id a140so7153197wma.0 for ; Mon, 11 Apr 2016 03:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KN4DFw5/KpSSsl81UcfyMvJq9KGUmeA9zS0DCzi+OF4=; b=vZNpuNBJ9VIcIb66UnAMjTJAbiIWYS9ZKn25UEqJpLHZ9Cdt1SzZtN1++oZtLcG9Xx Oaaf0/v3QL9O3YuZqkfY70eikUOcu5y6IZg/IEGH6NwUHF9CNZYBzmEuz8a3YP8TPGka AttrXvAc4ODsB/l+d3K1VYahnQyWeECuMOuiQmCEatOwhOPPpgMt+GLUSO9nqkTMMSyv 45pehlYrxwWhd/5SaavKeg/w4YXGsht++9g2a3oixKAnB/Qk/KlrW1RdxnS5G4bPWNjb BWI1D+zGh3dH9UZF+YpTjKkwHSe9tumdgv1ZMpeiGECJI6PhgdQPFLmoq3gdUFzaRooZ tmIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KN4DFw5/KpSSsl81UcfyMvJq9KGUmeA9zS0DCzi+OF4=; b=GXkHbJlxA/VE5OloFgYEbN3MD/B6xYyu3NLUPgb7StmawYdduTNPFRA8xTDR3b0IW5 Gn04CVu3Qsnbal4+yhZ6QnzJNerjvRtAHccPCQUyVjmh87ZzZLrlhR5YPRhXZjTDYQeX zYRLXr3rMGo2avqP7gQdJJzwPacOxEFbdpy0OFqhUr7b0pZLOMjMMaOhmL3jdmiq/ZvL Q44EHw22xTJpgZwsOEg4+pE0KoWp6joRVNkSs6td46iDnhdYVR+O3tYGMpan375NoOp5 yIJCMd6ZjMpAEYH1RG4lCPDy0kJps7ilcudrMIuQRq/PoAPkiriK0xYcd9eAGtTcdUH2 HBZQ== X-Gm-Message-State: AD7BkJI4/WqRSLlM5Ts8qEB1H6XFuC5LwTY29USpmFWXHYsRIy74fLzPUXqZeIx0RZa18Q56 X-Received: by 10.28.27.87 with SMTP id b84mr18114495wmb.7.1460371416082; Mon, 11 Apr 2016 03:43:36 -0700 (PDT) Received: from XPS13.localdomain (245.111.75.86.rev.sfr.net. [86.75.111.245]) by smtp.gmail.com with ESMTPSA id i206sm16638508wmf.1.2016.04.11.03.43.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 03:43:35 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Marvin Liu Date: Mon, 11 Apr 2016 12:43:32 +0200 Message-Id: <1460371412-711-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1460370772-17663-1-git-send-email-thomas.monjalon@6wind.com> References: <1460370772-17663-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [PATCH v5] examples/vm_power_manager: fix libvirt dependency check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Marvin Liu vm_power_manager utilize libvirt API virDomainGetVcpuPinInfo to retrieve domU vcpu information. This API is implemented from version 0.9.3. Suse11 SP3 32bit default libvirt version is 0.8.8. examples/vm_power_manager/channel_manager.c: channel_manager.c:117:3: error: implicit declaration of function 'virDomainGetVcpuPinInfo' Check and skip it from examples or raise an error when trying to compile without libvirt or with a too old libvirt. Fixes: e8ae9b662 ("examples/vm_power: channel manager and monitor in host") Signed-off-by: Marvin Liu Signed-off-by: Thomas Monjalon Acked-by: Bruce Richardson --- examples/Makefile | 8 +++++++- examples/vm_power_manager/Makefile | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) v5: do not warn if CONFIG_RTE_LIBRTE_POWER is disabled v4: mix v2 and v3 to skip in examples list but raise an error if trying to compile directly diff --git a/examples/Makefile b/examples/Makefile index a8bc381..b28b30e 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -87,6 +87,12 @@ DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += vhost_xen DIRS-y += vmdq DIRS-y += vmdq_dcb -DIRS-$(CONFIG_RTE_LIBRTE_POWER) += vm_power_manager +ifeq ($(CONFIG_RTE_LIBRTE_POWER), y) +ifeq ($(shell pkg-config --atleast-version=0.9.3 libvirt; echo $$?), 0) +DIRS-y += vm_power_manager +else +$(info vm_power_manager requires libvirt >= 0.9.3) +endif +endif include $(RTE_SDK)/mk/rte.extsubdir.mk diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile index 113dbc4..59a9641 100644 --- a/examples/vm_power_manager/Makefile +++ b/examples/vm_power_manager/Makefile @@ -29,6 +29,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +ifneq ($(shell pkg-config --atleast-version=0.9.3 libvirt; echo $$?), 0) +$(error vm_power_manager requires libvirt >= 0.9.3) +else + ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif @@ -57,3 +61,5 @@ CFLAGS_main.o += -Wno-return-type endif include $(RTE_SDK)/mk/rte.extapp.mk + +endif # libvirt check