Ben Thomas
2007-Feb-28 21:53 UTC
[Xen-devel] [PATCH] [qemu] Modify mechanism by which serial console information is passed.
Modify the mechanism by which the serial console information is passed. First, fix a potential memory leak in handling a realloc failure. Next, the main point of this patch. qemu sets a store path of <domain-path>/console/tty for every pty device that it creates. This has the side effect of rewriting the entry if there is more than one pty-based device. The monitor, serial lines (can be several) and parallel ports (can be several) may all use pty devices. In the face of these multiple potential uses, the path may get overwritten and contain incorrect information. The routine writing the store entry does not know which type of device (monitor, serial, parallel) that it''s creating, and simply always writes the console/tty entry. Resolve this issue by having the request to create the devices also call a routine to create the store entries. The new code will create entries specific to the device, and will also preserve the existing console/tty entry (and prevent it from being overwritten). The entries are: <domain-path>/console/tty <domain-path>/monitor/tty <domain-path>/serial/<n>/tty <domain-path>/parallel/<n>/tty For instance, a selection from a xenstore-ls output: console = "" port = "3" limit = "1048576" tty = "/dev/pts/2" domid = "2" cpu = "" 0 = "" availability = "online" serial = "" 0 = "" tty = "/dev/pts/2" The console/tty entry is preserved, and should match the serial/0/tty entry for the case of a serial console mapped to a pty. This patch makes each of the device entries unambiguous, provides specific information for the additional devices, and maintains compatibility with existing expectations about the console/tty entry. Signed-off-by: Ben Thomas (ben@virtualiron.com) -- ------------------------------------------------------------------------ Ben Thomas Virtual Iron Software bthomas@virtualiron.com Tower 1, Floor 2 978-849-1214 900 Chelmsford Street Lowell, MA 01851 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel