aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Egger <Christoph.Egger@amd.com>2012-10-25 17:12:55 +0100
committerChristoph Egger <Christoph.Egger@amd.com>2012-10-25 17:12:55 +0100
commitb24b8bfa166a9367399102a9332f847a67b9056f (patch)
treef81a216551eee76ca65ad2522d502fe7c2837fe8
parent6281cacd1fc7d63000f74496da0c32b76e90cdbd (diff)
downloadxen-b24b8bfa166a9367399102a9332f847a67b9056f.tar.gz
xen-b24b8bfa166a9367399102a9332f847a67b9056f.tar.bz2
xen-b24b8bfa166a9367399102a9332f847a67b9056f.zip
libxl: NetBSD PCI passthrough support
Add PCI passthrough support for HVM guests. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/libxl/libxl_internal.h2
-rw-r--r--tools/libxl/libxl_osdeps.h15
2 files changed, 14 insertions, 3 deletions
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 8130d13388..8f220cb05b 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -373,8 +373,6 @@ typedef struct {
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
#define PCI_FUNC(devfn) ((devfn) & 0x07)
#define AUTO_PHP_SLOT 0x100
-#define SYSFS_PCI_DEV "/sys/bus/pci/devices"
-#define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback"
#define XENSTORE_PID_FILE "/var/run/xenstored.pid"
#define PROC_PCI_NUM_RESOURCES 7
diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index fbb3e7d997..f91bc79865 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -23,14 +23,27 @@
#define _GNU_SOURCE
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__)
+#define SYSFS_PCI_DEV "/sys/bus/pci/devices"
+#define SYSFS_PCIBACK_DRIVER "/kern/xen/pci"
+#include <util.h>
+#elif defined(__OpenBSD__)
#include <util.h>
#elif defined(__linux__)
+#define SYSFS_PCI_DEV "/sys/bus/pci/devices"
+#define SYSFS_PCIBACK_DRIVER "/sys/bus/pci/drivers/pciback"
#include <pty.h>
#elif defined(__sun__)
#include <stropts.h>
#endif
+#ifndef SYSFS_PCIBACK_DRIVER
+#error define SYSFS_PCIBACK_DRIVER for your platform
+#endif
+#ifndef SYSFS_PCI_DEV
+#error define SYSFS_PCI_DEV for your platform
+#endif
+
#ifdef NEED_OWN_ASPRINTF
#include <stdarg.h>