Statistics
| Branch: | Revision:

root / qemu-char.c @ 992aeb8e

History | View | Annotate | Download (77.1 kB)

# Date Author Comment
4d454574 01/12/2013 06:17 pm Paolo Bonzini

qemu-option: move standard option definitions out of qemu-config.c

Signed-off-by: Paolo Bonzini <>

25bbf61e 01/03/2013 08:53 pm Gerd Hoffmann

pty: unbreak libvirt

Commit 586502189edf9fd0f89a83de96717a2ea826fdb0 breaks libvirt pty
support because it tried to figure the pts name from stderr output.

Fix this by moving the label to the end of the line, this way the
libvirt parser does still recognise the message. libvirt looks...

ab51b1d5 01/02/2013 09:32 pm Michael Tokarev

disallow -daemonize usage of stdio (curses display, -nographic, -serial stdio etc)

Curses display requires stdin/out to stay on the terminal,
so -daemonize makes no sense in this case. Instead of
leaving display uninitialized like is done since 995ee2bf469de6bb,...

58650218 12/23/2012 05:11 pm Lei Li

qemu-char: Inherit ptys and improve output from -serial pty

Changes since V1:
- Avoid crashing since qemu_opts_id() may return null on some
systems according to Markus's suggestion.

When controlling a qemu instance from another program, it's
hard to know which serial port or monitor device is redirected...

27dd7730 12/20/2012 01:15 am Anthony Liguori

Merge remote-tracking branch 'bonzini/header-dirs' into staging

  • bonzini/header-dirs: (45 commits)
    janitor: move remaining public headers to include/
    hw: move executable format header files to hw/
    fpu: move public header file to include/fpu
    softmmu: move remaining include files to include/ subdirectories...
927d4878 12/19/2012 09:32 am Paolo Bonzini

softmmu: move remaining include files to include/ subdirectories

Signed-off-by: Paolo Bonzini <>

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

Signed-off-by: Paolo Bonzini <>

28ecbaee 12/19/2012 09:31 am Paolo Bonzini

ui: move files to ui/ and include/ui/

Signed-off-by: Paolo Bonzini <>

7fa22f2b 12/19/2012 09:29 am Paolo Bonzini

net: do not include net.h everywhere

Signed-off-by: Paolo Bonzini <>

5a49d3e9 12/17/2012 03:01 pm Marc-André Lureau

spice-qemu-char: add spiceport chardev

Add a new spice chardev to allow arbitrary communication between the
host and the Spice client via the spice server.

Examples:

This allows the Spice client to have a special port for the qemu
monitor:

... -chardev spiceport,name=org.qemu.monitor,id=monitorport...

06dec083 11/24/2012 10:03 pm Jan Kiszka

chardev: Use real-time clock for open timer

The vm clock may be stopped, and then we won't get open events anymore.
Seen with QMP sessions.

Reported-by: Dietmar Maurer <>
Tested-by: Luiz Capitulino <>
Signed-off-by: Jan Kiszka <>...

ac4119c0 10/31/2012 11:20 pm Jan Kiszka

chardev: Use timer instead of bottom-half to postpone open event

As the block layer may decide to flush bottom-halfs while the machine is
still initializing (e.g. to read geometry data from the disk), our
postponed open event may be processed before the last frontend...

4f085c82 10/23/2012 02:54 pm Paolo Bonzini

qemu-sockets: add error propagation to inet_dgram_opts

Before:

$ qemu-system-x86_64 -monitor udp:localhost:631@localhost:631
inet_dgram_opts: bind(ipv4,127.0.0.1,631): OK
inet_dgram_opts failed
chardev: opening backend "udp" failed

After:...

87d5f24f 10/23/2012 02:54 pm Paolo Bonzini

qemu-char: ask and print error information from qemu-sockets

Before:

$ qemu-system-x86_64 -monitor tcp:localhost:6000
(starts despite error)
$ qemu-system-x86_64 -monitor tcp:foo.bar:12345
getaddrinfo(foo.bar,12345): Name or service not known...
7fc4e63e 10/23/2012 02:54 pm Paolo Bonzini

qemu-sockets: add Error ** to all functions

This lets me adjust the clients to do proper error propagation first,
thus avoiding temporary regressions in the quality of the error messages.

