From patchwork Mon Mar 2 08:29:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 9498 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n228Tjvv011310 for ; Mon, 2 Mar 2009 08:29:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756049AbZCBI3j (ORCPT ); Mon, 2 Mar 2009 03:29:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755631AbZCBI3j (ORCPT ); Mon, 2 Mar 2009 03:29:39 -0500 Received: from mga11.intel.com ([192.55.52.93]:33048 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755332AbZCBI3i (ORCPT ); Mon, 2 Mar 2009 03:29:38 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 02 Mar 2009 00:27:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,288,1233561600"; d="scan'208";a="435277307" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.189]) by fmsmga002.fm.intel.com with ESMTP; 02 Mar 2009 00:25:23 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1Le3Wn-0001oE-UL; Mon, 02 Mar 2009 16:29:33 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti , Anthony Liguori Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 02/10] Make device assignment depend on libpci Date: Mon, 2 Mar 2009 16:29:25 +0800 Message-Id: <1235982573-6932-3-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1235982573-6932-1-git-send-email-sheng@linux.intel.com> References: <1235982573-6932-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Which is used later for capability detection. Signed-off-by: Sheng Yang --- qemu/Makefile.target | 1 + qemu/configure | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/qemu/Makefile.target b/qemu/Makefile.target index efcbe0a..5b6fad4 100644 --- a/qemu/Makefile.target +++ b/qemu/Makefile.target @@ -638,6 +638,7 @@ OBJS += msmouse.o ifeq ($(USE_KVM_DEVICE_ASSIGNMENT), 1) OBJS+= device-assignment.o +LIBS+=-lpci endif ifeq ($(TARGET_BASE_ARCH), i386) diff --git a/qemu/configure b/qemu/configure index 902bba3..b6aa7d7 100755 --- a/qemu/configure +++ b/qemu/configure @@ -792,6 +792,26 @@ EOF fi fi +# libpci probe for kvm_cap_device_assignment +if test $kvm_cap_device_assignment = "yes" ; then +cat > $TMPC << EOF +#include +#ifndef PCI_VENDOR_ID +#error NO LIBPCI +#endif +int main(void) { return 0; } +EOF + if $cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $TMPC 2>/dev/null ; then + : + else + echo + echo "Error: libpci check failed" + echo "Disable KVM Device Assignment capability." + echo + kvm_cap_device_assignment="no" + fi +fi + ########################################## # zlib check