[PATCH 2/2] xen: wrap privcmd on xenfs with COMPAT option

2015-11-30 Thread Doug Goldstein
Since Xen 4.7.0, using privcmd via xenfs (/proc/xen/privcmd) is deprecated
and /dev/xen/privcmd via pvops is used instead. This is an effort to
eventually drop this interface after a reasonable amount of time.

Signed-off-by: Doug Goldstein 
---
 drivers/xen/Kconfig   | 12 
 drivers/xen/xenfs/super.c |  4 
 2 files changed, 16 insertions(+)

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 7003984..c610902 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -135,6 +135,18 @@ config XEN_COMPAT_XENFS_XENBUS
  Xen 4.6.0 and newer.
  If in doubt, say yes.
 
+config XEN_COMPAT_XENFS_PRIVCMD
+   bool "privcmd accessible from xenfs"
+   depends on XENFS
+   default y
+   help
+ Since Xen 4.7.0, Xen userland will prefer to use the
+ /dev/xen/privcmd device over the "privcmd" interface on the
+ xenfs filesystem. Selecting this causes the kernel to include
+ the "privcmd" interface on the xenfs filesystem and you can
+ safely say no for Xen 4.7.0 and newer.
+ If in doubt, say yes.
+
 config XEN_SYS_HYPERVISOR
bool "Create xen entries under /sys/hypervisor"
depends on SYSFS
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index 86ff5b3..bb40970b 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -50,7 +50,9 @@ static int xenfs_fill_super(struct super_block *sb, void 
*data, int silent)
{ "xenbus", _xenbus_fops, S_IRUSR|S_IWUSR },
 #endif
{ "capabilities", _file_ops, S_IRUGO },
+#ifdef CONFIG_XEN_COMPAT_XENFS_PRIVCMD
{ "privcmd", _privcmd_fops, S_IRUSR|S_IWUSR },
+#endif
{""},
};
 
@@ -60,7 +62,9 @@ static int xenfs_fill_super(struct super_block *sb, void 
*data, int silent)
{ "xenbus", _xenbus_fops, S_IRUSR|S_IWUSR },
 #endif
{ "capabilities", _file_ops, S_IRUGO },
+#ifdef CONFIG_XEN_COMPAT_XENFS_PRIVCMD
{ "privcmd", _privcmd_fops, S_IRUSR|S_IWUSR },
+#endif
{ "xsd_kva", _kva_file_ops, S_IRUSR|S_IWUSR},
{ "xsd_port", _port_file_ops, S_IRUSR|S_IWUSR},
 #ifdef CONFIG_XEN_SYMS
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] xen: wrap privcmd on xenfs with COMPAT option

2015-11-30 Thread Doug Goldstein
Since Xen 4.7.0, using privcmd via xenfs (/proc/xen/privcmd) is deprecated
and /dev/xen/privcmd via pvops is used instead. This is an effort to
eventually drop this interface after a reasonable amount of time.

Signed-off-by: Doug Goldstein 
---
 drivers/xen/Kconfig   | 12 
 drivers/xen/xenfs/super.c |  4 
 2 files changed, 16 insertions(+)

diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 7003984..c610902 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -135,6 +135,18 @@ config XEN_COMPAT_XENFS_XENBUS
  Xen 4.6.0 and newer.
  If in doubt, say yes.
 
+config XEN_COMPAT_XENFS_PRIVCMD
+   bool "privcmd accessible from xenfs"
+   depends on XENFS
+   default y
+   help
+ Since Xen 4.7.0, Xen userland will prefer to use the
+ /dev/xen/privcmd device over the "privcmd" interface on the
+ xenfs filesystem. Selecting this causes the kernel to include
+ the "privcmd" interface on the xenfs filesystem and you can
+ safely say no for Xen 4.7.0 and newer.
+ If in doubt, say yes.
+
 config XEN_SYS_HYPERVISOR
bool "Create xen entries under /sys/hypervisor"
depends on SYSFS
diff --git a/drivers/xen/xenfs/super.c b/drivers/xen/xenfs/super.c
index 86ff5b3..bb40970b 100644
--- a/drivers/xen/xenfs/super.c
+++ b/drivers/xen/xenfs/super.c
@@ -50,7 +50,9 @@ static int xenfs_fill_super(struct super_block *sb, void 
*data, int silent)
{ "xenbus", _xenbus_fops, S_IRUSR|S_IWUSR },
 #endif
{ "capabilities", _file_ops, S_IRUGO },
+#ifdef CONFIG_XEN_COMPAT_XENFS_PRIVCMD
{ "privcmd", _privcmd_fops, S_IRUSR|S_IWUSR },
+#endif
{""},
};
 
@@ -60,7 +62,9 @@ static int xenfs_fill_super(struct super_block *sb, void 
*data, int silent)
{ "xenbus", _xenbus_fops, S_IRUSR|S_IWUSR },
 #endif
{ "capabilities", _file_ops, S_IRUGO },
+#ifdef CONFIG_XEN_COMPAT_XENFS_PRIVCMD
{ "privcmd", _privcmd_fops, S_IRUSR|S_IWUSR },
+#endif
{ "xsd_kva", _kva_file_ops, S_IRUSR|S_IWUSR},
{ "xsd_port", _port_file_ops, S_IRUSR|S_IWUSR},
 #ifdef CONFIG_XEN_SYMS
-- 
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/