Reviewed-by: Luiz Capitulino <>
Signed-off-by: Paolo Bonzini <>

1fc05adf 10/23/2012 02:54 pm Paolo Bonzini

qemu-sockets: add nonblocking connect for Unix sockets

This patch mostly mimics what was done to TCP sockets, but simpler
because there is only one address to try. It also includes a free EINTR
bug fix.

Signed-off-by: Paolo Bonzini <>

233aa5c2 09/26/2012 03:05 am Orit Wasserman

Fix address handling in inet_nonblocking_connect

getaddrinfo can give us a list of addresses, but we only try to
connect to the first one. If that fails we never proceed to
the next one. This is common on desktop setups that often have ipv6
configured but not actually working....

5db5f44c 09/26/2012 03:05 am Orit Wasserman

Separate inet_connect into inet_connect (blocking) and inet_nonblocking_connect

No need to add non blocking parameters to the blocking inet_connect
add block parameter for inet_connect_opts instead of using QemuOpt "block".

Signed-off-by: Orit Wasserman <>...

6db0fdce 09/17/2012 06:18 pm Anthony Liguori

Revert 455aa1e08 and c3767ed0eb

commit c3767ed0eb5d0bb25fe409ae5dec06e3411ff1b6
qemu-char: (Re-)connect for tcp_chr_write() unconnected writing

Has no hope of working because tcp_chr_connect() does not actually connect.

455aa1e08 just fixes the SEGV with server() but the attempt to connect a client...

bbdd2ad0 09/17/2012 06:18 pm David Gibson

qemu-char: BUGFIX, don't call FD_ISSET with negative fd

tcp_chr_connect(), unlike for example udp_chr_update_read_handler() does
not check if the fd it is using is valid (>= 0) before passing it to
qemu_set_fd_handler2(). If using e.g. a TCP serial port, which is not...

455aa1e0 09/10/2012 06:57 pm Anthony Liguori

socket: don't attempt to reconnect a TCP socket in server mode

Commit c3767ed0eb5d0bb25fe409ae5dec06e3411ff1b6 introduced a possible SEGV when
using a socket chardev with server=on because it assumes that all TCP sockets
are in client mode.

This patch adds a check to only reconnect when in client mode....

c3767ed0 08/16/2012 09:41 pm Lei Li

qemu-char: (Re-)connect for tcp_chr_write() unconnected writing

tcp_chr_write() did not deal with writing to an unconnected
connection and return the original length of the data, it's
not right and would cause false writing. So (re-)connect it
and return 0 for this situation....

06138651 08/15/2012 11:48 am Corey Bryant

qemu-char: Add MSG_CMSG_CLOEXEC flag to recvmsg

Set the close-on-exec flag for the file descriptor received
via SCM_RIGHTS.

Signed-off-by: Corey Bryant <>
Signed-off-by: Kevin Wolf <>

02a08fef 08/13/2012 07:20 pm Luiz Capitulino

net: inet_connect(), inet_connect_opts(): add in_progress argument

It's used to indicate the special case where a valid file-descriptor
is returned (ie. success) but the connection can't be completed
w/o blocking.

This is needed because QERR_SOCKET_CONNECT_IN_PROGRESS is not...

3294ce18 06/09/2012 01:30 pm Michael Tokarev

do not include <libutil.h> needlessly or if it doesn't exist

<libutil.h> and <util.h> on *BSD (some have one, some another)
were #included just for openpty() declaration. The only file
where this function is actually used is qemu-char.c.

In vl.c and net/tap-bsd.c, none of functions declared in libutil.h...

8be7e7e4 06/04/2012 07:49 pm Luiz Capitulino

qemu-option: qemu_opts_create(): use error_set()

This commit converts qemu_opts_create() from qerror_report() to
error_set().

Currently, most calls to qemu_opts_create() can't fail, so most
callers don't need any changes.

The two cases where code checks for qemu_opts_create() erros are:...

a6ba35b3 05/10/2012 08:37 pm Amos Kong

sockets: change inet_connect() to support nonblock socket

Add a bool argument to inet_connect() to assign if set socket
to block/nonblock, and delete original argument 'socktype'
that is unused.
Add a new argument to inet_connect()/inet_connect_opts(),
to pass back connect error by error class....

