Commit Graph

294 Commits

Author SHA1 Message Date
Alon Levy
ec0b90db7f server/inputs_channel: better protection from channel disconnection on keyboard modifiers callback 2010-12-07 21:32:34 +02:00
Alon Levy
1540a64030 server/red_channel: add red_channel_is_connected 2010-12-07 21:32:34 +02:00
Alon Levy
045be6b03a server/inputs_channel: remove unused declaration in inputs_channel.h 2010-12-07 21:32:34 +02:00
Alon Levy
6dfff7b0a5 server/inputs_channel: s/inputs_channel/g_inputs_channel/ 2010-12-07 21:32:34 +02:00
Alon Levy
86a4a0780d server/inputs_channel: initialize inputs_channel to NULL 2010-12-07 21:32:33 +02:00
Alon Levy
5e13eea73c server: reds/inputs_channel: move some structs to inputs_channel 2010-12-07 21:32:33 +02:00
Alon Levy
e662e6a59f server: inputs_channel: use red_channel 2010-12-07 21:32:33 +02:00
Alon Levy
23db8c093c server: red_channel: add optional parser and separate incoming/outgoing error handlers for later inputs/main channel usage 2010-12-07 21:32:33 +02:00
Alon Levy
5ada644f30 server: inputs_channel: s/inputs_state/inputs_channel/ 2010-12-07 21:32:33 +02:00
Alon Levy
347e32177c server: introduce inputs_channel, split from reds.c 2010-12-07 21:32:33 +02:00
Alon Levy
26c40c4196 server/reds: fix typo 2010-12-07 21:32:33 +02:00
Alon Levy
7e0a1dfa75 smartcard: configure option --enable-smartcard 2010-12-07 13:31:44 +02:00
Alon Levy
d99ec6c35b smartcard: server side (not enabled yet) 2010-12-07 13:31:42 +02:00
Alon Levy
7461ee17cf server: add spice_server_char_device_remove_interface 2010-12-07 13:31:28 +02:00
Alon Levy
5220e0a706 server: print subtype when adding CHAR_DEVICE interfaces 2010-12-06 18:09:15 +02:00
Alon Levy
0ac9ca51f4 server: add static to spice_server_char_device_add_interface 2010-12-06 18:09:15 +02:00
Alon Levy
b2f1b80a63 server: fix print text on vdagent interface addition 2010-12-06 18:09:14 +02:00
Alon Levy
673ade8a6f server: add char_device.h header, use in reds.c 2010-12-06 18:09:14 +02:00
Alon Levy
14f2b0f52a spice-experimental.h: add multiple include protection 2010-12-06 18:09:14 +02:00
Alon Levy
dc8946f9f4 server/vdi_port (virtserial): always read data
We erronously ignored data from guest on the serial channel if no client is
connected. This leads to an assert when the guest writes a second time, since
there is still data unconsumed by us (the host).
Fix by reading data anyway, and discarding it after parsing (and reading) whole
messages from the guest.
Net affect is that any messages the agent sends while no client is connected
get discarded, but only full messages are discarded.
This fixes an abort if booting a winxp guest with vdagent without a connected
client.
2010-12-06 13:20:14 +02:00
Alon Levy
3eac546309 server: add char_device.h to Makefile.am for make dist 2010-12-02 17:17:11 +02:00
Alon Levy
9002d3f005 server/tests: add test_display_no_ssl
updates taken from spice vga mode updates, i.e. non cacheable, glz compressed
(depends on whatever settings you apply to the server) opaque draw operations.
 + completed the SpiceCoreInterface implementation (timers)

v1->v2:
 removed test_util.c (Hans)
 replaced mallocz with calloc (Hans)
2010-11-30 21:03:14 +02:00
Alon Levy
74b39efd6e server/tests: Makefile.am fixes
* don't install tests on make install
 * don't forget anything for make dist tarball
