From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id EA22C137D for ; Mon, 11 Apr 2016 05:46:05 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 10 Apr 2016 20:46:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,462,1455004800"; d="scan'208";a="929641943" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 10 Apr 2016 20:46:03 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id u3B3k15m023718; Mon, 11 Apr 2016 11:46:01 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u3B3jxLg026628; Mon, 11 Apr 2016 11:46:01 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id u3B3jxZ5026624; Mon, 11 Apr 2016 11:45:59 +0800 From: Marvin Liu To: dev@dpdk.org Cc: Marvin Liu Date: Mon, 11 Apr 2016 11:45:57 +0800 Message-Id: <1460346357-26592-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] examples/vm_power_manager: fix build with libvirt version < 0.9.3 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: , X-List-Received-Date: Mon, 11 Apr 2016 03:46:06 -0000 vm_power_manager utilize libvirt API virDomainGetVcpuPinInfo for retrieve domU vcpu information. This API implemented from version 0.9.3. Suse11 SP3 32bit default libvirt version is 0.8.8, so there'll be build error. Add judgement in sample Makefile to skip unsupport environment. examples/vm_power_manager/channel_manager.c: In function ‘update_pcpus_mask’: channel_manager.c:117:3: error: implicit declaration of function ‘virDomainGetVcpuPinInfo’ Fixes: 2e099bc5d104 ("fix split of compiler and linker options") Signed-off-by: Marvin Liu diff --git a/examples/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile index 113dbc4..49a6b9b 100644 --- a/examples/vm_power_manager/Makefile +++ b/examples/vm_power_manager/Makefile @@ -33,9 +33,19 @@ ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif +LIBVIRT_COMMON = libvirt-common.h +LIBVIRT_HEADER = libvirt.h +INCLUDE_PATH = /usr/include/libvirt/ + +HEADER_FILE = $(shell if [ -f $(INCLUDE_PATH)$(LIBVIRT_COMMON) ]; then echo $(LIBVIRT_COMMON);else echo $(LIBVIRT_HEADER); fi;) +LIBVIRT_INCLUDE = $(INCLUDE_PATH)$(HEADER_FILE) + +LIBVIR_VER = $(shell gawk '/LIBVIR_VERSION_NUMBER .*/{print $$3}' $(LIBVIRT_INCLUDE)) + # Default target, can be overridden by command line or environment RTE_TARGET ?= x86_64-native-linuxapp-gcc +ifeq ($(shell test $(LIBVIR_VER) -ge 00009003 && echo 1), 1) include $(RTE_SDK)/mk/rte.vars.mk # binary name @@ -57,3 +67,10 @@ CFLAGS_main.o += -Wno-return-type endif include $(RTE_SDK)/mk/rte.extapp.mk + +else +.PHONY: all clean +all: +$(warning "vm_power_manager required libvirt version >= 0.9.3, please update libvirt-devel first") +clean: +endif -- 1.9.3