029409e5 05/10/2012 08:37 pm Amos Kong

sockets: use error class to pass listen error

Add a new argument in inet_listen()/inet_listen_opts()
to pass back listen error.

Change nbd, qemu-char, vnc to use new interface.

Signed-off-by: Amos Kong <>
Reviewed-by: Orit Wasserman <>...

ac310734 04/24/2012 05:50 pm Stefan Weil

qemu-char: Fix crash when switching consoles

qemu-system-arm (and other system emulations) crashes with SDL when
the user switches consoles (Alt-Ctrl-F4).

We already check for NULL pointers in qemu_chr_fe_ioctl,
qemu_chr_be_can_write and other functions, so do this also...

98c8ee1d 04/16/2012 04:41 pm Jan Kiszka

Kick io-thread on qemu_chr_accept_input

Once a chr frontend is able to receive input again, we need to inform
the io-thread about this fact. Otherwise, main_loop_wait may continue to
select without the related backend file descriptor in its set. This can...

b181e047 02/24/2012 05:06 pm Markus Armbruster

qemu-char: Use qemu_open() to avoid leaking fds to children

Fixed silently in commit aad04cd0, but that just got reverted.
Re-apply the fixes, plus one missed instance: parport on Linux.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Markus Armbruster <>...

a89dd6c3 02/24/2012 05:06 pm Markus Armbruster

qemu-char: Re-apply style fixes from just reverted aad04cd0

Reviewed-by: Anthony Liguori <>
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

d7378ee1 02/24/2012 05:06 pm Markus Armbruster

qemu-char: qemu_chr_open_fd() can't fail, don't check

Cleaned up silently in commit aad04cd0, but that just got reverted.
Re-apply this part.

Reviewed-by: Anthony Liguori <>
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

1f51470d 02/24/2012 05:06 pm Markus Armbruster

Revert "qemu-char: Print strerror message on failure" and deps

The commit's purpose is laudable:

The only way for chardev drivers to communicate an error was to
return a NULL pointer, which resulted in an error message that
said that something went wrong, but not why....
0beb4942 02/03/2012 06:41 pm Anthony Liguori

qdev: nuke qdev_init_chardev()

I'm sure the intentions were good here, but there's no reason this should be in
qdev. Move it to qemu-char where it belongs.

Signed-off-by: Anthony Liguori <>

a425d23f 11/29/2011 12:20 am Hans de Goede

qemu-char: rename qemu_chr_event to qemu_chr_be_event and make it public

Rename qemu_chr_event to qemu_chr_be_event, since it is only to be
called by backends and make it public so that it can be used by chardev
code which lives outside of qemu-char.c

Signed-off-by: Hans de Goede <>...

a4e26048 11/11/2011 08:49 pm Markus Armbruster

qemu-char: Plug memory leak on qemu_chr_open_pty() error path

Spotted by Coverity.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

db418a0a 10/23/2011 06:44 pm Fabien Chouteau

Add stdio char device on windows

Simple implementation of an stdio char device on Windows.

Signed-off-by: Fabien Chouteau <>
Signed-off-by: Blue Swirl <>

2e02e18b 10/14/2011 04:38 pm Stefan Weil

qemu-char: Fix use of free() instead of g_free()

cppcheck reported these errors:

qemu-char.c:1667: error: Mismatching allocation and deallocation: s
qemu-char.c:1668: error: Mismatching allocation and deallocation: chr
qemu-char.c:1769: error: Mismatching allocation and deallocation: s...

c5a415a0 10/04/2011 05:02 pm Luiz Capitulino

qapi: Convert query-chardev

Reviewed-by: Michael Roth <>
Tested-by: Michael Roth <>
Signed-off-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

069c159e 09/23/2011 09:42 pm Marcelo Tosatti

qemu-char: use qemu_set_fd_handler/2 consistently

Now that qemu_set_fd_handler and qemu_set_fd_handler2 have different
implementations, one using qemu iohandlers and the other glib, it is not
safe to mix the two when inserting/deleting handlers.

Fixes kvm-autotest....

74c0d6f0 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_get_msgfd() -> qemu_chr_fe_get_msgfd()

