A couple of workarounds for Xen based VPS services
Subsystems (4)
PATCH 2/2 Make the Xen block device prefix configurable
In reply to Soren HansenAdd a config option to tweak the Xen block device prefix.
--- drivers/block/Kconfig | 10 ++++++++++ drivers/block/xen-blkfront.c | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-)
drivers/block/Kconfig +10 -0
@@ -467,6 +467,16 @@ config XEN_BLKDEV_FRONTEND block device driver. It communicates with a back-end driver in another domain which drives the actual block device. +config XEN_BLKDEV_NAME + string "Base name for Xen block devices" + depends on XEN_BLKDEV_FRONTEND + default "xvd" + help + Use this as the base name for Xen block devices. This is + traditionally "xvd", but if you're trying to boot a system + that expects to find its root device on /dev/sda, you can + use this setting to accomodate that. + config VIRTIO_BLK tristate "Virtio block driver (EXPERIMENTAL)" depends on EXPERIMENTAL && VIRTIO
drivers/block/xen-blkfront.c +1 -1
@@ -117,7 +117,7 @@ static DEFINE_SPINLOCK(blkif_io_lock);#define VDEV_IS_EXTENDED (dev) ((dev)&(EXTENDED))#define BLKIF_MINOR_EXT (dev) ((dev)&(~EXTENDED)) -#define DEV_NAME "xvd"/* name in /dev */ +#define DEV_NAME CONFIG_XEN_BLKDEV_NAME/* name in /dev */ static int get_id_from_freelist (struct blkfront_info *info) {
Signature · 1 line
1.7.0.4
PATCH 1/2 Allow hvc tty's to pose as vt's
In reply to Soren HansenAllow for hvc based tty's to take over the vt driver's major number and namespace.
--- drivers/char/Kconfig | 9 ++++++++- drivers/char/hvc_console.c | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletions(-)
drivers/char/Kconfig +8 -1
@@ -5,7 +5,7 @@ menu "Character devices" config VT - bool "Virtual terminal" if EMBEDDED + bool "Virtual terminal" depends on !S390 select INPUT default y
@@ -602,6 +602,13 @@ config PPDEV If unsure, say N. +config HVC_TTY_HACK + bool "Apply various hacks to make hvc[0-] pretend to be tty[1-]" + depends on !VT + help + Make unsuspecting guests work happily with the hvc concoles by + tricking them into thinking they're plain old ttys. + config HVC_DRIVER bool help
drivers/char/hvc_console.c +9 -0
@@ -43,7 +43,11 @@#include "hvc_console.h" +#ifdef CONFIG_HVC_TTY_HACK +#define HVC_MAJOR 4 +#else /* CONFIG_HVC_TTY_HACK */ #define HVC_MAJOR 229 +#endif /* CONFIG_HVC_TTY_HACK */ #define HVC_MINOR 0/*
@@ -848,7 +852,12 @@ static int hvc_init(void) drv->owner =THIS_MODULE ; drv->driver_name ="hvc" ; +#ifdef CONFIG_HVC_TTY_HACK + drv->name ="tty" ; + drv->name_base =1 ; +#else /* CONFIG_HVC_TTY_HACK */ drv->name ="hvc" ; +#endif /* CONFIG_HVC_TTY_HACK */ drv->major =HVC_MAJOR ; drv->minor_start =HVC_MINOR ; drv->type =TTY_DRIVER_TYPE_SYSTEM ;
Signature · 1 line
1.7.0.4
cover A couple of workarounds for Xen based VPS services
Several Xen based VPS providers (Rackspace Cloud Servers, Slicehost, and Amazon EC2 just to name a few) are faced with (at least :) ) two problems with the current Xen support in the kernel.
Mostly, these problems stem from the fact that there are many different guest distro's with very different levels of flexibility in terms of being able to find its root device and in terms of being able to use an hvc based console.
1. Most, if not all (because that's how the infrastructure has presented things so far) expect to find their root device on (a partition on) /dev/sda. However, without a patch to the current kernel, Xen block devices will turn up as /dev/xvda.
2. Very few of the guest systems know to use hvc0 as its console if its available. Instead of requiring all the guests to be changed, it's simpler to just make any attempt to talk to /dev/tty1 actually talk to hvc0.
These two patches add two new configuratin options that lets you work around these problems. Enjoy.
Soren Hansen (2):
Allow hvc tty's to pose as vt's
Make the Xen block device prefix configurable
drivers/block/Kconfig | 10 ++++++++++ drivers/block/xen-blkfront.c | 2 +- drivers/char/Kconfig | 9 ++++++++- drivers/char/hvc_console.c | 9 +++++++++ 4 files changed, 28 insertions(+), 2 deletions(-)
Re: [PATCH 2/2] Make the Xen block device prefix configurable
In reply to Soren HansenQuoted 16 lines · On Fri, 14 May 2010 18:10:48 +0200 Soren Hansen wrote:
Add a config option to tweak the Xen block device prefix.
Signed-off-by Soren Hansen <[email protected]>Tested-by Major Hayden <[email protected]>--- drivers/block/Kconfig | 10 ++++++++++ drivers/block/xen-blkfront.c | 2 +- 2 files changed, 11 insertions(+), 1 deletions(-)drivers/block/Kconfig +0
-0@@ -467,6 +467,16 @@ config XEN_BLKDEV_FRONTEND block device driver. It communicates with a back-end driver in another domain which drives the actual block device.
drivers/block/Kconfig config XEN_BLKDEV_FRONTEND · line 478
Quoted 10 lines
drivers/block/Kconfig +9
-0+config XEN_BLKDEV_NAME + string "Base name for Xen block devices" + depends on XEN_BLKDEV_FRONTEND + default "xvd" + help + Use this as the base name for Xen block devices. This is + traditionally "xvd", but if you're trying to boot a system + that expects to find its root device on /dev/sda, you can + use this setting to accomodate that.
accommodate
drivers/block/Kconfig config XEN_BLKDEV_FRONTEND · line 482
Quoted 4 lines
drivers/block/Kconfig +1
-0+ config VIRTIO_BLK tristate "Virtio block driver (EXPERIMENTAL)" depends on EXPERIMENTAL && VIRTIO
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Alan Cox
NAKRe: [PATCH 1/2] Allow hvc tty's to pose as vt's
In reply to Soren HansenQuoted 2 lines · On Fri, 14 May 2010 18:10:12 +0200 Soren Hansen <[email protected]> wrote:
Allow for hvc based tty's to take over the vt driver's major number and namespace.
We've got a perfect good udev and symlink functionality to rename devices in userspace.
NAK.
I can see why its useful as a hack in a specific user environment but its not appropriate for upstream.
Re: [PATCH 1/2] Allow hvc tty's to pose as vt's
Quoted 4 lines · Alan Cox
Quoted 2 lines
Allow for hvc based tty's to take over the vt driver's major number and namespace.
We've got a perfect good udev and symlink functionality to rename devices in userspace.
I agree in principle. The reason this really is necessary for us (Rackspace) is that we have tons of customers running tons and tons of these virtual machines, and we can't (well, of course we /could/, but that'd be horrible) go around and change people's virtual machines to accomodate changes we want to make on the hypervisor side.
Quoted 1 line
NAK.
Fair enough. I really just wanted to share it in case someone else would find it useful.
Signature · 3 lines
Soren Hansen System Architect, The Rackspace Cloud Ubuntu Developer
Re: [PATCH 1/2] Allow hvc tty's to pose as vt's
In reply to Soren Hansendrivers/char/hvc_console.c line 51
Quoted 9 lines · Soren Hansen
Allow for hvc based tty's to take over the vt driver's major number and namespace.
drivers/char/hvc_console.c +4
-0+#ifdef CONFIG_HVC_TTY_HACK +#define HVC_MAJOR 4 +#else /* CONFIG_HVC_TTY_HACK */ #define HVC_MAJOR 229 +#endif /* CONFIG_HVC_TTY_HACK */ #define HVC_MINOR 0
Out of curiosity, what happens if you boot a kernel with this config hack on a system that has real live "plain old ttys"?