2010-11-30 21:01:06 +02:00
Alon Levy
eb79d1e568 add .gitignore for tests 2010-11-30 20:54:49 +02:00
Alon Levy
b6e530f5f3 server/reds: zap unsetting of QEMU_AUDIO_DRV 2010-11-08 17:53:17 +02:00
Alon Levy
6f9ab51509 gitignore: add generated_*, vim temps, pyc 2010-11-08 16:06:55 +02:00
Alon Levy
bd30095c75 reds: remove needless buffer in InputsState 2010-11-08 16:06:49 +02:00
Alon Levy
0ede43e893 server: tests: add basic tests with working do nothing server 2010-11-08 16:04:27 +02:00
Hans de Goede
023d9c0d91 Release 0.6.3 2010-10-18 14:52:43 +02:00
Hans de Goede
bbc079955a Bump version to 0.6.2 2010-10-18 11:22:19 +02:00
Hans de Goede
21f586762f server: remove useless agent send_tokens
We are keeping track of tokens for sending agent data to the client, but
the client send an initial value of ~0, and never gives us new send tokens
so this is all rather useless -> remove it.

Note that it is kept in the migration data struct for compatibility reasons.
2010-10-16 15:46:50 +02:00
Hans de Goede
0b2336cd9c Call read_from_vdi_port() from vdi_read_buf_release()
read_from_vdi_port(), called from vdagent_char_device_wakeup() may
fail to consume all data because no buffers are available in the
read_bufs ring. When this happens we would fail to ever read more data
from the agent on the guest as the port is throttled and stays throttled
until we've consumed all data from the current buffer.

This patch re-enables the call to read_from_vdi_port() from
vdi_read_buf_release(), so that we will try the read again when space
becomes available in the read_bufs ring.

Together with another nasty hack in the linux guest virtio_console
driver, where it waits for a write to be acked by the host before
continuing with the next one, this can lead to a linux guest
getting stuck / hang (until the write is read by the spice-server
which never happens becaus of the above issues).

Note that even with this patch, the guest will still gets stuck due to
a bug in watch_update_mask in spice-core in qemu, which causes writing
to the client to never resume once it blocked. A patch for this has been
submitted to qemu.
2010-10-15 10:22:37 +02:00
Hans de Goede
a52324525d server: always call read_from_vdi_port() in a while loop
read_from_vdi_port() MUST always be called in a while loop until it returns 0.

This is needed because it can cause new data available events and its
recursion protection causes those to get lost. Calling it until it returns 0
ensures that all data has been consumed.

Example scenario where we can fail to read the available data otherwise:
- server/reds.c: vdagent_char_device_wakeup get called
  by hw/spice-vmc.c because data has arrived from the guest,
- hw/spice-vmc.c: vmc_read get calls
- If the vmc_read call depletes the current buffer it calls
  virtio_serial_throttle_port(&svc->port, false)
- This causes vmc_have_data to get called, which if in the
  mean time another buffer has arrived causes
  vdagent_char_device_wakeup to gets called again
  (so recursively)
- vdagent_char_device_wakeup is protected against recursive
  calling and ignores the second call (a nasty hack)
- if no other data arrives, the arrived data will not get read
2010-10-15 10:22:37 +02:00
Hans de Goede
d37adccfa7 Don't crash when a client disconnects while there were pending writes 2010-10-15 10:22:37 +02:00
Gerd Hoffmann
97f33fa86a server: add channel notifications.
This patch adds a channel event callback to the spice core interface.
This new callback will be called for three events:

  (1) A new connection has been established.
  (2) The channel is ready (i.e. authentication is done,
      link message verification passed all tests, channel
      is ready to use).
  (3) Channel was disconnected.

