All of lore.kernel.org
 help / color / mirror / Atom feed
* Legacy tty1 support in pvops kernels
@ 2010-05-11 19:11 Major Hayden
  0 siblings, 0 replies; 8+ messages in thread
From: Major Hayden @ 2010-05-11 19:11 UTC (permalink / raw)
  To: xen-devel

Hey there,

At work, we have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b8578bb..9c8aaa4 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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       "sd"    /* name in /dev */
 
 static int get_id_from_freelist(struct blkfront_info *info)
 {

However, I'm struggling with the hvc0 -> tty1 change.  In short, I'm looking to bring up a domU that is pre-configured to use tty1 as its console.  I understand that the virtual terminal drivers and hvc drivers are different and that the OS will see them differently as it boots.  I made these adjustments in the hopes that something would work:

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..cd2888d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,7 +5,7 @@
 menu "Character devices"
 
 config VT
-       bool "Virtual terminal" if EMBEDDED
+       bool "Virtual terminal"
        depends on !S390
        select INPUT
        default y

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..eff0900 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -44,7 +44,7 @@
 #include "hvc_console.h"
 
 #define HVC_MAJOR      229
-#define HVC_MINOR      0
+#define HVC_MINOR      1
 
 /*
  * Wait this long per iteration while trying to push buffered data to the
@@ -848,7 +848,7 @@ static int hvc_init(void)
 
        drv->owner = THIS_MODULE;
        drv->driver_name = "hvc";
-       drv->name = "hvc";
+       drv->name = "tty";
        drv->major = HVC_MAJOR;
        drv->minor_start = HVC_MINOR;
        drv->type = TTY_DRIVER_TYPE_SYSTEM;

I end up with tty's when the domU boots, but when the domU boots, I see several of these messages in the console:

/scripts/init-top/console_setup: 70: cannot create /dev/tty1: No such device or address

However, the device is present when the domU finishes booting:

pvops:~# ls -al /dev/tty1
crw-rw---- 1 root root 229, 2 May 11 17:48 /dev/tty1
pvops:~# file /dev/tty1
/dev/tty1: character special

Has anyone tried this before?  Any suggestions would be greatly appreciated.

--
Major Hayden
major@mhtx.net

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Legacy tty1 support in pvops kernels
  2010-05-12 16:57   ` Major Hayden
@ 2010-05-13 20:50     ` Major Hayden
  0 siblings, 0 replies; 8+ messages in thread
From: Major Hayden @ 2010-05-13 20:50 UTC (permalink / raw)
  To: xen-devel; +Cc: Soren Hansen, Jeremy Fitzhardinge

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

Hello all,

Thanks to quite a bit of assistance from Soren Hansen, we have a solution to provide legacy support for /dev/tty1 consoles as well as /dev/sdX block devices in domU's.

The diff is based on 2.6.32.12 from kernel.org.  I built x86_64 and i386 kernels from it and it's been tested in various domU's running on Xen 3.0.3, 3.1.2, 3.3.0 and 3.4.2.  The tested domU's were running CentOS, Fedora, Ubuntu, Debian, Gentoo and Arch.

I'm definitely new to making kernel patches and I'm not entirely sure that this is worth submitting upstream.  I'm very much interested in any feedback the community might have.

--
Major Hayden


[-- Attachment #2: legacy_pvops.diff --]
[-- Type: application/octet-stream, Size: 2654 bytes --]

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 1d886e0..89c1887 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -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 accommodate that.
+
 config VIRTIO_BLK
 	tristate "Virtio block driver (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && VIRTIO
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b8578bb..9910fe5 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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)
 {
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..8610179 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -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 consoles by
+	  tricking them into thinking they're plain old ttys.
+
 config HVC_DRIVER
 	bool
 	help
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..4c6b03d 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Legacy tty1 support in pvops kernels
  2010-05-12  0:42 Major Hayden
  2010-05-12 16:37 ` Jeremy Fitzhardinge
@ 2010-05-12 17:21 ` Stefan Kuhne
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Kuhne @ 2010-05-12 17:21 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 410 bytes --]

Am 12.05.2010 02:42, schrieb Major Hayden:

Hello,
> 
> We have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:
> 
I'm interested it this, too.
But, i'd prefer to map xvda to the device which is configured in domU
config file.

Regards,
Stefan Kuhne


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 552 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Legacy tty1 support in pvops kernels
  2010-05-12 16:37 ` Jeremy Fitzhardinge
@ 2010-05-12 16:57   ` Major Hayden
  2010-05-13 20:50     ` Major Hayden
  0 siblings, 1 reply; 8+ messages in thread
From: Major Hayden @ 2010-05-12 16:57 UTC (permalink / raw)
  To: Jeremy Fitzhardinge; +Cc: xen-devel

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

Hello Jeremy,

I did switch around HVC_MAJOR to 4 earlier this morning and that works - except the console ends up on tty0.  I spotted the following within hvc_init() (line 853 of drivers/char/hvc_console.c in vanilla 2.6.32.12):

drv->minor_start = HVC_MINOR;

I set HVC_MINOR at the top of hvc_console.c to 1 and recompiled, but the console still ended up on /dev/tty0.  If I adjust the domU's inittab to bring up a console on /dev/tty0, I can interact with the console as I normally could on /dev/hvc0.  However, I'm trying to avoid making changes within the domU's themselves as this would involve an enormous amount of work.

Do you have any ideas on how to shift the first index of the hvc console to 1 rather than 0?  I think that'd solve my problem.  It's so close I can feel it. ;-)

My current diffs are attached.

--
Major Hayden

[-- Attachment #2: pvops.diff --]
[-- Type: application/octet-stream, Size: 1420 bytes --]

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b8578bb..9c8aaa4 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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       "sd"    /* name in /dev */
 
 static int get_id_from_freelist(struct blkfront_info *info)
 {
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..cd2888d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,7 +5,7 @@
 menu "Character devices"
 
 config VT
-       bool "Virtual terminal" if EMBEDDED
+       bool "Virtual terminal"
        depends on !S390
        select INPUT
        default y
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..55bbf92 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -43,7 +43,7 @@
 
 #include "hvc_console.h"
 
-#define HVC_MAJOR      229
+#define HVC_MAJOR      4
 #define HVC_MINOR      0
 
 /*
@@ -848,7 +848,7 @@ static int hvc_init(void)
 
        drv->owner = THIS_MODULE;
        drv->driver_name = "hvc";
-       drv->name = "hvc";
+       drv->name = "tty";
        drv->major = HVC_MAJOR;
        drv->minor_start = HVC_MINOR;
        drv->type = TTY_DRIVER_TYPE_SYSTEM;

[-- Attachment #3: Type: text/plain, Size: 1986 bytes --]


On May 12, 2010, at 11:37, Jeremy Fitzhardinge wrote:

> On 05/11/2010 05:42 PM, Major Hayden wrote:
>> Hey there,
>> 
>> We have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:
>> 
>> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
>> index b8578bb..9c8aaa4 100644
>> --- a/drivers/block/xen-blkfront.c
>> +++ b/drivers/block/xen-blkfront.c
>> @@ -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       "sd"    /* name in /dev */
>> 
>> static int get_id_from_freelist(struct blkfront_info *info)
>> {
>> 
>> However, I'm struggling with the hvc0 -> tty1 change.  In short, I'm looking to bring up a domU that is pre-configured to use tty1 as its console.  I understand that the virtual terminal drivers and hvc drivers are different and that the OS will see them differently as it boots.  I made these adjustments in the hopes that something would work:
>> 
>> diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
>> index 6aad99e..cd2888d 100644
>> --- a/drivers/char/Kconfig
>> +++ b/drivers/char/Kconfig
>> @@ -5,7 +5,7 @@
>> menu "Character devices"
>> 
>> config VT
>> -       bool "Virtual terminal" if EMBEDDED
>> +       bool "Virtual terminal"
>>      depends on !S390
>>      select INPUT
>>      default y
>> 
>> diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
>> index a632f25..eff0900 100644
>> --- a/drivers/char/hvc_console.c
>> +++ b/drivers/char/hvc_console.c
>> @@ -44,7 +44,7 @@
>> #include "hvc_console.h"
>> 
>> #define HVC_MAJOR      229
>> 
> 
> Did you try changing the major to 4 as well?  To match /dev/ttyX?
> 
>    J


[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Legacy tty1 support in pvops kernels
  2010-05-12  0:42 Major Hayden
@ 2010-05-12 16:37 ` Jeremy Fitzhardinge
  2010-05-12 16:57   ` Major Hayden
  2010-05-12 17:21 ` Stefan Kuhne
  1 sibling, 1 reply; 8+ messages in thread
From: Jeremy Fitzhardinge @ 2010-05-12 16:37 UTC (permalink / raw)
  To: Major Hayden; +Cc: xen-devel

On 05/11/2010 05:42 PM, Major Hayden wrote:
> Hey there,
>
> We have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:
>
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index b8578bb..9c8aaa4 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -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       "sd"    /* name in /dev */
>
> static int get_id_from_freelist(struct blkfront_info *info)
> {
>
> However, I'm struggling with the hvc0 -> tty1 change.  In short, I'm looking to bring up a domU that is pre-configured to use tty1 as its console.  I understand that the virtual terminal drivers and hvc drivers are different and that the OS will see them differently as it boots.  I made these adjustments in the hopes that something would work:
>
> diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
> index 6aad99e..cd2888d 100644
> --- a/drivers/char/Kconfig
> +++ b/drivers/char/Kconfig
> @@ -5,7 +5,7 @@
> menu "Character devices"
>
> config VT
> -       bool "Virtual terminal" if EMBEDDED
> +       bool "Virtual terminal"
>       depends on !S390
>       select INPUT
>       default y
>
> diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
> index a632f25..eff0900 100644
> --- a/drivers/char/hvc_console.c
> +++ b/drivers/char/hvc_console.c
> @@ -44,7 +44,7 @@
> #include "hvc_console.h"
>
> #define HVC_MAJOR      229
>   

Did you try changing the major to 4 as well?  To match /dev/ttyX?

    J

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Legacy tty1 support in pvops kernels
@ 2010-05-12  0:42 Major Hayden
  2010-05-12 16:37 ` Jeremy Fitzhardinge
  2010-05-12 17:21 ` Stefan Kuhne
  0 siblings, 2 replies; 8+ messages in thread
From: Major Hayden @ 2010-05-12  0:42 UTC (permalink / raw)
  To: xen-devel

Hey there,

We have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b8578bb..9c8aaa4 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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       "sd"    /* name in /dev */

static int get_id_from_freelist(struct blkfront_info *info)
{

However, I'm struggling with the hvc0 -> tty1 change.  In short, I'm looking to bring up a domU that is pre-configured to use tty1 as its console.  I understand that the virtual terminal drivers and hvc drivers are different and that the OS will see them differently as it boots.  I made these adjustments in the hopes that something would work:

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..cd2888d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,7 +5,7 @@
menu "Character devices"

config VT
-       bool "Virtual terminal" if EMBEDDED
+       bool "Virtual terminal"
      depends on !S390
      select INPUT
      default y

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..eff0900 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -44,7 +44,7 @@
#include "hvc_console.h"

#define HVC_MAJOR      229
-#define HVC_MINOR      0
+#define HVC_MINOR      1

/*
* Wait this long per iteration while trying to push buffered data to the
@@ -848,7 +848,7 @@ static int hvc_init(void)

      drv->owner = THIS_MODULE;
      drv->driver_name = "hvc";
-       drv->name = "hvc";
+       drv->name = "tty";
      drv->major = HVC_MAJOR;
      drv->minor_start = HVC_MINOR;
      drv->type = TTY_DRIVER_TYPE_SYSTEM;

I end up with tty's when the domU boots, but when the domU boots, I see several of these messages in the console:

/scripts/init-top/console_setup: 70: cannot create /dev/tty1: No such device or address

However, the device is present when the domU finishes booting:

pvops:~# ls -al /dev/tty1
crw-rw---- 1 root root 229, 2 May 11 17:48 /dev/tty1
pvops:~# file /dev/tty1
/dev/tty1: character special

Has anyone tried this before?  Any suggestions would be greatly appreciated.

--
Major Hayden

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Legacy tty1 support in pvops kernels
@ 2010-05-12  0:30 Major Hayden
  0 siblings, 0 replies; 8+ messages in thread
From: Major Hayden @ 2010-05-12  0:30 UTC (permalink / raw)
  To: xen-devel

Hey there,

We have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b8578bb..9c8aaa4 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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       "sd"    /* name in /dev */

static int get_id_from_freelist(struct blkfront_info *info)
{

However, I'm struggling with the hvc0 -> tty1 change.  In short, I'm looking to bring up a domU that is pre-configured to use tty1 as its console.  I understand that the virtual terminal drivers and hvc drivers are different and that the OS will see them differently as it boots.  I made these adjustments in the hopes that something would work:

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..cd2888d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,7 +5,7 @@
menu "Character devices"

config VT
-       bool "Virtual terminal" if EMBEDDED
+       bool "Virtual terminal"
       depends on !S390
       select INPUT
       default y

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..eff0900 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -44,7 +44,7 @@
#include "hvc_console.h"

#define HVC_MAJOR      229
-#define HVC_MINOR      0
+#define HVC_MINOR      1

/*
 * Wait this long per iteration while trying to push buffered data to the
@@ -848,7 +848,7 @@ static int hvc_init(void)

       drv->owner = THIS_MODULE;
       drv->driver_name = "hvc";
-       drv->name = "hvc";
+       drv->name = "tty";
       drv->major = HVC_MAJOR;
       drv->minor_start = HVC_MINOR;
       drv->type = TTY_DRIVER_TYPE_SYSTEM;

I end up with tty's when the domU boots, but when the domU boots, I see several of these messages in the console:

/scripts/init-top/console_setup: 70: cannot create /dev/tty1: No such device or address

However, the device is present when the domU finishes booting:

pvops:~# ls -al /dev/tty1
crw-rw---- 1 root root 229, 2 May 11 17:48 /dev/tty1
pvops:~# file /dev/tty1
/dev/tty1: character special

Has anyone tried this before?  Any suggestions would be greatly appreciated.

--
Major Hayden

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Legacy tty1 support in pvops kernels
@ 2010-05-11 21:16 Major Hayden
  0 siblings, 0 replies; 8+ messages in thread
From: Major Hayden @ 2010-05-11 21:16 UTC (permalink / raw)
  To: xen-devel

Hey there,

At work, we have quite a few legacy environments that already have pre-built domU images that depend on /dev/sdX for block devices and /dev/tty1 for console access.  The /dev/xvdX -> /dev/sdX change is trivial:

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index b8578bb..9c8aaa4 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -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       "sd"    /* name in /dev */

static int get_id_from_freelist(struct blkfront_info *info)
{

However, I'm struggling with the hvc0 -> tty1 change.  In short, I'm looking to bring up a domU that is pre-configured to use tty1 as its console.  I understand that the virtual terminal drivers and hvc drivers are different and that the OS will see them differently as it boots.  I made these adjustments in the hopes that something would work:

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 6aad99e..cd2888d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -5,7 +5,7 @@
menu "Character devices"

config VT
-       bool "Virtual terminal" if EMBEDDED
+       bool "Virtual terminal"
       depends on !S390
       select INPUT
       default y

diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..eff0900 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -44,7 +44,7 @@
#include "hvc_console.h"

#define HVC_MAJOR      229
-#define HVC_MINOR      0
+#define HVC_MINOR      1

/*
 * Wait this long per iteration while trying to push buffered data to the
@@ -848,7 +848,7 @@ static int hvc_init(void)

       drv->owner = THIS_MODULE;
       drv->driver_name = "hvc";
-       drv->name = "hvc";
+       drv->name = "tty";
       drv->major = HVC_MAJOR;
       drv->minor_start = HVC_MINOR;
       drv->type = TTY_DRIVER_TYPE_SYSTEM;

I end up with tty's when the domU boots, but when the domU boots, I see several of these messages in the console:

/scripts/init-top/console_setup: 70: cannot create /dev/tty1: No such device or address

However, the device is present when the domU finishes booting:

pvops:~# ls -al /dev/tty1
crw-rw---- 1 root root 229, 2 May 11 17:48 /dev/tty1
pvops:~# file /dev/tty1
/dev/tty1: character special

Has anyone tried this before?  Any suggestions would be greatly appreciated.

--
Major Hayden
major@mhtx.net

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-05-13 20:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-11 19:11 Legacy tty1 support in pvops kernels Major Hayden
2010-05-11 21:16 Major Hayden
2010-05-12  0:30 Major Hayden
2010-05-12  0:42 Major Hayden
2010-05-12 16:37 ` Jeremy Fitzhardinge
2010-05-12 16:57   ` Major Hayden
2010-05-13 20:50     ` Major Hayden
2010-05-12 17:21 ` Stefan Kuhne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.