Signed-off-by: Anthony Liguori <>

903396ad 08/22/2011 06:17 pm Anthony Liguori

char: remove qemu_chr_send_event()

It's dead code.

Signed-off-by: Anthony Liguori <>

27143a44 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_open() -> qemu_chr_new()

Signed-off-by: Anthony Liguori <>

f69554b9 08/22/2011 06:17 pm Anthony Liguori

char: qemu_chr_open_opts() -> qemu_chr_new_from_opts()

Signed-off-by: Anthony Liguori <>

70f24fb6 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_close() -> qemu_chr_delete()

Signed-off-by: Anthony Liguori <>

41084f1b 08/22/2011 06:17 pm Anthony Liguori

char: qemu_chr_ioctl() -> qemu_chr_fe_ioctl()

Signed-off-by: Anthony Liguori <>

15f31519 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_set_echo() -> qemu_chr_fe_set_echo()

Signed-off-by: Anthony Liguori <>

fa5efccb 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_read() -> qemu_chr_be_write()

Signed-off-by: Anthony Liguori <>

909cda12 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_can_read() -> qemu_chr_be_can_read()

Signed-off-by: Anthony Liguori <>

c9d830ed 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_guest_open() -> qemu_chr_fe_open()

Signed-off-by: Anthony Liguori <>

2817822d 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_guest_close() -> qemu_chr_fe_close()

Signed-off-by: Anthony Liguori <>

2cc6e0a1 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_write() -> qemu_chr_fe_write()

Signed-off-by: Anthony Liguori <>

e7e71b0e 08/22/2011 06:17 pm Anthony Liguori

char: rename qemu_chr_printf() -> qemu_chr_fe_printf()

Signed-off-by: Anthony Liguori <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

00aa0040 07/25/2011 05:38 pm Blue Swirl

Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
CC slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]...

aad04cd0 07/24/2011 05:48 pm Blue Swirl

Fix chrdev return value conversion

6e1db57b2ac9025c2443c665a0d9e78748637b26 didn't
convert brlapi or win32 chrdevs, breaking build for those.

Fix by converting the chrdevs.

Acked-by: Kevin Wolf <>
Signed-off-by: Blue Swirl <>

13661089 07/23/2011 07:19 pm Daniel P. Berrange

Introduce a 'client_add' monitor command accepting an open FD

Allow client connections for VNC and socket based character
devices to be passed in over the monitor using SCM_RIGHTS.

One intended usage scenario is to start QEMU with VNC on a
UNIX domain socket. An unprivileged user which cannot access...

6e1db57b 07/23/2011 07:18 pm Kevin Wolf

qemu-char: Print strerror message on failure

The only way for chardev drivers to communicate an error was to return a NULL
pointer, which resulted in an error message that said that something went
wrong, but not why.

This patch changes the interface to return 0/-errno and updates...

9bf0960a 06/08/2011 11:04 am Alexandre Raymond

Fix compilation warning due to missing header for sigaction (followup)

This patch removes all references to signal.h when qemu-common.h is included
as they become redundant.

Signed-off-by: Alexandre Raymond <>
Signed-off-by: Stefan Hajnoczi <>

da7d998b 04/28/2011 08:41 am Amit Shah

char: Detect chardev release by NULL handlers as well as NULL opaque

Juan says he prefers these extra checks to ensure a user of a chardev is
releasing it.

Requested-by: Juan Quintela <>
Signed-off-by: Amit Shah <>

d5b27167 04/28/2011 08:33 am Kusanagi Kouichi

char: Allow devices to use a single multiplexed chardev.

This fixes regression caused by commit
2d6c1ef40f3678ab47a4d14fb5dadaa486bfcda6
("char: Prevent multiple devices opening same chardev"):

-nodefaults -nographic -chardev stdio,id=stdio,mux=on,signal=off \...

7c32c4fe 04/28/2011 08:32 am Hans de Goede

chardev: Allow frontends to notify backends of guest open / close

Some frontends know when the guest has opened the "channel" and is actively
listening to it, for example virtio-serial. This patch adds 2 new qemu-chardev
functions which can be used by frontends to signal guest open / close, and...

56d7a964 03/24/2011 03:11 pm Anthony Liguori

Merge remote branch 'amit/for-anthony' into staging

2d6c1ef4 03/21/2011 01:27 pm Amit Shah

char: Prevent multiple devices opening same chardev

Prevent:

-chardev socket,path=/tmp/foo,server,nowait,id=c0 \
-device virtserialport,chardev=c0,id=vs0 \
-device virtserialport,chardev=c0,id=vs1

Reported-by: Mike Cao <>
Signed-off-by: Amit Shah <>

7bd427d8 03/21/2011 10:23 am Paolo Bonzini

change all rt_clock references to use millisecond resolution accessors

This was done with:

sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \
$(git grep -l 'get_clock\>.*rt_clock' )
sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
e0efb993 03/20/2011 11:39 pm Stefan Weil

Fix conversions from pointer to int and vice versa

Here the int values fds0, sigfd, s, sock and fd are converted
to void pointers which are later converted back to an int value.

These conversions should always use intptr_t instead of unsigned long.

They are needed for environments where sizeof(long) != sizeof(void *)....

1bbd185f 02/20/2011 07:26 pm Stefan Hajnoczi

qemu-char: Check for missing backend name

Check if the backend option is missing before searching the backend
table. This fixes a NULL pointer dereference when QEMU is invoked with
the following invalid command-line:

$ qemu -chardev id=foo,path=/tmp/socket...
363f8cb9 02/02/2011 12:50 am Paolo Bonzini

fix QemuOpts leak

Now that no backend's open function saves the passed QemuOpts, fix a leak
in the qemu_chr_open backwards-compatible parser.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

d55dbc3a 02/02/2011 12:50 am Paolo Bonzini

remove broken code for tty

This code is taking the settings for a serial port and moving it to
fd 0 when qemu exits. This is likely just cut-and-paste, rip it.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

c48855e1 02/02/2011 12:50 am Paolo Bonzini

add qemu_chr_set_echo

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

0369364b 02/02/2011 12:50 am Paolo Bonzini

move atexit(term_exit) and O_NONBLOCK to qemu_chr_open_stdio

In the next patch, term_init will be changed to enable or disable
echo at will. Move extraneous stuff out of it.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

bb002513 02/02/2011 12:50 am Paolo Bonzini

add set_echo implementation for qemu_chr_stdio

This also requires moving QemuOpts out of term_init.

Clearing ISIG is independent of whether echo is enabled or disabled.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

cbcc6336 01/24/2011 04:41 pm Alon Levy

spice: add chardev (v5)

Adding a chardev backend for spice, where spice determines what
to do with it based on the name attribute given during chardev creation.
For usage by spice vdagent in conjunction with a properly named
virtio-serial device, and future smartcard channel usage....

999bd67c 11/17/2010 01:52 pm Luiz Capitulino

qemu-char: Introduce Memory driver

This driver handles in-memory chardev operations. That's, all writes
to this driver are stored in an internal buffer and it doesn't talk
to the external world in any way.

Right now it's very simple: it supports only writes. But it can be...

5fc9cfed 11/03/2010 07:48 pm Jes Sorensen

Fold send_all() wrapper unix_write() into one function

The current send_all() wrapper for POSIX calls does nothing but call
unix_write(). Merge them to simplify the code.

Signed-off-by: Jes Sorensen <>
Signed-off-by: Anthony Liguori <>

3329f07b 08/23/2010 01:11 am Gerd Hoffmann

QemuOpts: make most qemu_*_opts static

Switch tree to lookup-by-name using qemu_find_opts().
Also hook up virtfs options so qemu_find_opts works for them too.

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

68c18d1c 08/15/2010 12:46 pm Blue Swirl

Fix mingw32 build

Don't define qemu_chr_open_eventfd() on Windows.

Signed-off-by: Blue Swirl <>

6cbf4c8c 08/11/2010 12:25 am Cam Macdonell

RESEND: Inter-VM shared memory PCI device

resend for bug fix related to removal of irqfd

Support an inter-vm shared memory device that maps a shared-memory object as a
PCI device in the guest. This patch also supports interrupts between guest by
communicating over a unix domain socket. This patch applies to the qemu-kvm...

6ab4b5ab 06/15/2010 10:41 am Markus Armbruster

block: Decouple block device "commit all" from DriveInfo

do_commit() and mux_proc_byte() iterate over the list of drives
defined with drive_init(). This misses host block devices defined by
other means. Such means don't exist now, but will be introduced later...

666daa68 06/04/2010 04:20 pm Markus Armbruster

blockdev: Collect block device code in new blockdev.c

Anything that moves hundreds of lines out of vl.c can't be all bad.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

637503d1 06/01/2010 09:48 pm Luiz Capitulino

Monitor: Drop QMP documentation from code

Previous commit added QMP documentation to the qemu-monitor.hx
file, it's is a copy of this information.

While it's good to keep it near code, maintaining two copies of
the same information is too hard and has little benefit as we...

e53f27b9 04/26/2010 10:36 pm Paolo Bonzini

stash away SCM_RIGHTS fd until a getfd command arrives

If there is already a fd in s->msgfd before recvmsg it is
closed by parts that this patch does not touch. So, only
one descriptor can be "leaked" by attaching it to a command
other than getfd.

Signed-off-by: Paolo Bonzini <>...

73cdf3f2 04/09/2010 11:03 pm Alexander Graf

Always notify consumers of char devices if they're open

When using virtio-console on s390, the input doesn't work.

The root of the problem is rather simple. What happens is the following:

1) create character device for stdio
2) char device is done creating, sends OPENED event...
cb301efe 04/08/2010 10:08 pm Riku Voipio

fix function signature of qemu_chr_open_pty on !linux

Signed-off-By: Riku Voipio <>
Signed-off-By: Juha Riihimäki <>
Signed-off-by: Aurelien Jarno <>

d3f822d2 03/31/2010 07:17 pm Shahar Havivi

Restore terminal monitor attributes - addition

Patch 2d753894c7553d6a05e8fdbed5f4704398919a35 was missing this check,
when running monitor as /dev/tty and other serial device, i.e:
qemu -monitor /dev/tty -serial /dev/pts/1

Without this patch any serial device will override the monitor stored...

d1839d73 03/30/2010 08:44 pm Juergen Lock

Fix some compilation warnings on FreeBSD hosts

Signed-off-by: Juergen Lock <>
Signed-off-by: Blue Swirl <>

28695489 03/21/2010 09:13 pm Anthony Liguori

Revert "Convert atexit users to exit_notifier"

This reverts commit d7234f4d7e373a708e1df9ab565a71b71b189025.

Conflicts:

hw/xen_machine_pv.c

This should have never been committed.

Signed-off-by: Anthony Liguori <>

d7234f4d 03/19/2010 10:27 pm Anthony Liguori

Convert atexit users to exit_notifier

All of these users have global state so we really don't see a benefit from
exit_notifier. However, using exit_notifier means that there's one less
justification for having global state in the first place.

Signed-off-by: Anthony Liguori <>

7b27a769 03/19/2010 10:27 pm Juan Quintela

rename IOCanRWHandler to IOCanReadHandler

It was always only used for reads

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

39324ca4 03/14/2010 11:43 pm Jan Kiszka

Fix corner case in chardev udp: parameter

The missing '' broke 'udp::<port>:<port>' parsing.

Signed-off-by: Jan Kiszka <>
Signed-off-by: Aurelien Jarno <>

2d753894 03/09/2010 04:47 pm Shahar Havivi

Restore terminal attributes for tty based monitor

Patch http://permalink.gmane.org/gmane.comp.emulators.qemu/63472 handle
close when using tty devices (like /dev/ttyS0),
yet tty based monitor are not restoring terminal attributes (as done
with stdio based monitor), when closing qemu after that command:...

5bb59902 02/28/2010 12:50 pm Jan Kiszka

qemu-char.c: drop debug printfs from qemu_chr_parse_compat

Signed-off-by: Jan Kiszka <>
Acked-by: Gerd Hoffmann <>
Signed-off-by: Aurelien Jarno <>

4266a134 02/23/2010 12:16 am David Ahern

add close callback for tty-based char device

v1 -> v2 coding style changes

Add a tty close callback. Right now if a guest device that is connected
to a tty-based chardev in the host is removed, the tty is not closed.
With this patch it is closed.

Example use case is connecting an emulated USB serial cable in the guest...

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 <>