Skip to contentSkip to conversation

two serial port in HVM DomU patch]

Fwd: Stephan Seitz 5 participants 7 messages Dec 31, 2007 – Jan 6, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

attached is a patch posted at xen-users from Mishell Baranov for qemu-dm to support two serial lines.

I think this is a feature that could be implemented in the unstable and testing branches.

Regards,

Signature · 15 lines
Stephan Seitz
Senior System Administrator

*netz-haut* e.K.
multimediale kommunikation

zweierweg 22
97074 würzburg

fon: +49 931 2876247
fax: +49 931 2876248

web: www.netz-haut.de <http://www.netz-haut.de/>

registriergericht: amtsgericht würzburg, hra 5054

hi
Litle hack to allow 2 serial port's in HVM. in config set seriala=/dev/ttyS0 serialb=/dev/ttyS1 it's work for me.
some body else was intresting that.

tools/ioemu/vl.c +6 -3
diff -ur xen-3.1-3.1.0/tools/ioemu/vl.c xen-3.1-3.1.0-my/tools/ioemu/vl.c
@@ -5515,7 +5515,8 @@
     QEMU_OPTION_std_vga,
     QEMU_OPTION_monitor,
     QEMU_OPTION_domainname,
-    QEMU_OPTION_serial,
+    QEMU_OPTION_seriala,
+    QEMU_OPTION_serialb,
     QEMU_OPTION_parallel,
     QEMU_OPTION_loadvm,
     QEMU_OPTION_full_screen,
@@ -5603,7 +5604,8 @@
     { "std-vga", 0, QEMU_OPTION_std_vga },
     { "monitor", 1, QEMU_OPTION_monitor },
     { "domain-name", 1, QEMU_OPTION_domainname },
-    { "serial", 1, QEMU_OPTION_serial },
+    { "seriala", 1, QEMU_OPTION_seriala },
+    { "serialb", 1, QEMU_OPTION_serialb },
     { "parallel", 1, QEMU_OPTION_parallel },
     { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
     { "full-screen", 0, QEMU_OPTION_full_screen },
@@ -6465,7 +6467,8 @@
             case QEMU_OPTION_monitor:
                 pstrcpy(monitor_device, sizeof(monitor_device), optarg);
                 break;
-            case QEMU_OPTION_serial:
+            case QEMU_OPTION_seriala:
+            case QEMU_OPTION_serialb:
                 if (serial_device_index >= MAX_SERIAL_PORTS) {
                     fprintf(stderr, "qemu: too many serial ports\n");
                     exit(1);
tools/python/xen/xend/image.py +1 -1
diff -ur xen-3.1-3.1.0/tools/python/xen/xend/image.py xen-3.1-3.1.0-my/tools/python/xen/xend/image.py
@@ -299,7 +299,7 @@
     # xm config file
     def parseDeviceModelArgs(self, vmConfig):
         dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
-                   'localtime', 'serial', 'stdvga', 'isa',
+                   'localtime', 'seriala', 'serialb', 'stdvga', 'isa',
                    'acpi', 'usb', 'usbdevice', 'keymap' ]
         
         ret = ['-vcpus', str(self.vm.getVCpuCount())]
tools/python/xen/xend/XendConfig.py +1 -1
diff -ur xen-3.1-3.1.0/tools/python/xen/xend/XendConfig.py xen-3.1-3.1.0-my/tools/python/xen/xend/XendConfig.py
@@ -119,7 +119,7 @@
 # Platform configuration keys.
 XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display', 
                         'fda', 'fdb', 'keymap', 'isa', 'localtime', 'monitor', 
-                        'nographic', 'pae', 'rtc_timeoffset', 'serial', 'sdl',
+                        'nographic', 'pae', 'rtc_timeoffset', 'seriala', 'serialb', 'sdl',
                         'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
                         'vncconsole', 'vncdisplay', 'vnclisten',
                         'vncpasswd', 'vncunused', 'xauthority']
tools/python/xen/xm/create.py +6 -2
diff -ur xen-3.1-3.1.0/tools/python/xen/xm/create.py xen-3.1-3.1.0-my/tools/python/xen/xm/create.py
@@ -417,7 +417,11 @@
           fn=set_value, default='',
           use="Path to fdb")
 
-gopts.var('serial', val='FILE',
+gopts.var('seriala', val='FILE',
+          fn=set_value, default='',
+          use="Path to serial or pty or vc")
+
+gopts.var('serialb', val='FILE',
           fn=set_value, default='',
           use="Path to serial or pty or vc")
 
@@ -723,7 +727,7 @@
     """Create the config for HVM devices.
     """
     args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb',
-             'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw',
+             'localtime', 'seriala', 'serialb', 'stdvga', 'isa', 'nographic', 'soundhw',
              'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
              'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
              'acpi', 'apic', 'usb', 'usbdevice', 'keymap' ]

_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xensource.com/xen-users

begin:vcard
fn:Stephan Seitz
n:Seitz;Stephan
org:netz-haut e.K.
adr:;;Zweierweg 22;Wuerzburg;Bayern;97074;Deutschland email;internet:[email protected] title:Senior System Administrator tel;work:+49-931-287-6247 tel;fax:+49-931-287-6248
x-mozilla-html:FALSE url:http://www.schwarz-mode.de/files/ version:2.1
end:vcard

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

How much more work would it take to support an arbitrary number of serial ports?

Quoted 34 lines

