summaryrefslogtreecommitdiffstats
path: root/sys/dev/xen
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2015-08-21 15:53:08 +0000
committerroyger <royger@FreeBSD.org>2015-08-21 15:53:08 +0000
commitef7f753c0456a32eb1092ed1a5ee0affd7659c57 (patch)
treeb9a2f09cf466dd32614dc7bf3758010301028efb /sys/dev/xen
parentc91bb25afef948b9a83e4e73568fc70a59b4b0c3 (diff)
downloadFreeBSD-src-ef7f753c0456a32eb1092ed1a5ee0affd7659c57.zip
FreeBSD-src-ef7f753c0456a32eb1092ed1a5ee0affd7659c57.tar.gz
xen: allow disabling PV disks and nics
Introduce two new loader tunnables that can be used to disable PV disks and PV nics at boot time. They default to 0 and should be set to 1 (or any number different than 0) in order to disable the PV devices: hw.xen.disable_pv_disks=1 hw.xen.disable_pv_nics=1 In /boot/loader.conf will disable both PV disks and nics. Sponsored by: Citrix Systems R&D Tested by: Karl Pielorz <kpielorz_lst@tdx.co.uk> MFC after: 1 week
Diffstat (limited to 'sys/dev/xen')
-rw-r--r--sys/dev/xen/blkfront/blkfront.c3
-rw-r--r--sys/dev/xen/netfront/netfront.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c
index 5ff9d38..1416c28 100644
--- a/sys/dev/xen/blkfront/blkfront.c
+++ b/sys/dev/xen/blkfront/blkfront.c
@@ -1366,6 +1366,9 @@ xbd_probe(device_t dev)
if (strcmp(xenbus_get_type(dev), "vbd") != 0)
return (ENXIO);
+ if (xen_hvm_domain() && xen_disable_pv_disks != 0)
+ return (ENXIO);
+
if (xen_hvm_domain()) {
int error;
char *type;
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index 302c017..703b44f 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -445,6 +445,9 @@ static int
netfront_probe(device_t dev)
{
+ if (xen_hvm_domain() && xen_disable_pv_nics != 0)
+ return (ENXIO);
+
if (!strcmp(xenbus_get_type(dev), "vif")) {
device_set_desc(dev, "Virtual Network Interface");
return (0);
OpenPOWER on IntegriCloud