Statistics
| Branch: | Revision:

root / spice-qemu-char.c @ 34b5d2c6

History | View | Annotate | Download (8.8 kB)

# Date Author Comment
bd5c51ee 06/10/2013 07:38 pm Michael Roth

qemu-char: don't issue CHR_EVENT_OPEN in a BH

When CHR_EVENT_OPENED was initially added, it was CHR_EVENT_RESET,
and it was issued as a bottom-half:

86e94dea5b740dad65446c857f6959eae43e0ba6

Which we basically used to print out a greeting/prompt for the...

52fe0e75 04/16/2013 12:52 pm Hans de Goede

spice-qemu-char: Remove #ifdef-ed code for old spice-server compat

We now require spice-server to be >= 0.12.0 so this is no longer needed.

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

ae893e5e 04/16/2013 12:52 pm Hans de Goede

spice-qemu-char: Add watch support

Signed-off-by: Hans de Goede <>
Signed-off-by: Gerd Hoffmann <>

b010cec8 04/16/2013 12:52 pm Alon Levy

spice-qemu-char: Remove intermediate buffer

virtio-serial's buffer is valid when it calls us, and we don't
access it otherwise: vmc_read is only called in response to wakeup,
or else we set datalen=0 and throttle. Then vmc_read is called back,
we return 0 (not accessing the buffer) and set the timer to unthrottle....

75c439bc 04/16/2013 12:52 pm Hans de Goede

spice-qemu-char: vmc_write: Don't write more bytes then we're asked too

This one took me eons to debug, but I've finally found it now, oh well.

The usage of the MIN macro in this line:
last_out = MIN);

Causes qemu_chr_be_can_write to be called twice, since the MIN macro...

dccfcd0e 04/15/2013 07:19 pm Paolo Bonzini

sysemu: avoid proliferation of include/ subdirectories

Signed-off-by: Paolo Bonzini <>

e280ff5e 03/27/2013 05:26 pm Hans de Goede

spice-qemu-char: Drop hackish vmc_register on spice_chr_write

Now that the core takes care of fe_open tracking we no longer need this hack.

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

574b711a 03/27/2013 05:26 pm Hans de Goede

qemu-char: Consolidate guest_close/guest_open into a set_fe_open callback

Signed-off-by: Hans de Goede <>
Message-id:
Signed-off-by: Anthony Liguori <>

16665b94 03/27/2013 05:26 pm Hans de Goede

qemu-char: Rename opened to be_open

Rename the opened variable to be_open to reflect that it contains the
opened state of the backend.

Signed-off-by: Hans de Goede <>
Message-id:
Signed-off-by: Anthony Liguori <>

5e9b473a 03/14/2013 10:46 am Hans de Goede

spice-qemu-char: Fix name parameter issues after qapi-ifying

The strings passed in through the qapi calls are dynamic memory, since
we want to have them stick around longer then just the call to
qemu_chr_open_spice_* we need to strdup them.

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

344bf1e9 03/14/2013 10:46 am Hans de Goede

spice-qemu-char: Remove dead debugging code

Since commit d62e5f7036a018b2ad09f17ebd481bd28953d783
"chardev: add spice support to qapi"

It is impossible to set the debug parameter, so all the dprintf calls
are essentially nops. Since we've not needed the debug parameter in ages this...

cd153e2a 03/13/2013 11:27 am Gerd Hoffmann

chardev: add spice support to qapi

This patch adds 'spicevmc' and 'spiceport' support to qapi and also
switches over the spice chardev initialization to the new qapi code
path.

26c60614 03/08/2013 09:57 pm Anthony Liguori

qemu-char: move spice registration to spice-qemu-char.c

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

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

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

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

077805fa 12/19/2012 09:29 am Paolo Bonzini

janitor: do not rely on indirect inclusions of or from qemu-char.h

Various header files rely on qemu-char.h including qemu-config.h or
main-loop.h, but they really do not need qemu-char.h at all (particularly
interesting is the case of the block layer!). Clean this up, and also...

07a54d70 12/17/2012 03:01 pm Marc-André Lureau

spice-qemu-char: write to chardev whatever amount it can read

The current code waits until the chardev can read MIN
But some chardev may never reach than amount, in fact some of them
will only ever accept write of 1. Fix the min computation and remove...

71b423f4 12/17/2012 03:01 pm Marc-André Lureau

spice-qemu-char: factor out CharDriverState creation

Make the CharDriverState creation code reusable by spicevmc port.

Signed-off-by: Gerd Hoffmann <>

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

7a5448ce 12/17/2012 03:01 pm Marc-André Lureau

spice-qemu-char: keep a list of spice chardev

Signed-off-by: Gerd Hoffmann <>

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

spice-qemu-char: register spicevmc ports during qemu_spice_init()

Do the delayed registration of spicevmc ports after Spice server is
initialized.

Signed-off-by: Gerd Hoffmann <>

4f5c0177 04/20/2012 03:14 pm Eduardo Elias Ferreira

spice-qemu-char.c: Show what name is unsupported

Signed-off-by: Eduardo Elias Ferreira <>
Signed-off-by: Stefan Hajnoczi <>

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....
f76e4c7f 11/29/2011 12:20 am Hans de Goede

spice-qemu-char: Generate chardev open/close events

Define a state callback and make that generate chardev open/close events when
called by the spice-server.

Notes:

1) For all but the newest spice-server versions (which have a fix for this)
the code ignores these events for a spicevmc with a subtype of vdagent, this...

7b6c7369 09/07/2011 10:20 am Peter Maydell

spice-qemu-char.c: Use correct printf format char for ssize_t

Use the correct printf format string character (%z) for ssize_t.
This fixes a compile failure on 32 bit Linux with spice enabled.

Signed-off-by: Peter Maydell <>
Signed-off-by: Gerd Hoffmann <>

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

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

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

35106c2d 06/06/2011 10:14 am Hans de Goede

spice-qemu-char: Fix flow control in client -> guest direction

In the old spice-vmc device we used to have:
last_out = virtio_serial_write(&svc->port, p, MIN);
if (last_out > 0)
...

Now in the chardev backend we have:
last_out = MIN;...

cd8f7df2 04/28/2011 08:32 am Hans de Goede

spice-chardev: listen to frontend guest open / close

Note the vmc_register_interface() in spice_chr_write is left in place
in case someone uses spice-chardev with a frontend which does not have
guest open / close notification.

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

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