-----Original Message-----
From: [email protected] [mailto:xen-devel- [email protected]] On Behalf Of Stephan Seitz
Sent: Monday, 31 December 2007 23:13
To: XEN Devel - listmembers
Subject: [Xen-devel] [Fwd: [Xen-users] two serial port in HVM DomU patch]

Hi,

attached is a patch posted at xen-users from Mishell Baranov for qemu-dm to support two serial lines.

I think this is a feature that could be implemented in the unstable and testing branches.

Regards,

--
Stephan Seitz
Senior System Administrator

*netz-haut* e.K.
multimediale kommunikation

zweierweg 22
97074 würzburg

fon: +49 931 2876247
fax: +49 931 2876248

web: www.netz-haut.de <http://www.netz-haut.de/>

registriergericht: amtsgericht würzburg, hra 5054

#2 lore raw
In reply to Stephan Seitz

Hi,

tools/ioemu/vl.c line 5605

Quoted 4 lines · Stephan Seitz, le Mon 31 Dec 2007 13:13:06 +0100, a écrit :
tools/ioemu/vl.c +2 -1
@@ -5603,7 +5604,8 @@
-    { "serial", 1, QEMU_OPTION_serial },
+    { "seriala", 1, QEMU_OPTION_seriala },
+    { "serialb", 1, QEMU_OPTION_serialb },

There is no real need to do this: qemu can handle several -serial options fine.

tools/python/xen/xm/create.py line 420

Quoted 4 lines

diff -ur xen-3.1-3.1.0/tools/python/xen/xm/create.py xen-3.1-3.1.0-my/tools/python/xen/xm/create.py

tools/python/xen/xm/create.py +0 -1
-gopts.var('serial', val='FILE',

And that could be a list of serial/pty/vc/...

Samuel

#6 lore raw
In reply to Keir Fraser
Quoted 7 lines · Keir Fraser

I'd advocate a dm_args domain config option, which would be a string of qemu command-line arguments which would be dumbly passed straight through to qemu-dm without any further processing by xend.

Then you could just do 'dm_args = "serial=/dev/ttyS0 serial=/dev/ttyS1"' and not need any changes to qemu source code at all. And this would also let you get at any other underlying features of qemu too. Much nicer.

I think that's a bad idea as any info in this generic 'dm_args' is now lost to the formal API data model. eg If a management app wants to talk to XenD and determine how / if the serial port is configured, it now has to look at both the formally specified 'serial' param, and also parse the command line args in 'dm_args'. Sure it means we have to write less code in XenD, but it means that all users talking to XenD have much more work todo. I don't really see that as a net win.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#5 lore raw
In reply to Stephan Seitz

I'd advocate a dm_args domain config option, which would be a string of qemu command-line arguments which would be dumbly passed straight through to qemu-dm without any further processing by xend.

Then you could just do 'dm_args = "serial=/dev/ttyS0 serial=/dev/ttyS1"' and not need any changes to qemu source code at all. And this would also let you get at any other underlying features of qemu too. Much nicer.

This would certainly be a good thing post 3.2.0 and 3.1.3.

-- Keir

Quoted 10 lines · Stephan Seitz

Hi,

attached is a patch posted at xen-users from Mishell Baranov for qemu-dm to support two serial lines.

I think this is a feature that could be implemented in the unstable and testing branches.

Regards,

#4 lore raw
In reply to Keir Fraser
Quoted 4 lines · Keir Fraser

Ah, this is a nice way that continues to support the existing domain config format. I'd still also like a dm_args config option too though! Really many of the HVM-specific config options could be deprecated and moved over to a single dm_args config field.

No no no, please no. The current scheme is good because there are clear key,value pairs for each individual configuration option. A generic blob of dm_args will be a huge PITA to deal with, making a mockery of the attempt at clearly modelling guest config params in XenAPI, as well as the legacy config formats. It will also increase the divergance in the way HVM guests are configured vs paravirt guests if we start to shove all the HVM args into 'dm_args' rather than representing them in a way which works well for both HVM and PV domains.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#3 lore raw
In reply to Samuel Thibault

Ah, this is a nice way that continues to support the existing domain config format. I'd still also like a dm_args config option too though! Really many of the HVM-specific config options could be deprecated and moved over to a single dm_args config field.

-- Keir

Quoted 27 lines · Samuel Thibault

Hi,

tools/ioemu/vl.c line 5605

Quoted 4 lines · Stephan Seitz, le Mon 31 Dec 2007 13:13:06 +0100, a écrit :
tools/ioemu/vl.c +2 -1
@@ -5603,7 +5604,8 @@
-    { "serial", 1, QEMU_OPTION_serial },
+    { "seriala", 1, QEMU_OPTION_seriala },
+    { "serialb", 1, QEMU_OPTION_serialb },

There is no real need to do this: qemu can handle several -serial options fine.

Quoted 7 lines

diff -ur xen-3.1-3.1.0/tools/python/xen/xm/create.py xen-3.1-3.1.0-my/tools/python/xen/xm/create.py
--- xen-3.1-3.1.0/tools/python/xen/xm/create.py 2007-05-18 20:45:21.000000000 +0600
+++ xen-3.1-3.1.0-my/tools/python/xen/xm/create.py 2007-12-30 19:25:57.000000000 +0500
-gopts.var('serial', val='FILE',

And that could be a list of serial/pty/vc/...

Samuel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel