Statistics
| Branch: | Revision:

root / qemu-char.c @ 7ad7e3c3

History | View | Annotate | Download (64.8 kB)

# Date Author Comment
afc535ac 02/10/2010 07:56 pm Evgeniy Dushistov

Do not ignore error, if open file failed (-serial /dev/tty)

In case, when qemu is executed with option like
-serial /dev/ttyS0, report if there are problems with
opening of devices. At now errors are silently ignoring.

Signed-off-by: Evgeniy Dushistov <>...

3b9d7e66 01/20/2010 12:31 am Kusanagi Kouichi

char: Remove redundant qemu_chr_generic_open() call.

qemu_chr_open_fd() calls qemu_chr_generic_open(),
so qemu_chr_open_tty() doesn't need to call it.

Signed-off-by: Kusanagi Kouichi <>
Signed-off-by: Anthony Liguori <>

588b3832 12/12/2009 03:59 pm Luiz Capitulino

char: Convert qemu_chr_info() to QObject

Each device is represented by a QDict. The returned QObject is a QList
of all devices.

This commit should not change user output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

33521634 12/12/2009 03:59 pm Gerd Hoffmann

un-static qemu_chr_parse_compat()

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

40ff6d7e 12/03/2009 07:45 pm Kevin Wolf

Don't leak file descriptors

We're leaking file descriptors to child processes. Set FD_CLOEXEC on file
descriptors that don't need to be passed to children to stop this misbehaviour.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

bbe813a2 11/30/2009 04:42 pm Aurelien Jarno

Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18

Signed-off-by: Aurelien Jarno <>

a167ba50 11/29/2009 07:00 pm Aurelien Jarno

Add support for GNU/kFreeBSD

Signed-off-by: Aurelien Jarno <>

127338e6 11/17/2009 04:03 pm Amit Shah

char: rename qemu_chr_reset to qemu_chr_generic_open

This function sends out the OPENED event to backends that
have drive the chardevs. The 'reset' is now a historical
artifact and we can now just call the function for what it
is.

Signed-off-by: Amit Shah <>...

9bd7854e 11/17/2009 04:03 pm Amit Shah

char: don't limit data sent to backends to 1k per buffer

chardevs have a 'can_read' function via which backends specify
the amount of data they can receive. When can_read returns > 0,
apps can start sending data. However, each chardev driver here
allows a max. of 1k bytes inspite of the backend being able to...

57e073a3 11/17/2009 04:03 pm Amit Shah

char: Remove special init_reset handling

The initial_reset sent to chardevs doesn't do much other than setting
a bool to true. Char devices are interested in the open event and
that gets sent whenever the device is opened.

Moreover, the reset logic breaks as and when qemu's bh scheduling...

45eea13b 10/30/2009 03:39 pm Stefan Weil

serial: Support additional serial speed values

  • Allow any speed value which is defined for Linux
    (and possibly other systems).
  • Compare int values instead of double values.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

f7cbc08f 10/27/2009 07:29 pm Anthony Liguori

Revert "char: emit the OPENED event only when a new char connection is opened"

This reverts commit 6cfa64de908d67fb6f6b6e3ae4888dd863f69e44.

This breaks the monitor prompt. Proper fix will come from Amit.

Signed-off-by: Anthony Liguori <>

1abb8172 10/27/2009 07:28 pm Mark McLoughlin

net: remove unused includes of if_tun.h and if_tap.h

Looks like these are just artifacts of vl.c being split up.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

5989020b 10/27/2009 07:28 pm Kusanagi Kouichi

Add chardev option to disable signal.

If I am using vga and serial which is stdio and hit C-c on
serial console, qemu terminates. That is annoying for me.
So make it configurable whether signal is generated when C-c is hit.

Signed-off-by: Kusanagi Kouichi <>...

69795d67 10/21/2009 09:35 pm Amit Shah

char: check for initial_reset_issued unnecessary

At init, qemu_chr_reset is always called with initial_reset_issued set to 1.
So checking for it to be set is not necessary.

Patchworks-ID: 35286
Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

b6b8df56 10/21/2009 09:35 pm Amit Shah

char: rename CHR_EVENT_RESET to CHR_EVENT_OPENED

The char event RESET is emitted when a char device is opened.
Give it a better name.

Patchworks-ID: 35287
Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

6cfa64de 10/21/2009 09:35 pm Amit Shah

char: emit the OPENED event only when a new char connection is opened

The OPENED event gets sent also when qemu resets its state initially.
The consumers of the event aren't interested in receiving this event
on reset.

Patchworks-ID: 35288
Signed-off-by: Amit Shah <>...

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...

d6c983cd 09/11/2009 06:19 pm Gerd Hoffmann

convert windows console chardev to QemuOpts.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

48b76496 09/11/2009 06:19 pm Gerd Hoffmann

convert tty + parport chardevs to QemuOpts.

new cmd line syntax:
-chardev tty,id=name,path=/dev/tty*
-chardev parport,id=name,path=/dev/parport*

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

6ea314d9 09/11/2009 06:19 pm Gerd Hoffmann

convert vc chardev to QemuOpts.

new cmd line syntax:
-chardev vc,id=name
-chardev vc,id=name,width=pixels,height=pixels
-chardev vc,id=name,cols=chars,rows=chars

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

7591c5c1 09/11/2009 06:19 pm Gerd Hoffmann

convert mux chardev to QemuOpts.

new cmd line syntax: you can add mux=1 to any chardev to enable muxing,
then attach it multiple times, like this:

-chardev pty,name=mux,mux=on

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

7e1b35b4 09/11/2009 06:19 pm Gerd Hoffmann

convert udp chardev to QemuOpts.

While being at it: create a new inet_dgram_opts() function for udp setup,
so udp can handle IPv6 now.

new cmd line syntax:
-chardev udp,id=name,host=remotehost,port=remoteport,\
localaddr=bindaddr,localport=bindport...

c845f401 09/11/2009 06:19 pm Gerd Hoffmann

Allow -serial chardev:<name>

Lets put -chardev into use now. With this patch applied chardev:name is
accepted as chardev specification everywhere, i.e. now you can:

-chardev stdio,id=ttyS0
-serial chardev:ttyS0

which does the same as '-serial stdio"....

a7aec5da 09/11/2009 06:19 pm Gerd Hoffmann

monitor: fix muxing

make the mux driver send mux_in and mux_out events when switching
focus while hooking up more handlers.

stop using CharDriverState->focus in monitor.c, track state using
the mux events instead. This also removes the implicit assumtion...

799f1f23 09/11/2009 06:19 pm Gerd Hoffmann

move mux focus field from CharDriverState to MuxDriver

Now that monitor stopped using focus we can make it internal
to the mux driver.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

aeb2c47a 09/11/2009 06:19 pm Gerd Hoffmann

convert unix+tcp chardevs to QemuOpts.

new cmd line syntax:
unix socket:
-chardev socket,id=name,path=/path/to/socket
tcp socket:
-chardev socket,id=name,host=hostaddr|ipaddr,port=portnr

server and nowait options work as usual. Alternatively you can use...

4490dadf 09/11/2009 06:19 pm Gerd Hoffmann

convert pty chardev to QemuOpts.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

3c17affb 09/11/2009 06:19 pm Gerd Hoffmann

convert stdio chardev to QemuOpts.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

f0457e8d 09/11/2009 06:19 pm Gerd Hoffmann

convert msmouse chardev to QemuOpts.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

dc1c21e6 09/11/2009 06:19 pm Gerd Hoffmann

convert braille chardev to QemuOpts.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

191bc01b 09/11/2009 06:19 pm Gerd Hoffmann

switch chardev to QemuOpts: infrastructure, null device

start switching chardevs to QemuOpts. This patch adds the
infrastructure and converts the null device.

The patch brings two new functions:

qemu_chr_open_opts()
same as qemu_chr_open(), but uses QemuOpts instead of a...

7d31544f 09/11/2009 06:19 pm Gerd Hoffmann

convert file+pipe chardevs to QemuOpts.

new cmd line syntax:
-chardev file,id=name,path=/path/to/file
-chardev pipe,id=name,path=/path/to/pipe

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

793cbfb5 08/24/2009 04:21 pm Amit Shah

char: Emit 'CLOSED' events on char device close

Notify users of the char interface whenever the file / connection is
closed.

Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

7cba04f6 08/01/2009 01:13 pm Blue Swirl

More NULL pointer fixes

Signed-off-by: Blue Swirl <>

73bcc2ac 07/27/2009 10:55 pm Anthony Liguori

Fix typo WIN32 -> _WIN32

This was spotted by Juan Quintela

Signed-off-by: Anthony Liguori <>

71e72a19 07/27/2009 10:09 pm Juan Quintela

rename HOST_BSD to CONFIG_BSD

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

751c6a17 07/27/2009 10:08 pm Gerd Hoffmann

kill drives_table

First step cleaning up the drives handling. This one does nothing but
removing drives_table[], still it became seriously big.

drive_get_index() is gone and is replaced by drives_get() which hands
out DriveInfo pointers instead of a table index. This needs adaption in...

7d174059 07/27/2009 04:39 pm Mark McLoughlin

Add SCM_RIGHTS support to unix socket character devices

If a file descriptor is passed via a message with SCM_RIGHTS ancillary
data on a unix socket, store the file descriptor for use in the
chr_read() handler. Close the file descriptor if it was not used....

9977c894 07/27/2009 04:39 pm Mark McLoughlin

Make tcp_chr_read() use recvmsg()

Split out tcp_chr_recv() out of tcp_chr_read() and implement it on
non-win32 using recvmsg(). This is needed for a subsequent patch
which implements SCM_RIGHTS support.

Signed-off-by: Mark McLoughlin <>...

2d22959d 06/16/2009 11:18 pm Jan Kiszka

mux-term: Localize timestamps

As we can have multiple multiplexed terminals, timestamp control and
tracking should better take place per MuxDriver.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

4ab312f7 06/16/2009 11:18 pm Jan Kiszka

mux-term: Fix timestamp association

So far a new timestamp was generated after a full line had been
printed. Fix this.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

70503264 06/13/2009 02:22 pm Stefan Weil

Win32: Don't remove const attribute in type casts.

Type casts removing the const attribute are bad because
they hide the fact that the argument remains const.

They also result in a compiler warning (at least with MS-C).

Signed-off-by: Stefan Weil <>

c5b76b38 06/13/2009 11:44 am Blue Swirl

Fix mingw32 build warnings

Work around buffer and ioctlsocket argument type signedness problems
Suppress a prototype which is unused on mingw32
Expand a macro to avoid warnings from some GCC versions

Signed-off-by: Blue Swirl <>

993fbfdb 05/22/2009 04:54 am Anthony Liguori

Refactor how display drivers are selected

My previous commit, f92f8afebe, broke -vnc (spotted by Glauber Costa). This
is because it's necessary to tell when the no special display parameters have
been passed and default to SDL or VNC appropriately.

This refactors the display selection logic to be less complicated which has...

3f4cb3d3 04/13/2009 07:31 pm blueswir1

Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162

819f56b7 03/28/2009 07:58 pm aliguori

char: Fix closing of various char devices (Jan Kiszka)

This patch fixes several issues around closing char devices. Affected
were pty (timer was left behind, even running), udp (no close handling
at all) and tcp (missing async IO handler cleanup). The bugs either...

179a2c19 03/08/2009 10:23 am blueswir1

Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configure

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162

c5e97233 03/07/2009 10:06 pm blueswir1

Support for DragonFly BSD (Hasso Tepper)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162

cde76ee1 03/06/2009 01:01 am aliguori

monitor: Introduce MONITOR_USE_READLINE flag (Jan Kiszka)

This allows to create monitor terminals that do not make use of the
interactive readline back-end but rather send complete commands. The
pass-through monitor interface of the gdbstub will be an example....

2724b180 03/06/2009 01:01 am aliguori

monitor: Improve mux'ed console experience (Jan Kiszka)

Up to now, you never really knew if you already switched the console
after pressing CTRL-A C or if you mistyped it again. This patch
clarifies the situation by providing a prompt in a new line and
injecting a linebreak when switching away again. For this purpose, the...

731b0364 03/06/2009 01:01 am aliguori

monitor: Decouple terminals (Jan Kiszka)

Currently all registered (and activate) monitor terminals work in
broadcast mode: Everyone sees what someone else types on some other
terminal and what the monitor reports back. This model is broken when
you have a management monitor terminal that is automatically operated...

bb806047 03/06/2009 01:01 am aliguori

monitor: Drop banner hiding (Jan Kiszka)

There is no use for the hide/show banner option, and it is applied
inconsistently anyway (or what makes the difference between
-serial mon:stdio and -nographic for the monitor?). So drop this mode.

Signed-off-by: Jan Kiszka <>...

376253ec 03/06/2009 01:01 am aliguori

monitor: Rework API (Jan Kiszka)

Refactor the monitor API and prepare it for decoupled terminals:
term_print functions are renamed to monitor_* and all monitor services
gain a new parameter (mon) that will once refer to the monitor instance
the output is supposed to appear on. However, the argument remains...

a80bf99f 03/06/2009 01:00 am aliguori

char-mux: Use separate input buffers (Jan Kiszka)

Currently, the intermediate input buffer of mux'ed character devices
records data across all sub-devices. This has the side effect that we
easily leak data recorded over one sub-devices to another once we switch...

2970a6c9 03/06/2009 12:59 am aliguori

char: Fix initial reset (Jan Kiszka)

Recent changes to the graphical console initialization broke the initial
CHR_EVENT_RESET distribution. The reset BHs generated on char device
initialization are now already consumed during machine init (ide init
... -> qemu_aio_wait -> qemu_bh_poll). Therefore, this patch moves the...

84694dd2 02/09/2009 10:09 pm aurel32

qemu_chr_open_tcp: allow ipv4 and ipv6 options

Those new options are parsed in qemu-sockets.c. Allow them instead of
printing "Unknown option".

Signed-off-by: Sebastian Herbszt <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6584 c046a42c-6fe2-441c-8c8c-71466251a162

aa71cf80 02/08/2009 05:53 pm aurel32

QEMU Microsoft serial mouse emulation

Adds "msmouse" character device, which emulates a serial mouse.
Use it with -serial msmouse.

Signed-Off-By: Lubomir Rintel <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6559 c046a42c-6fe2-441c-8c8c-71466251a162

b4abdfa4 02/08/2009 04:46 pm aurel32

fix use of host serial port

Signed-off-by: David Ahern <>
Acked-by: Stefano Stabellini <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6556 c046a42c-6fe2-441c-8c8c-71466251a162

1eec614b 02/06/2009 12:06 am aliguori

toplevel: remove error handling from qemu_malloc() callers (Avi Kivity)

Signed-off-by: Avi Kivity <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162

a4bb1db8 01/22/2009 07:15 pm aliguori

monitor-mux: fix timestamp prefixes (Jan Kiszka)

rt_clock returns milliseconds. Fix mux'ed monitor terminal timestamps
accordingly.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6399 c046a42c-6fe2-441c-8c8c-71466251a162

ceecf1d1 01/18/2009 04:08 pm aurel32

add an init function parameter to qemu_chr_open()

And use it for the malta emulation. Fix segfault introduced in
revision 6352.

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162

2796dae0 01/16/2009 10:23 pm aliguori

Fix character devices after DisplayState refactoring

The DisplayState refactoring changed the machine init function to create a
DisplayState for each VGA device instead of being passed an existing
DisplayState. This change is critical to enable multiple graphics device...

3023f332 01/16/2009 09:04 pm aliguori

graphical_console_init change (Stefano Stabellini)

Patch 5/7

This patch changes the graphical_console_init function to return an
allocated DisplayState instead of a QEMUConsole.

This patch contains just the graphical_console_init change and few other
modifications mainly in console.c and vl.c....

00766a4e 01/14/2009 08:08 pm blueswir1

Make OpenBSD sparc-softmmu compile warning free

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6299 c046a42c-6fe2-441c-8c8c-71466251a162

f9487cb9 11/30/2008 06:25 pm aurel32

Fix warning from sparse

Remove unnecessary declaration for errno (this fixes a warning from sparse)

Signed-off-by: Stefan Weil <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5833 c046a42c-6fe2-441c-8c8c-71466251a162

6972f935 11/22/2008 10:49 pm blueswir1

Native FreeBSD parallel port (Juergen Lock)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5779 c046a42c-6fe2-441c-8c8c-71466251a162

c3b972c3 11/12/2008 05:00 pm aliguori

fix some variable initizalization issues (Stefano Stabellini)

this patch fixes two variable initialization issues.

Signed-off-by: Stefano Stabellini <>
Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5705 c046a42c-6fe2-441c-8c8c-71466251a162

f07b6003 11/11/2008 10:54 pm aliguori

sockets: switch over tcp/telnet/unix serial line to new helper functions (Gerd Hoffman)

This switches the tcp, telnet and unix socket support for character
devices (serial/parallel, ...) to the new socket helpers. Thereby they
gain IPv6 support and also get ability to search for a free tcp port....

d247d25f 11/11/2008 10:46 pm aliguori

sockets: helper functions for qemu (Gerd Hoffman)

This patch creates a new source file qemu-sockets.c with a bunch of
helper functions to create listening and connected sockets.

New features of this code are (a) support for searching for a free
port in a given range and (b) support for IPv6....

24646c7e 11/07/2008 06:55 pm blueswir1

Fix some build issues for BSD.

Signed-off-by: Christoph Egger <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5646 c046a42c-6fe2-441c-8c8c-71466251a162

cf3ebac7 11/01/2008 02:53 am aurel32

qemu-char: include hw/baum.h

Fix a warning introduced in r5580 when brlapi is enabled.

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5584 c046a42c-6fe2-441c-8c8c-71466251a162

b643146d 10/31/2008 10:00 pm aliguori

Remove extraneous inline keyword.

Spotted by Blue Swirl.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5582 c046a42c-6fe2-441c-8c8c-71466251a162

6f97dba0 10/31/2008 08:49 pm aliguori

Move CharDriverState code out of vl.c

The motivating goal behind this is to allow other tools to use the CharDriver
code. This patch is pure code motion except for the Makefile changes and the
copyright/header in qemu-char.c.

Signed-off-by: Anthony Liguori <>...