[2/6] Make device assignment depend on libpci
diff mbox

Message ID 1231325371-22896-3-git-send-email-sheng@linux.intel.com
State Accepted, archived
Headers show

Commit Message

Sheng Yang Jan. 7, 2009, 10:49 a.m. UTC
Which is used later for capability detection.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 qemu/Makefile.target |    1 +
 qemu/configure       |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

Patch
diff mbox

diff --git a/qemu/Makefile.target b/qemu/Makefile.target
index f58015b..a58f31d 100644
--- a/qemu/Makefile.target
+++ b/qemu/Makefile.target
@@ -696,6 +696,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 6eb12ae..f5d3f89 100755
--- a/qemu/configure
+++ b/qemu/configure
@@ -780,6 +780,26 @@  EOF
     fi
 fi
 
+# libpci probe for kvm_cap_device_assignment
+if test $kvm_cap_device_assignment = "yes" ; then
+cat > $TMPC << EOF
+#include <pci/pci.h>
+#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