Qemu will use this to send notifications to the management app.
2010-10-12 11:11:26 +02:00
Alexander Larsson
587584a4e4 server: Handle self_image in localize_bitmap
When drawing a drawable with a NULL src bitmap that means we should
be using the previously generated self_bitmap. Not doing this causes
a segfault due to accessing the NULL.
2010-09-21 20:14:50 +02:00
Alexander Larsson
485ba90b03 server: Handle NULL image in red_update_streamable
A NULL src bitmap means self_bitmap, which is not a stream, so abort.
2010-09-21 20:12:51 +02:00
Alexander Larsson
763e05ee30 server: Use the right image size for self_bitmap
The self_bitmap is the size of self_bitmap_area, not the bbox.
This is especially important since we later copy the self_bitmap_area
into the new bitmap, and if that is larger than bbox then we will
overwrite random memory.
2010-09-21 20:11:18 +02:00
Alexander Larsson
5322d43146 server: Don't leak QUIC image chunks
red_put_image() needs to free the chunks for QUIC images, as we
allocate these when creating the image.
2010-09-21 20:09:59 +02:00
Alexander Larsson
a5ce2c0edb server: Ensure we flush the release pipe after an oom
We really need to flush the ring to ensure that we push something on the
release ring. If we don't do this and the ring is not pushed for other
reasons we will timeout in the guest driver waiting for the ring.
2010-09-20 13:30:01 +02:00
Alexander Larsson
2f76d8e974 Release more drawables on OOM
We've changed how resources are released so they are now being
freed continuosly, rather than on OOM, since we want to free as early
possible to avoid fragmentation. So, OOM situations should be a bit
less common now and signify a real memory shortage, so we should try
to free up more resources.
2010-09-20 13:30:01 +02:00
Gerd Hoffmann
69bad628cc fix palette handling for 0.4 compat
spice 0.4 guests pass 16bpp palette colors when running in
a 16bpp video mode.  Convert them to 32bpp.
2010-09-14 10:44:22 +02:00
Gerd Hoffmann
f7aa863d54 fix brush handling for 0.4 compat
spice 0.4 guests pass 16bpp colors for brushes when running in
a 16bpp video mode.  Convert them to 32bpp.
2010-09-14 10:43:16 +02:00
Gerd Hoffmann
4207c49fe2 move command flags handling to the qxl parser
Pass through command flags to the qxl parser, so we can hide all
compat bits for spice 0.4 within the qxl parser.
2010-09-14 10:41:49 +02:00
Yonit Halperin
039700a90f server: avoid creating a stream from traces more than once for the same drawable
could have caused ASSERT(!drawable->stream) in red_create_stream
2010-09-02 18:45:09 +02:00
Alexander Larsson
0c6d654c2f Add API to turn on backwards compatibility mode
When upgrading a cluster of machines you typically do this by
upgrading a set of machines at a time, making the new machines run
the new software version, but in a fashion compatible with the old
versions (in terms of e.g. migration). Then when all machines are
upgrades, any new features in the new version can be enabled.

This API allows qemu to limit the set of features that spice uses to
those compatible with an older version, in order to do an upgrade like
this. Right now it doesn't really do much, since we don't keep compat
with 0.4.0 atm (although that may be added later).

There is no guarantee that any future version of spice support
being compatible with any previous version. However, we will always
support compatibility with the previous major version so that clusters
can be upgraded step by step.
2010-09-02 10:22:41 +02:00
Gerd Hoffmann
3ce690d58d qxl parser: complete parsing of QXLCompatDrawable structs 2010-08-31 13:17:15 +02:00
Yonit Halperin
8bc4fe0344 server: red_current_add_equal - don't push a drawable to the middle of the pipe if it depends on surfaces.
This will prevent: 1) rendering problems (commands sent to the client in the wrong order)
2) sending commands for surfaces that haven't been created yet on the client side.
2010-08-31 13:26:46 +03:00
Alon Levy
5b441c9bc5 server: when woken up by data ready to be read, don't call write.
This used to be a callback for the vdi_port "data ready" interrupt,
which did indicate either data ready to read or data ready to write, but
this is no longer the case now that virtio-serial is used.

This seemingly simple fix prevents a race that needs to be fixed with
another patch, see freedesktop bz #29903
2010-08-31 12:47:29 +03:00
Alon Levy
4ef938f2b0 server: retry mouse send on queue full 2010-08-31 12:43:31 +03:00