Skip to contentSkip to conversation

Make QEmu depends on libpci

PATCH In review Sheng Yang 2 participants 3 messages Nov 21, 2008

Subsystems (2)
lore
Share & tools
lore

Sheng Yang

author
#0 lore raw

PATCH 1/1 Make QEmu depends on libpci

libpci is handy to handle some pci device related things.

This is the same as first patch I sent in MSI userspace patchset in kvm mailing list, and this one is based on QEmu upstream.

---
 Makefile.target |    2 +-
 configure       |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 3cdf7db..7cf5b00 100644
@@ -598,7 +598,7 @@ else
 OBJS+=block-raw-posix.o
 endif
 
-LIBS+=-lz
+LIBS+=-lz -lpci
 ifdef CONFIG_ALSA
 LIBS += -lasound
 endif
configure +19 -0
index 1f3d233..1f35e3d 100755
@@ -764,6 +764,25 @@ else
 fi
 
 ##########################################
+# libpci probe
+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 "Make sure to have the libpci libs and headers installed."
+    echo
+    exit 1
+fi
+
+##########################################
 # SDL probe
 
 sdl_too_old=no
Signature · 1 line
1.5.4.5
#1 lore raw
Quoted 5 lines · Sheng Yang

libpci is handy to handle some pci device related things.

This is the same as first patch I sent in MSI userspace patchset in kvm mailing list, and this one is based on QEmu upstream.

It should be an optional dependency. If libpci isn't present, then you should disable PCI passthrough. See the checks for gnutls, libvde, bluez, etc.

Regards,

Anthony LIguori

Quoted 50 lines
---
 Makefile.target |    2 +-
 configure       |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 3cdf7db..7cf5b00 100644
@@ -598,7 +598,7 @@ else
 OBJS+=block-raw-posix.o
 endif
 
-LIBS+=-lz
+LIBS+=-lz -lpci
 ifdef CONFIG_ALSA
 LIBS += -lasound
 endif
configure +19 -0
index 1f3d233..1f35e3d 100755
@@ -764,6 +764,25 @@ else
 fi
 
 ##########################################
+# libpci probe
+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 "Make sure to have the libpci libs and headers installed."
+    echo
+    exit 1
+fi
+
+##########################################
 # SDL probe
 
 sdl_too_old=no
author
#2 lore raw
Quoted 9 lines · On Friday 21 November 2008 22:10:59 Anthony Liguori wrote:
Quoted 4 lines · Sheng Yang

libpci is handy to handle some pci device related things.

This is the same as first patch I sent in MSI userspace patchset in kvm mailing list, and this one is based on QEmu upstream.

It should be an optional dependency. If libpci isn't present, then you should disable PCI passthrough. See the checks for gnutls, libvde, bluez, etc.

OK. And I think we don't have PCI passthrough for QEmu upstream now... I will update the KVM side one.

Signature · 2 lines
regards
Yang, Sheng
Quoted 54 lines

Regards,

Anthony LIguori

Quoted 49 lines
---
 Makefile.target |    2 +-
 configure       |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)
Makefile.target +1 -1
index 3cdf7db..7cf5b00 100644
@@ -598,7 +598,7 @@ else
 OBJS+=block-raw-posix.o
 endif
 
-LIBS+=-lz
+LIBS+=-lz -lpci
 ifdef CONFIG_ALSA
 LIBS += -lasound
 endif
configure +19 -0
index 1f3d233..1f35e3d 100755
@@ -764,6 +764,25 @@ else
 fi
 
 ##########################################
+# libpci probe
+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 "Make sure to have the libpci libs and headers installed."
+    echo
+    exit 1
+fi
+
+##########################################
 # SDL probe
 
 sdl_too_old=no