From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L4eDP-0003We-Ay for qemu-devel@nongnu.org; Mon, 24 Nov 2008 11:23:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L4eDN-0003VD-Qu for qemu-devel@nongnu.org; Mon, 24 Nov 2008 11:23:10 -0500 Received: from [199.232.76.173] (port=46013 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4dl6-0002Gz-8l for qemu-devel@nongnu.org; Mon, 24 Nov 2008 10:53:56 -0500 Received: from mga11.intel.com ([192.55.52.93]:22957) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L4a1D-0005Gg-KB for qemu-devel@nongnu.org; Mon, 24 Nov 2008 06:54:19 -0500 From: Sheng Yang Date: Mon, 24 Nov 2008 19:50:32 +0800 Message-Id: <1227527435-32088-3-git-send-email-sheng@linux.intel.com> In-Reply-To: <1227527435-32088-1-git-send-email-sheng@linux.intel.com> References: <1227527435-32088-1-git-send-email-sheng@linux.intel.com> Subject: [Qemu-devel] [PATCH 2/5] Make device assignment depend on libpci Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Sheng Yang , kvm@vger.kernel.org, qemu-devel@nongnu.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 05ace8e..59653ba 100644 --- a/qemu/Makefile.target +++ b/qemu/Makefile.target @@ -735,6 +735,7 @@ OBJS += device-hotplug.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 18ef980..bdde5ed 100755 --- a/qemu/configure +++ b/qemu/configure @@ -808,6 +808,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 -- 1.5.4.5