Commit Graph

3713 Commits

Author SHA1 Message Date
Alon Levy
c78e951bff server/red_worker: remove forced disconnect on connect 2011-08-23 18:04:33 +03:00
Yonit Halperin
bed8c9d4f6 server/red_worker.c: fix CursorPipeItem leak
CursorPipeItems and their corresponding cursor_item were not
freed when they were removed from the pipe without sending them.
In addition cursor_channel_hold_pipe_item used wrong conversion
to (CursorItem*) for a (CursorPipeItem*).
2011-08-23 18:04:10 +03:00
Alon Levy
52bff67935 server/red_worker: split cursor pipe item from cursor item
Required to support multiple clients.
Also changes somewhat the way we produce PIPE_ITEM_TYPE_LOCAL_CURSOR. Btw,
I haven't managed to see when we actually produce such an item during my
tests.

Previously we had a single pipe item per CursorItem, this is impossible
with two pipes, which happens when we have two clients.
2011-08-23 18:03:47 +03:00
Alon Levy
24d8340b71 server/red_worker: whitespace fixes 2011-08-23 18:03:24 +03:00
Alon Levy
5117efcff7 server/reds: add RedsState.allow_multiple_clients
Currently set by environment variable SPICE_DEBUG_ALLOW_MC (any value means
to allow multiple connections). Later will be set by spice api from qemu.
2011-08-23 18:03:02 +03:00
Alon Levy
4db9f1d1a9 server/red_channel: introduce client ring in RedChannel
Also adds Drawable pipes and glz rings.

main_channel and red_worker had several locations that still accessed rcc
directly, so they had to be touched too, but the changes are minimal.

Most changes are in red_channel: drop the single client reference in RedChannel
and add a ring of channels.

Things missing / not done right in red_worker:
 * StreamAgents are in DCC - right/wrong?
 * GlzDict is multiplied - multiple compressions.

We still are missing:
 * remove the disconnect calls on new connections
2011-08-23 18:02:38 +03:00
Alon Levy
6a1d657373 server/red_channel: add pipe_size helpers 2011-08-23 18:02:14 +03:00
Alon Levy
9c192980e8 server/red_worker: remove more direct access to RedChannelClient.rcc 2011-08-23 18:01:51 +03:00
Yonit Halperin
d42575feab server/red_worker.c: make dictionary and cache different per client
There is no inter-client shared dictionary and cache yet.

At this point the display channel can be used by multiple clients.

You can still crash on lack of Drawables or CursorItems due to the slower
clients pipe growing uncontrollably.
2011-08-23 18:01:28 +03:00
Alon Levy
a32e90257e server/red_worker: multiple client support - base split
This patch compiles but breaks spice.

Split both display and cursor channels to a client part and channel part.

Introduce DisplayChannelClient, CursorChannelClient, CommonChannelClient.
don't disconnect channel on client disconnect.
Move all caches to the ChannelClient's.

Remove reference counting of the channel.

No new functionality introduced.

NOTE: Introduces a crash in disconnections, a regression, resulting from
incorrect thread access, that is fixed in the patch titled:
"server: registering RedChannel in reds, instead of Channel"
2011-08-23 18:01:04 +03:00
Alon Levy
406751888e server/red_worker: cleanup 2011-08-23 18:00:41 +03:00
Alon Levy
eded227f4c server/smartcard: support multiple clients
each client supplying a smartcard channel gets it's own smartcard. If
there are not enough smartcards provided by the server (read: qemu)
then it will be as though there are none.

currently disabled - later patches that enable smartcard don't make
this channel available to any but the first client.
2011-08-23 18:00:19 +03:00
Alon Levy
9aa62c4baa server/red_tunnel_worker: trivial multi client support
s/TunnelChannel/TunnelChannelClient/

That's about it.  this is probably the wrong way to do it. Not tested
at all. What do we want, a separate interface per client? same interface
for all clients? probably the later. This doesn't do that. Not tested,
so probably doesn't even work.

changes red_channel_pipe_item_is_linked to red_channel_client_pipe_item_is_linked,
since tunnel channel is the only user, must be done in patch to not break compilation.
2011-08-23 17:59:55 +03:00
Alon Levy
82524cec13 server/inputs_channel: support multiple clients
from server events are broadcast - leds change. The rest is client
to server, so it is just passed on.
2011-08-23 17:59:34 +03:00
Alon Levy
9cece23ba3 server/main_channel: support multiple clients
The main channel deals with connecting new clients, announcing mouse mode
changes, and the agent channel. The implementation is currently done without
any changes to the protocol, so everything has to be either broadcast or
to a specific client.

 channels list - specific client
 mouse mode - broadcast
 agent - broadcast
 notify - broadcast (should have two modes, and use the appropriate)

Notable TODOs:
 * migration testing
 * agent tokens are wrongly sent (or did I fix that? check)
2011-08-23 17:59:09 +03:00
Alon Levy
0f0bdb190b server/red_channel: introduce pipes functions
Introduce functions to add (via producer method) the same item to multiple
pipes, all for the same channel.

Note: Right now there is only a single channel, but the next patches will do the
per-channel breakdown to channel and channel_client before actually introducing
a ring in RedChannel, this makes it easier to make smaller changes - the
channel->rcc link will exist until removed in the ring introducing patch.
2011-08-23 17:58:46 +03:00
Alon Levy
03cf66383c server/red_channel: ignore error if already shutdown
on red_channel_peer_on_incoming_error, if we are already shutdown, do not
call the channel's error handler. Since the channel has been shutdown, we
assume this is a second or later error, and handling has already occured.
2011-08-23 17:58:24 +03:00
Alon Levy
4e304ff40f server/main_channel: move connection_id from reds
Expose additional api to find a client given a connection_id. The connection_id
is first set when the first channel connects, which is the main channel.
It could also be kept in the RedClient instead, not sure.

TODO:
 multiple todo's added for multiclient handling. I don't remember why
 I wrote them exactly, and besides if I did any migration tests. So: TODO.
2011-08-23 17:58:01 +03:00
Alon Levy
d65b08e12d server/main_channel: move ping here from reds.
cleanup only. Note that the ping function is half used since the opt parameter
stopped being called with anything but NULL, should be returned at some point,
specifically when we drop the 250kbyte ping on start and do a continuous check
for latency and bandwidth.

See:
 81945d897 - server: add new vd interface QTerm2Interface, Yaniv Kamay
  introducing the usage of ping with a non NULL opt
 3f7ea8e7a - zap qterm interfaces, Gerd Hoffman
  removing it
2011-08-23 17:57:37 +03:00
Alon Levy
5bcdf37997 server/main_channel: move latency and bitrate to channel client
They were globals before. This introduces api for other channels
to query the low bandwidth status. The queries themselves are still done
from the wrong context (channel and not channel client) but that's because
the decoupling of channel and channel client will be done in the following
patches.

Note that snd_worker.c got two copied function declarations that belong to
main_channel.h but can't be easily dragged into snd_worker.c since it still
uses it's own RedChannel struct.
2011-08-23 17:57:13 +03:00
Alon Levy
614df17193 server/reds: add concept of secondary channels
Secondary channels are those that don't support multiple clients. The
support added in this patch just doesn't let the second or more connected
client receive the unsupported channels in the channels list sent by the
server to the client. This doesn't handle the situation where:

client A connects (gets all channels)
client B connects (gets supported multiple client channels)
client A disconnects (Suboptimal 1: B doesn't get new channels at this point)
client C connects (Suboptimal 2: C doesn't get the full list of channels, but
the partial one)

Specifically the channels that only support a single client are:
 sound (both playback and record channels)
 smartcard
 tunnel
2011-08-23 17:56:46 +03:00
Alon Levy
448ed75bd6 server: Add RedClient
That means RedClient tracks a ring of channels. Right now there will be only
a single client because of the disconnection mechanism - whenever a new
client comes we disconnect all existing clients. But this patch adds already
a ring of clients to reds.c (stored in RedServer).

There is a known problem handling many connections and disconnections at the
same time, trigerrable easily by the following script:

export NEW_DISPLAY=:3.0

Xephyr $NEW_DISPLAY -noreset &
for ((i = 0 ; i < 5; ++i)); do
    for ((j = 0 ; j < 10; ++j)); do
        DISPLAY=$NEW_DISPLAY c_win7x86_qxl_tests &
    done
    sleep 2;
done

I fixed a few of the problems resulting from this in the same patch. This
required already introducing a few other changes:
 * make sure all removal of channels happens in the main thread, for that
 two additional dispatcher calls are added to remove a specific channel
 client (RED_WORKER_MESSAGE_CURSOR_DISCONNECT_CLIENT and
 RED_WORKER_MESSAGE_DISPLAY_DISCONNECT_CLIENT).
 * change some asserts in input channel.
 * make main channel disconnect not recursive
 * introduce disconnect call back to red_channel_create_parser

The remaining abort is from a double free in the main channel, still can't
find it (doesn't happen when running under valgrind - probably due to the
slowness resulting from that), but is easy to see when running under gdb.
2011-08-23 17:56:44 +03:00
Alon Levy
22084c4703 server/main_channel+reds: make main_channel_init return MainChannelClient
This makes it easier to introduce RedClient in the next patch.
2011-08-23 17:46:30 +03:00
Alon Levy
2550e825ec server/red_worker: release PIPE_ITEM_TYPE_VERB in display channel
We send a SPICE_MSG_DISPLAY_MARK verb.
2011-08-23 17:46:07 +03:00
Alon Levy
9ae19999d2 server/red_client: clear pipe on disconnect 2011-08-23 17:45:45 +03:00
Alon Levy
cd2c87da3e server/red_channel: workaround for fast client disconnect bug (TODO - real fix) 2011-08-23 17:45:24 +03:00
Alon Levy
6be2c77dd9 server/main_channel: use MainChannel in sig
use MainChannel* instead of Channel* for a many functions in main_channel.h
(affects main_channel.c and reds.c).

some one liner fixes are hidden in here too.
2011-08-23 17:44:58 +03:00
Alon Levy
09ae4700d2 server: move pipe from RedChannel to RedChannelClient
Another cleanup patch, no change to behavior (still one client, and it
disconnects previous client if any).

The implementation for multiple client is straightforward: the pipe
remains per (channel,client) pair, so it needs to move from the RedChannel
that to RedChannelClient. Implementation using a single pipe with multiple
consumers (to reflect different latencies) doesn't fit well with pipe rewriting
that is used by the display channel. Additionally this approach is much simpler
to verify. Lastly it doesn't add considerable overhead (but see the display
channel changes in a later patch for a real place to rethink).

This patch is just technical, changing signatures to reflect the first
argument (oop style) so red_channel becomes red_channel_client. Some places
may seem odd but they should be fixed with later comits where the channels
grow to support multiple clients.

Sound (playback/record) channels are the only ones not touched - this is
consistent with previous patches, since they have been left out of the
RedChannel refactoring.  That is left as future work. (note that they don't use
a pipe, which was the reason for not refactoring).
2011-08-23 17:44:54 +03:00
Alon Levy
b6cf68604f server/red_worker: introduce {display,cursor}_is_connected
Instead of checking for worker->{display,cursor}_channel directly.
2011-08-23 17:42:48 +03:00
Alon Levy
7e8e13593e server/red_channel (all): introduce RedChannelClient
This commit adds a RedChannelClient that now owns the stream connection,
but still doesn't own the pipe. There is only a single RCC per RC
right now (and RC still means RedChannel, RedClient will be introduced
later). All internal api changes are in server/red_channel.h, hence
the need to update all channels. red_worker.c is affected the most because
it makes use of direct access to some of RedChannel still.

API changes:

 1. red_channel_client_create added.
  rec_channel_create -> (red_channel_create, red_channel_client_create)
 2. two way connection: rcc->channel, channel->rcc (later channel will
  hold a list, and there will be a RedClient to hold the list of channels
  per client)
 3. seperation of channel disconnect and channel_client_disconnect

TODO:
 usbredir added untested.
2011-08-23 17:42:36 +03:00
Alon Levy
75b6a305ff server/red_worker: drop red_pipe_add_tail, use red_channel_pipe_add_tail
The only difference between them being that the later also does a push.
I don't believe that to be a problem, but if it does I can always introduce
a push'less version.
2011-08-23 17:01:14 +03:00
Alon Levy
8fbc41b717 server/red_channel: renames to use _proc postfix consistently
rename types - we use _proc suffix mostly to indicate function pointer types,
use it for some function pointers that were missing it.

s/channel_handle_migrate_flush_mark/channel_handle_migrate_flush_mark_proc/
s/channel_handle_migrate_data_get_serial/channel_handle_migrate_data_get_serial_proc/
s/channel_handle_migrate_data/channel_handle_migrate_data_proc/
2011-08-23 17:01:14 +03:00
Alon Levy
f124b87a40 server/red_worker: explicitly include unistd and errno 2011-08-23 17:01:14 +03:00
Alon Levy
2bddc6e33c server/tests/test_playback: correctly use spice_server_playback_get_buffer
and spice_server_playback_put_samples. The former retrieves a buffer from a free
list with spice_server_playback_get_buffer, and should be used once via
spice_server_playback_put_samples. The tester previously reused the same buffer
a number of times.
2011-08-23 17:01:14 +03:00
Alon Levy
b88f233633 server/tests/basic_event_loop: multiple fixes
reuse common/ring.h
ignore SIGPIPE
fix handling of removed watches
2011-08-23 17:01:14 +03:00
Yonit Halperin
06c2e22fd9 server/red_worker.c: fix - locking the wrong mutex when releasing glz dict 2011-08-23 17:01:14 +03:00
Alon Levy
5c99a6da4f server/tests/test_display_base: fix compile 2011-08-23 17:01:14 +03:00
Alon Levy
70a5360e1c server/reds.h: explicitly include config.h 2011-08-23 17:01:14 +03:00
Hans de Goede
c5a291f454 server: Add a usbredir channel 2011-08-10 22:42:40 +02:00
Christophe Fergeau
3582adb989 mjpeg: add missing SPICE_BITMAP_FMT_RGBA
I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from
spice image formats to libjpeg-turbo colorspaces.
2011-08-02 11:13:49 +02:00
Christophe Fergeau
4b15555fbd mjpeg: fix libjpeg assertion
After the changes to add libjpeg-turbo support to spice-server mjpeg
compression code, it's relatively easy to hit an assertion from
libjpeg in spice-server about "too few scanlines transferred" when
the mjpeg streaming code triggers. This assertion brings down qemu,
which is bad :)

This is because when we first initialize the mjpeg encoder, we do:

stream_width = SPICE_ALIGN(src_rect->right - src_rect->left, 2);
stream_height = SPICE_ALIGN(src_rect->bottom - src_rect->top, 2);

stream->mjpeg_encoder = mjpeg_encoder_new(stream_width, stream_height);

and then when we iterate over the image scanlines to feed them to
libjpeg, we do:

const int image_height = src->bottom - src->top;
const int image_width = src->right - src->left;

for (i = 0; i < image_height; i++) {
    mjpeg_encoder_encode_scanline(...);
}
mjpeg_encoder_end_frame(...);

When stream_height is odd, the mjpeg_encoder will be created with
an height that is 1 more than the number of lines we encode. Then
libjpeg asserts when we tell it we're done with the compression
while it's still waiting for one more scanline.

Looking through git history, this rounding seems to be an artifact
from when we were using ffmpeg for the mjpeg encoding. Since
spicec and spicy (the latter needs a few fixes) can handle streams
with odd height/width, the best way to solve this issue is to stop
rounding up the height and width of the streams we create. This
even saves some bandwidth :)
2011-08-01 11:01:04 +02:00
Alon Levy
f0f44e2630 server/red_dispatcher: fix wrong resolution set for tablet
when changing resolutions due to the new async code paths the surface
creation command was kept by reference, and later, when the red_worker
signaled completion by calling async_complete the mouse mode was updated
using the reference. This caused the wrong values to be read resulting in wrong
resolutions set and a non working mouse pointer. Fix this by keeping a copy of
the surface creation command instead of a reference.

No bz. Found in testing.
2011-07-31 17:47:07 +03:00
Hans de Goede
608713b9ac Bump version in server/spice,h to 0.9.1
It is a bit early to bump, since a 0.9.1 release is not happening yet,
but this allows me to test if the vdagent SpiceCharInterface state callback
fixes are present or not in qemu code, and thus disabling the ugly vdagent
specific workaround from spice-qemu-char.c when compiling against a new
enough spice-server.
2011-07-26 14:16:07 +02:00
Hans de Goede
37a24a888f server: Don't call vdagent chardev state callback on client (dis)connect
See this long mail for the rationale for this:
http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html
2011-07-25 12:21:46 +02:00
Alon Levy
b371824269 server/smartcard: fix smartcard_channel_send_error
It was sending the wrong data, the memory right after the VCSMsgHeader
which was actually not where the data was.

Fixed by having the header and data (VSCError, 4 bytes of the error code)
embedded in the ErrorItem pipe item.
2011-07-22 22:36:12 +03:00
Christophe Fergeau
47684d2885 mjpeg: rename jpeg_mem_dest
jpeg_mem_dest is a public symbol in libjpeg8 so using it with
no prefix will cause symbol clashes. Rename it to spice_jpeg_mem_dest.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
c12bafbc53 mjpeg_encoder: allocate "row" on demand
It's not used when we use jpeg-turbo colorspaces, so it's better
to allocate it when we know we'll need it rather than always
allocating it even if it won't be used.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
3a433912e9 mjpeg_encoder: remove unused functions
After the refactoring to optionally use libjpeg-turbo, some
of the functions that mjpeg-encoder used to provide are now no
longer used. This commit removes them.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
ad55230a2d mjpeg_encoder: use libjpeg-turbo extra colorspaces
When libjpeg-turbo is available, we can use the BGR and BGRX
colorspaces that it provides to avoid extra conversions of the
data we want to compress to mjpeg
2011-07-22 16:53:56 +02:00
Christophe Fergeau
b0cd4f4883 red_worker: use new mjpeg_encoder_encode_scanline API
The main point is to move the pixel conversion code into
the MjpegEncoder class to be able to make use libjpeg-turbo
additional pixel formats without the reds_worker code noticing.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
d4305e16ad mjpeg_encoder: add mjpeg_encoder_get_bytes_per_pixel
Returns the number of bytes per pixel corresponding to the input
data format.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
4275095ff9 mjpeg_encoder: add mjpeg_encoder_encode_scanline
This API is meant to allow us to move the pixel format conversion
into MjpegEncoder. This will allow us to be able to use the
additional pixel formats from libjpeg-turbo when available.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
cacca4dce6 red_worker: simplify red_rgb_to_24bpp prototype
It takes a lot of arguments, "id" is unused, "frame" and
"frame_size" can be obtained from the "stream" argument, so
can get rid of 3 arguments to make things more readable.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
1d808d31f4 mjpeg_encoder: rework output buffer allocation
When encoding a frame, red_worker passes an allocated buffer to
libjpeg where it should encode the frame. When it fails, a new
bigger buffer is allocated and the encoding is restarted from
scratch. However, it's possible to use libjpeg to realloc this
buffer if it gets too small during the encoding process. Make use
of this feature, especially since it will make it easier to encore
one line at a time instead of a full frame in subsequent commits.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
22743bee9f red_worker: factor pixel conversion code
When encoding to mjpeg, the on screen data have to be converted
to 24bpp RGB since that's the format that libjpeg expects. Factor
as much code as possible for the 3 formats we handle.
2011-07-22 16:53:56 +02:00
Christophe Fergeau
e0e8d091ff fix make distcheck 2011-07-22 10:24:30 +02:00
Hans de Goede
765948d449 server: make sure we clear vdagent and update mouse mode on agent disconnect
The check this patch removes causes us to not set vdagent to NULL, nor
update the mouse mode when the guest agent disconnects when no client is
attached. Which leads to a non working mouse, and on agent reconnect a
"spice_server_char_device_add_interface: vdagent already attached" message
instead of a successful re-add of the agent interface .

hansg: Note this is commit 443994ba from the 0.8 branch, which I did
not forward port back then because it seemed unnecessary on master, but it
turns out that the (wrong) check was just hidden in another place on master.
2011-07-21 14:59:26 +02:00
Yonit Halperin
51628f5124 server/red_worker: send surface images to client on-demand after S3/4 wakeup
When surfaces are being reloaded to the worker, we
will send them to the client only if and when it needs them.
2011-07-20 16:00:19 +03:00
Alon Levy
3be08d68c0 server/spice.h: bump QXL_MINOR because of QXLWorker and QXLInterface changes 2011-07-20 16:00:19 +03:00
Alon Levy
2a4d97fb78 server: add QXLWorker.flush_surfaces_async for S3/S4 support
This does the following, all to remove any referenced memory on the pci bars:
    flush_all_qxl_commands(worker);
    flush_all_surfaces(worker);
    red_wait_outgoing_item((RedChannel *)worker->display_channel);
    red_wait_outgoing_item((RedChannel *)worker->cursor_channel);

The added api is specifically async, i.e. it calls async_complete
when done.
2011-07-20 16:00:19 +03:00
Alon Levy
b26f0532c1 server: add QXLInterface::update_area_complete callback
when update_area_async is called update_area_complete will be called with
the surfaces dirty rectangle list.
2011-07-20 16:00:19 +03:00
Alon Levy
f300de20d9 server/red_worker: handle_dev_input: reuse write_ready introduced for async 2011-07-20 16:00:19 +03:00
Alon Levy
096f49afbf server: add async io support
The new _ASYNC io's in qxl_dev listed at the end get six new api
functions, and an additional callback function "async_complete". When
the async version of a specific io is used, completion is notified by
calling async_complete, and no READY message is written or expected by
the dispatcher.

update_area has been changed to push QXLRects to the worker thread, where
the conversion to SpiceRect takes place.

A cookie has been added to each async call to QXLWorker, and is passed back via
async_complete.

Added api:

QXLWorker:
    update_area_async
    add_memslot_async
    destroy_surfaces_async
    destroy_primary_surface_async
    create_primary_surface_async
    destroy_surface_wait_async

QXLInterface:
    async_complete
2011-07-20 16:00:19 +03:00
Alon Levy
c04d60631e server: api: add spice_qxl_* calls based on QXLWorker contents
For each callback in QXLWorker, for example QXLWorker::update_area, add
a direct call named spice_qxl_update_area.

This will (a) remove the pointless indirection and (b) make shared
library versioning alot easier as we'll get new linker symbols which
we can tag with the version they appeared in the shared library.
2011-07-20 16:00:17 +03:00
Alon Levy
f4ba39fe0f server: spice-server.syms: move sasl symbols to 0.8.2 2011-07-20 11:08:37 +03:00
Alon Levy
16c844e374 server/red_worker: remove print on handle_dev_destroy_surfaces 2011-07-20 11:08:17 +03:00
Alon Levy
5120dfb284 server/red_worker: *_release_item: less frequent debug messages 2011-07-20 11:08:09 +03:00
Alon Levy
0378df6254 server/tests: test_util.h: fix double ASSERT definition 2011-07-20 11:05:44 +03:00
Gerd Hoffmann
7013561462 server: add symbol versioning to the spice server shared library.
This patch adds symbol versions to the spice server library.  Each
symbol which is exported by libspice-server gets tagged with the
(stable) version where it appeared first.  This way the linker and rpm
are able to figure which version of the spice-server libary is required
by a particular qemu binary/package.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-19 14:39:28 +02:00
Christophe Fergeau
f045886a06 remove unused function 2011-07-19 13:31:10 +02:00
Christophe Fergeau
c4d6f9791a Fix spice-server/qemu channel version checks
When qemu creates a channel, reds.c contains code to check the
minor/major channel versions known to QEMU (ie the ones that were
current in spice-server when QEMU was compiled) and to compare these
versions against the current ones the currently installed spice-server
version.

According to kraxel [1], the rules for these interface numbers are:

"The purpose of the versions is exactly to avoid the need for a new
soname.  The rules are basically:

   (1) You add stuff to the interface, strictly append-only to not break
       binary compatibility.
   (2) You bump the minor version of the interface.
   (3) You check the minor version at runtime to figure whenever the
       added fields contain valid stuff or not.

An example is here (core interface, minor goes from 2 to 3, new
channel_event callback):

http://cgit.freedesktop.org/spice/spice/commit/?id=97f33fa86aa6edd25111b173dc0d9599ac29f879
"

The code currently refuses to create a channel if QEMU minor version is
less than the current spice-server version. This does not correspond
to the intended behaviour, this patch changes to fail is qemu was compiled
with a spice-server that is *newer* than the one currently installed. This
case is something we cannot support nicely.

[1] http://lists.freedesktop.org/archives/spice-devel/2011-July/004440.html
2011-07-18 18:15:40 +02:00
Yonit Halperin
00086b8898 server: add missing calls to red_handle_drawable_surfaces_client_synced
red_handle_drawable_surfaces_client_synced was called only from red_pipe_add_drawable, while it
should also be called from red_pipe_add_drawable_after. Otherwise, the client
might receive a command with a reference to a surface it doesn't hold and crash.
2011-07-12 09:01:45 +03:00
Yonit Halperin
686b67473f server: fix access to a released drawable. RHBZ #713474
red_pipe_add_drawable can lead to removal of drawables from current tree
(since it calls red_handle_drawable_surfaces_client_synced), which can
also lead to releasing these drawables.
Before the fix, red_current_add_equal, called red_pipe_add_drawable,
without assuring afterwards that the drawables it refers to are still alive or
still in the current tree.
2011-07-12 09:01:26 +03:00
Alon Levy
7e83957d22 server: fix segfault if no migrate_info provided
qemu calls spice_server_migrate_switch even if it didn't do a
spice_server_migrate_info first. Fix the resulting error by not pushing
a switch host tag to the pipe in this case, and add a check anyway in the
marshalling code just in case.
2011-07-06 13:52:20 +02:00
Yonit Halperin
6d17dbeb0b server: cursor_channel: releasing pipe items resources when the pipe is cleared (on disconnect)
same as commit 74a9d10af96f4d7c8c1b1d7fca124a8df9180787 for cursor channel
2011-07-05 17:23:39 +03:00
Yonit Halperin
6336f9413a server: display_channel: releasing pipe items resources when the pipe is cleared (on disconnect)
fixes "display_channel_release_item: panic: invalid item type"

Before changing the red_worker to use the red_channel interface, there
was a devoted red_pipe_clear routine for the display channel and cursor channel.
However, clearing the pipe in red_channel, uses the release_item callback
the worker provided. This callback has handled only resources that need to be released
after the pipe item was enqueued from the pipe, and only for pipe items that were set in
red_channel_init_send_data.
This fix changes the display channel release_item callback to handle all types of
pipe items, and also handles differently pushed and non-pushed pipe items.
2011-07-05 17:23:39 +03:00
Yonit Halperin
b881c4b5ca server: not reading command rings before RED_WORKER_MESSAGE_START, RHBZ #718713
On migration, destroy_surfaces is called from qxl (qxl_hard_reset), before the device was loaded (on destination).
handle_dev_destroy_surfaces led to red_process_commands, which read the qxl command ring
(which appeared to be not empty), and then when processing the command
it accessed unmapped memory.
2011-07-05 17:23:38 +03:00
Yonit Halperin
3d3066b175 server: replace redundant code with red_cursor_reset
In addition (1) make handle_dev_destroy_surfaces call red_release_cursor
(2) call red_wait_outgoing_item(cursor_channel) only after adding msgs to pipe
2011-07-05 17:23:38 +03:00
Yonit Halperin
7b34d1994e server: removing local cursor, this solves RHBZ #714801
When the worker was stoped, the cursor was copied from guest ram to the host ram,
and its corresponding qxl command was released.
This is unecessary, since the qxl ram still exists (we keep references
to the surfaces in the same manner).
It also led to BSOD on guest upon migration: the device tracks cursor set commands and it stores
a reference to the last one. Then, it replays it to the destination server when migrating to it.
However, the command the qxl replayed has already been released from the pci by the original
worker, upon STOP.
2011-07-05 17:23:38 +03:00
Alon Levy
86f7b490a9 server/tests/basic_event_loop: strange assert failure; fix 2011-07-05 14:08:30 +02:00
Alon Levy
8b5be0609f server/smartcard: register channel only when hardware is available 2011-07-05 14:04:36 +02:00
Alon Levy
392bb921dc Revert "server/smartcard: don't register the channel if no hardware emulated"
This reverts commit 456ff9f8d5.

That patch just disabled the smartcard channel completely because
the check was done *before* the initialization of the qemu smartcard
devices, not after.
2011-06-29 12:06:51 +02:00
Christophe Fergeau
5ff78b617d red_worker: remove 2 empty functions
red_worker was using some share/unshare stream_buf functions whose
body is empty. This commit removes them and their use.
2011-06-28 18:08:57 +02:00
Alon Levy
456ff9f8d5 server/smartcard: don't register the channel if no hardware emulated 2011-06-23 13:18:39 +02:00
Alon Levy
de82fdb9dc server/smartcard: handle BaseChannel messages
According to spice.proto the smartcard channel can receive acks and any
other message defined in BaseChannel. While the spicec implementation didn't
send an ACK spice-gtk does, so handle it.
2011-06-23 13:18:39 +02:00
Christophe Fergeau
e261cb2d54 s/__visible__/SPICE_GNUC_VISIBLE
The C specification reserves use of identifiers starting with __
to the compiler so we shouldn't use one such symbol.
2011-06-22 16:29:52 +02:00
Marc-André Lureau
0400769de1 sndworker: check the caps before sending volume messages 2011-06-22 12:12:51 +02:00
Marc-André Lureau
d1758b3288 sndworker: add AudioVolume/AudioMute messages
These messages allow the guest to send the audio device volume to the
client. It uses an arbitrary scale of 16bits, which works good enough
for now.

Save VolumeState in {Playback,Record}State, so that we can send the
current volume on channel connection.

Note about future improvements:
- add exact dB support
- add client to guest volume change

Updated since v2:
- bumped record and playback interface minor version to allow
  conditional compilation
Updated since v1:
- sync record volume on connection too
2011-06-22 12:12:26 +02:00
Alon Levy
65350d2ab3 server/smartcard: fix use after free 2011-05-24 13:19:09 +03:00
Alon Levy
34949178a8 server/red_worker: stat_now cleanup
static, remove inline, add (void), and empty line after function variables.
2011-05-09 09:59:57 +03:00
Alon Levy
db7d6c866e server/red_worker: fix typo (lats_send_time) 2011-05-09 09:46:26 +03:00
Alon Levy
87486fd790 server/tests: show port to connect to 2011-05-09 09:46:22 +03:00
Marc-André Lureau
148dabdf62 server: bump SPICE_SERVER_VERSION to 0.9.0
SASL functions will be released with 0.9.0
2011-05-08 19:05:41 +02:00
Zeeshan Ali (Khattak)
73dc16c02b server: Unset executable bit of red_tunnel_worker.h 2011-05-05 20:04:49 +03:00
Marc-André Lureau
138c421193 build: fix gettimeofday warning
CC     test_playback.o
test_playback.c: In function ‘playback_timer_cb’:
test_playback.c:56:5: warning: implicit declaration of function ‘gettimeofday’
2011-05-03 17:16:46 +02:00
Marc-André Lureau
aae0357023 build: require c99
Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // comments, ...
2011-05-03 16:49:43 +02:00
Christophe Fergeau
68c6014ff0 move get_time_stamp to main_channel.c
There is only one user of get_time_stamp from spice_common.h so
it's not really useful to keep it there.
2011-05-03 14:44:12 +02:00
Christophe Fergeau
48db4c2181 common,server: use ASSERT from spice_common.h
spice_common.h provides an ASSERT macro, no need to duplicate it
in many places. For now client/debug.h keeps its own copy since
debug.h and spice_common.h have clashes on other macros which are
trickier to unify.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
f88dc6eecb server: use gcc builtin for atomic get/set bit 2011-05-03 14:44:11 +02:00
Christophe Fergeau
cdba4ead67 remove void * arithmetic
With -Wpointer-arith, gcc complains about void pointer arithmetic.
This is not a big deal with gcc, but could be with other compilers,
so it's better to cast to char */uint8_t * before doing the
arithmetic on such pointers.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
e17767e892 add missing static 2011-05-03 14:44:11 +02:00
Christophe Fergeau
e0c20725c8 s/USE_OGL/USE_OPENGL
This is more explicit about what it does, and not much longer
2011-05-03 14:44:11 +02:00
Christophe Fergeau
78c1465ed3 add #include <config.h> to all source files
When using config.h, it must be the very first include in all source
files since it contains #define that may change the compilation process
(eg libc structure layout changes when it's used to enable large file
support on 32 bit x86 archs). This commit adds it at the beginning
of all .c and .cpp files
2011-05-03 14:44:10 +02:00
Christophe Fergeau
2db7212175 autotools: correctly build canvas-related code
spice client and spice server shares code from
common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is
shared, the server code wants a canvas compiled with
SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas
compiled with SW_CANVAS_CACHE.

The initial autotools refactoring didn't take that into account,
this is now fixed by this commit. After this commit, the canvas
files from common/ are no longer compiled as part of the
libspice-common.la convenience library. Instead, there are "proxy"
canvas source files in client/ and server/ which #include the
appropriate C files after defining the relevant #define for the
binary that is being built.

To prevent misuse of the canvas c files and headers in common/,
SPICE_CANVAS_INTERNAL must be set when including the canvas headers
from common/ or when building the c files from common/ otherwise
the build will error out.
2011-05-03 14:44:10 +02:00
Christophe Fergeau
2a4614ea94 autotools: refactor the whole build machinery
spice Makefile.am setup is a bit confusing, with source file
names being listed several times in different Makefile.am
(generally, once in EXTRA_DIST and another time in another
Makefile.am in _SOURCES). The client binaries are built
by client/x11/Makefile.am, which means recursing into client,
then into x11 to finally build spicec. This Makefile.am is
also referencing files from common/ and client/, which is
a bit unusual with autotools.

This patch attempts to simplify the build process to get
something more usual from an autotools point of view.
The source from common/ are compiled into a libtool convenience
library, which the server and the client links against which avoids
referencing source files from common/ when building the server and
the client. The client is built in client/Makefile.am and directly
builds files from x11/ windows/ and gui/ if needed (without
recursing in these subdirectories).

This makes the build simpler to understand, and also makes it
possible to list source files once, which avoids potential
make distcheck breakage when adding new files.

There is a regression in this patch with respect to
sw_canvas/gl_canvas/gdi_canvas. They should be built with
different preprocessor #defines resulting in different behaviour
of the canvas for the client and the server. However, this is not
currently the case, both the client and the server will use the same
code for now (which probably means one of them is broken). This will
be fixed in a subsequent commit.

make distcheck passes, but compilation on windows using the
autotools build system hasn't been tested, which means it's likely
to be broken. It shouldn't be too hard ot fix it though, just let
me know of any issues with this.
2011-05-03 14:44:10 +02:00
Christophe Fergeau
da584a5e2d add missing "LGPLv2.1 or later" header to source files 2011-05-02 11:24:44 +02:00
Christophe Fergeau
2f187d5a71 server: s/desable/disable
This fixes a typo in some function names, there should be no
functional change.
2011-05-02 11:24:44 +02:00
Christophe Fergeau
8a1ceb65fa use foo(void) instead of foo() in prototypes
In C, the latter isn't a prototype for a function with no arg,
but declares a function with an undefined number of args.
2011-05-02 11:24:44 +02:00
Christophe Fergeau
fa6956fff5 server: remove extra arg in reds_on_main_agent_start call 2011-05-02 11:24:44 +02:00
Christophe Fergeau
7b0de32423 server: use is_primary_surface
red_worker.c has an is_primary_surface helper function, but there
were some places in the file not using it. This patch fixes that
2011-05-02 11:24:43 +02:00
Christophe Fergeau
4031681638 server/tests remove useless assignment
This was detected by clang-static-analyzer.
2011-04-08 12:14:20 +02:00
Christophe Fergeau
3ba093a57e tests: fix compilation with -Wall -Werror
When compiling spice with make CFLAGS="-g3 -ggdb3 -O0 -Wall -Werror",
the build broken because of a few unused variables/missing returns.
This patch fixes these warnings.
2011-04-08 12:14:19 +02:00
Christophe Fergeau
5dd6932bf7 remove duplicated macro
MIN() is already defined in spice-protocol/spice/macros.h
2011-04-04 11:59:53 +02:00
Hans de Goede
3953b9ff1b server: make sure we clear vdagent and update mouse mode on agent disconnect
The check this patch removes causes us to not set vdagent to NULL, nor
update the mouse mode when the guest agent disconnects when no client is
attached. Which leads to a non working mouse, and on agent reconnect a
"spice_server_char_device_add_interface: vdagent already attached" message
instead of a successful re-add of the agent interface .
2011-04-04 11:53:47 +02:00
Hans de Goede
00a03b7633 server: ignore SPICE_MSGC_MAIN_AGENT_START messages when there is no agent
This can happen for example when a SPICE_MSGC_MAIN_AGENT_START message
from the client and the vdagent disconnecting race.
2011-04-04 11:52:48 +02:00
Hans de Goede
e472bc7d5a server: hookup agent-msg-filter discard-all functionality
This ensures that if the client or agent connects to the client-agent
"tunnel" while the other side is halfway through sending a multi part
message, the rest of the message gets discarded, and the connecting
party starts getting data at the beginning of the next message.
2011-04-04 11:47:46 +02:00
Hans de Goede
3accb60240 server: add discard all option to agent message filter 2011-04-04 11:30:30 +02:00
Hans de Goede
66cf0e28b3 server: filter all data from client
Filter all data from client, even when there is no agent connected
to keep filter state correct.
2011-04-04 11:26:54 +02:00
Hans de Goede
326fdf34f2 server: reset read/write filter on agent/client disconnect
The agent message filter keeps track of messages as they are being send
reset the relevant filter to its initial state when one of the 2 ends
of the agent<->client "tunnel" disconnects.
2011-04-04 11:24:47 +02:00
Hans de Goede
d590666408 server: break read_from_vdi_port loop if the guest gets disconnected
read_from_vdi_port calls dispatch_vdi_port data, which will disconnect
the guest agent if it sends invalid data. It would then try to read more
data from the disconnected guest agent resulting in a NULL ptr dereference,
this patch fixes this.
2011-04-04 11:23:11 +02:00
Hans de Goede
c652dfa5e6 server: Don't stop writing agent data to the guest when the client disconnects
write_to_vdi_port() was checking for reds->agent_state.connected to determine
wether it could write queued data. But agent_state.connected reflects if
*both* ends are connected. If the client has disconnected, but the guest agent
is still connected and some data is still pending (like a final clipboard
release from the client), then this data should be written to the guest agent.
2011-04-04 11:23:05 +02:00
Hans de Goede
f8e6dc78c7 server: Don't reset agent state when the client disconnects
We were calling reds_reset_vdp on client disconnect, which is not a good
idea. reds_reset_vdp does 3 things:

1) It resets the state related to reading chunks from the spicevmc virtio
   port. If the client disconnects while the guest agent is in the middle
   of sending a chunk, this will lead to an inconsistent state, and lots
   of printing of "dispatch_vdi_port_data: invalid port" messages caused
   by this inconsistent state sometimes followed by a segfault.

   This can be triggered by copy and pasting something large (say
   a screenshot) from the guest to the spice-gtk client, as the spice-gtk
   client currently has a bug causing it to crash when receiving a multi
   chunk vdagent messages. Without this patch (and with the spice-gtk bug
   present) I can consistently reproduce this.

2) It clears any buffered writes from the client to the guest still pending
   because the virtio port cannot consume data fast enough. Since the agent
   itself is still running fine, throwing away writes for it because the
   client has disconnected makes no sense. Esp, since on clean exit the
   client may very well send a clipboard release message directly
   before closing the connection, and this may get lost this way.

3) It sets client_agent_started to false, this is the only thing which
   actually makes sense to do on client disconnect.

Note that since we no longer reset the vdp state on client disconnect, we
must now reset it on agent disconnect even if we don't have a client. So
the reds_reset_vdp call in reds_agent_remove() gets moved to the top,
above both the agent_state.connected and reds->peer checks which will
both fail in the no client case.
2011-04-04 11:22:24 +02:00
Hans de Goede
c231417393 server: avoid unneeded recursion in dispatch_vdi_port_data
dispatch_vdi_port_data, was calling vdi_read_buf_release when no client
is connected to free the passed in buf. The only difference between
vdi_read_buf_release and directly adding the buffer back to the ring
with ring_add, is that vdi_read_buf_release calls read_from_vdi_port
after adding the buffer back. But dispatch_vdi_port_data only gets called
from read_from_vdi_port itself, thus this would lead to recursing into
read_from_vdi_port. read_from_vdi_port is protected against recursion and
will immediately return if called recursively. Thus calling
vdi_read_buf_release from dispatch_vdi_port_data is pointless, instead
simply putting the buffer back in the ring suffices.
2011-03-24 17:34:29 +01:00
Hans de Goede
bcf9a60aa9 server: Make copy paste support configurable
Also bump SPICE_SERVER_VERSION to 0x000801 as 0.8.1 will be the
first version with the new API for this, and we need to be able to
detect the presence of this API in qemu.
2011-03-24 17:30:03 +01:00
Hans de Goede
c2db6d1066 spice-server: Add the ability to filter agent messages 2011-03-24 17:28:21 +01:00
Alon Levy
02c3f54deb server/tests: add test_playback 2011-03-22 09:44:52 +02:00
Alon Levy
43c5b4f973 server: use -std=c99
Finds some bugs.
2011-03-22 09:44:52 +02:00
Alon Levy
61d8e54766 server/reds: allow call to reds_agent_remove even if it is gone
The current assert(reds->agent_state.connected) tiggers if when
the agent disconnected there was still data waiting to be sent (for
instance if there is a bug in the client handling clipboard and it
is killed while a large clipboard transfer is in progress). So first
call to reds_agent_remove happens from spice_server_char_device_remove_interface,
and then it is called again (triggering the assert) from free_item_data
from read_from_vdi_port because of the channel destruction.

Other option would be to not call it from one of the paths - but that
is suboptimal:
 * if there is no data in the pipe, the second call never happens.
 * the second call has to be there anyway, because it may fail during
  parsing data from the agent.

This patch fixes a segfault on this assert when a client starts passing
from guest agent to client a large clipboard and dies in the middle. There
is still another assert happening occasionally at marshaller which I don't
have a fix for (but it doesn't seem to be related).
2011-03-08 21:18:55 +02:00
Marc-André Lureau
17096d1dc8 server/input: avoid double free() of RedChannel on disconnect
Current master is calling red_channel_destroy() on incoming error, but
reds Channels still references it, which causes a double free() later
on (see valgrind report below).

Instead, on error condition, do like the rest of the channels and call
reds_disconnect(), which remove the references and call shutdown(),
which then call red_channel_destroy() and finally free the channel
with red_channel_destroy().

Note: the previous code intention was certainly to be able to keep the
rest of the channels connected when input channel has errors. This is
not addressed by this patch.

red_channel_shutdown:
==29792== Invalid read of size 8
==29792==    at 0x4C6F063: red_channel_shutdown (red_channel.c:460)
==29792==    by 0x4C51EFA: inputs_shutdown (inputs_channel.c:463)
==29792==    by 0x4C48445: reds_shatdown_channels (reds.c:539)
==29792==    by 0x4C4868A: reds_disconnect (reds.c:603)
==29792==    by 0x4C519E9: main_channel_on_error (main_channel.c:765)
==29792==    by 0x4C6E80A: red_channel_peer_on_incoming_error (red_channel.c:215)
==29792==    by 0x4C6E22D: red_peer_handle_incoming (red_channel.c:87)
==29792==    by 0x4C6E551: red_channel_receive (red_channel.c:154)
==29792==    by 0x4C6F329: red_channel_event (red_channel.c:531)
==29792==    by 0x41CB8C: main_loop_wait (vl.c:1365)
==29792==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
==29792==    by 0x41FE9A: main (vl.c:1411)
==29792==  Address 0x30b0f6d0 is 0 bytes inside a block of size 28,648 free'd
==29792==    at 0x4A05372: free (vg_replace_malloc.c:366)
==29792==    by 0x4C6F032: red_channel_destroy (red_channel.c:454)
==29792==    by 0x4C6E80A: red_channel_peer_on_incoming_error (red_channel.c:215)
==29792==    by 0x4C6E22D: red_peer_handle_incoming (red_channel.c:87)
==29792==    by 0x4C6E551: red_channel_receive (red_channel.c:154)
==29792==    by 0x4C6F329: red_channel_event (red_channel.c:531)
==29792==    by 0x41CB8C: main_loop_wait (vl.c:1365)
==29792==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
==29792==    by 0x41FE9A: main (vl.c:1411)

https://bugs.freedesktop.org/show_bug.cgi?id=34971
2011-03-03 14:59:31 +01:00
Marc-André Lureau
28f3007145 Revert "server/red_channel: red_channel_event: push on blocked"
This reverts commit 5062433d8a.

red_channel_receive() can call red_channel_destroy() which frees
channel.

The condition bellow is then checked, which can access a freed
channel:

if (event & SPICE_WATCH_EVENT_WRITE || channel->send_data.blocked)

Reverting this commit solves the issue without any apparent
bugs/drawbacks, which kind of clears out the weird TODO.

handle_dev_input: cursor connect
==11826== Invalid read of size 4
==11826==    at 0x4C6F83C: red_channel_event (red_channel.c:535)
==11826==    by 0x41CB8C: main_loop_wait (vl.c:1365)
==11826==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
==11826==    by 0x41FE9A: main (vl.c:1411)
==11826==  Address 0x31fb00f0 is 96 bytes inside a block of size 28,648 free'd
==11826==    at 0x4A05372: free (vg_replace_malloc.c:366)
==11826==    by 0x4C6F536: red_channel_destroy (red_channel.c:453)
==11826==    by 0x4C52B5D: inputs_channel_on_incoming_error (inputs_channel.c:449)
==11826==    by 0x4C6ED0E: red_channel_peer_on_incoming_error (red_channel.c:215)
==11826==    by 0x4C6E731: red_peer_handle_incoming (red_channel.c:87)
==11826==    by 0x4C6EA55: red_channel_receive (red_channel.c:154)
==11826==    by 0x4C6F82D: red_channel_event (red_channel.c:530)
==11826==    by 0x41CB8C: main_loop_wait (vl.c:1365)
==11826==    by 0x437CDE: kvm_main_loop (qemu-kvm.c:1589)
==11826==    by 0x41FE9A: main (vl.c:1411)
==11826==

https://bugs.freedesktop.org/show_bug.cgi?id=34971
2011-03-03 14:59:31 +01:00
Alon Levy
23ba2ce3e5 server/red_worker: use red_channel_pipe_item_init
replaces in file red_pipe_item_init.
2011-03-02 17:27:53 +02:00
Alon Levy
c771182274 server/red_channel: move out_bytes_counter from Outgoing to RedChannel 2011-03-02 17:27:53 +02:00
Alon Levy
692b41f946 server/red_channel: split Incoming/Outgoing to callback and state
This allows later to have the callback table under RedChannel when
the callbacks actually get used by RedChannelClient. Since the cb's
are identical for different clients of the same channel it makes sense
to store the callback pointers in one place per channel. The rest of
the incoming and outgoing struct just gets moved to RedChannelClient.
2011-03-02 17:27:53 +02:00
Alon Levy
d1feaeb282 server/red_channel: no opaque in red_channel_peer_on_*_error 2011-03-02 17:27:53 +02:00
Alon Levy
b5ae7133c0 server/red_worker: use red_channel_is_connected 2011-03-02 17:27:53 +02:00
Alon Levy
7890b623b5 server/red_channel: add red_channel_disconnect, use in red_worker
replace channel_release_res in red_worker with red_channel_disconnect.
2011-03-02 17:27:53 +02:00
Alon Levy
aa5d23fdec server/red_channel: reset send_data.item to NULL after release 2011-03-02 17:27:53 +02:00
Alon Levy
d4c187c043 server/red_worker: remove RedChannel argument from add_buf_from_info
It was unused.
2011-03-02 17:27:53 +02:00
Alon Levy
5575d6e5fa server/red_channel: add red_channel_{,no_}item_being_sent 2011-03-02 17:27:53 +02:00
Alon Levy
17ebd6a719 server/red_worker: complete removal of send_data.marshaller use 2011-03-02 17:27:53 +02:00
Alon Levy
992252104c server/red_worker: replace _send_ functions by _marshall_
Changes in display channel for a code size win.

A note about this and the previous cursor change: it will appear that we are
now (with these changes) releasing resources too early. This is not so - send
always has the option of blocking, which means after send you can not release
resources anyway, that's what the release_item callback is for. So both the
code before and now are doing the same accounting.
2011-03-02 17:27:52 +02:00
Alon Levy
88db43879b server/red_channel: add red_channel_send_message_pending 2011-03-02 17:27:52 +02:00
Alon Levy
7a650e9641 server/red_channel: add red_channel_all_blocked 2011-03-02 17:27:52 +02:00
Alon Levy
b7dbc14b1c server/red_worker: cursor channel: replace _send_ with _marshall_ 2011-03-02 17:27:52 +02:00
Alon Levy
e9be6ca82c server/red_channel (all): add red_channel_get_header
This is useful during the channel specific channel_send_pipe_item_proc
callback, it allows altering or reader the header being sent.
2011-03-02 17:27:52 +02:00
Alon Levy
17d5761322 server/red_channel: add red_channel_get_first_socket
Use in main_channel. This is just for backward portability later
when multiple clients are introduced - needs to be considered (which
sockets do we want to export from libspiceserver?)
2011-03-02 17:27:52 +02:00
Alon Levy
8cd5568c92 server/red_channel (+): remove red_channel_add_buf 2011-03-02 17:27:52 +02:00
Alon Levy
16bff20f91 server/tunnel: pass SpiceMarshaller reference from send
Introduce SpiceMarshaller param to all send's that do add_buf

Next patch will use marshaller in all functions that currently don't by
replacing red_channel_add_buf with marshaller add_ref. Note - currently
tunnel is broken due to wrong size in messages.
2011-03-02 17:27:52 +02:00
Alon Levy
a05628bf06 server/red_channel (all): add red_channel_get_stream
use in config_socket, this makes the stream internal to the RedChannel
implementation that will change later for multiple client support.
2011-03-02 17:27:52 +02:00
Alon Levy
38e13ef1a8 server/common: introduce common/spice_common.h
move all the ASSERT/PANIC/PANIC_ON/red_error/red_printf* macros
to a common file to be used with ring.h that is going to be used externally
(by spice-gtk).
2011-03-02 17:27:51 +02:00
Alon Levy
ce03dcfbb5 server/red_channel (all): handle MIGRATE_DATA and MIGRATE_FLUSH_DATA
Handling done in red_channel instead of per channel, using call backs
for the channel specific part.
Intended to reduce furthur reliance of channels on RedChannel struct.

The commit makes the code harder to understand because of the artificial
get_serial stuff, should later be fixed by having a joint migration
header with the serial (since all channels pass it).
2011-03-02 17:27:51 +02:00
Alon Levy
8002a30f9c server/red_channel (all): add red_channel_get_marshaller
For ussage in the send_item callback. It's only valid during this
time anyway (should make it return NULL in other occasions?)

No more direct usage of RedChannel.send_data.marshaller by channels.
2011-03-02 17:27:51 +02:00
Alon Levy
9e46945a61 server/red_worker: use red_channel_destroy 2011-03-02 17:27:51 +02:00
Alon Levy
966201c1ad server/inputs_channel: s/PIPE_ITEM_INIT/PIPE_ITEM_INPUTS_INIT/ 2011-03-02 17:27:51 +02:00
Alon Levy
5e1ba1101b server/red_channel: move SET_ACK to red_channel 2011-03-02 17:27:51 +02:00
Alon Levy
2fcd35b073 server/red_channel: add more ack api 2011-03-02 17:27:51 +02:00
Alon Levy
766bb420bb server: use red_channel_get_message_serial 2011-03-02 17:27:51 +02:00
Alon Levy
17b6a58f1e server/red_channel (all): makes red_channel_reset_send_data private
ready the way for handling ack messages in RedChannel.
2011-03-02 17:27:51 +02:00
Alon Levy
cd99a0b4b3 server/red_worker: use red_channel 2011-03-02 17:27:50 +02:00
Alon Levy
ce3efca360 server/red_channe: make hold_item take a channel arg 2011-03-02 17:27:50 +02:00
Alon Levy
73858b93dc server/red_worker: introduce red_peer_handle_outgoing and OutgoingHandler
From red_channel.
2011-03-02 17:27:50 +02:00
Alon Levy
29a7bcd596 server/red_worker: introduce common_channel_config_socket 2011-03-02 17:27:50 +02:00
Alon Levy
beba2c7206 server/red_worker: line width fix 2011-03-02 17:27:50 +02:00
Alon Levy
724348ce49 server/red_worker: don't push to NULL channel (called from device input) 2011-03-02 17:27:50 +02:00
Alon Levy
705254b399 server/red_worker: introduce red_channel_pipe_clear
No more common_release_pipe_item
2011-03-02 17:27:50 +02:00
Alon Levy
a0a9718423 server/red_worker: add red_channel_push 2011-03-02 17:27:50 +02:00
Alon Levy
111cf51103 server/red_worker: add send_item 2011-03-02 17:27:50 +02:00
Alon Levy
f7a99f858e server/red_worker: red_channel renames
The renames are part of refactoring red_worker's RedChannel to reuse
red_channel.h's RedChannel at the end.

s/red_send_data/red_channel_send/
s/red_pipe_get/red_channel_pipe_get/
s/recive_data/incoming/
s/red_receive/red_channel_receive/
s/channel_handle_message/red_channel_handle_message/
s/channel_is_connected/red_channel_is_connected/
s/red_pipe_add_type/red_channel_pipe_add_type/
2011-03-02 17:27:49 +02:00
Alon Levy
b3ea0bec3d server/red_tunnel_worker: use message_serial setter and getter
fixes breakage in --enable-tunnel compilation.
2011-03-02 17:27:49 +02:00
Marc-André Lureau
8f9cbd19db server: add SASL support
We introduce 2 public functions to integrate with the library user.

spice_server_set_sasl() - turn on SASL
spice_server_set_sasl_appname() - specify the name of the app (It is
used for where to find the default configuration file)

The patch for QEMU is on its way.

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
f4dddc50f0 server: add auth mechanism selection
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
4f983b2c9c server: add reds_channel_dispose()
Try to have a common base dispose() method for channels. For now, it
just free the caps.

Make use of it in snd_worker, and in sync_write() - sync_write() is
going to have default caps later on.

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
09c01c9516 server: simplify and constify sync_write()
+ symplify, improving style of code using it.

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
37dbb8aec9 server: pull out reds_handle_link(), for future reuse
+ a couple of indent, style change

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
414e1de720 build: add --with-sasl
Using cyrus SASL library (same as gtk-vnc/qemu).

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
2ced8996c8 server/reds: make writev fallback more generic
We are going to reuse it for SASL/SSF encode write().

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
76dc27f08a server: rename s/peer/stream
This is stylish change again. We are talking about a RedStream object,
so let's just name the variable "stream" everywhere, to avoid
confusion with a non existent RedPeer object.

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
1a4923c210 server/reds: remove the void* ctx field
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:35 +01:00
Marc-André Lureau
fc5d7f7625 server: use the new reds_stream_{read,write}
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-28 16:36:28 +01:00
Marc-André Lureau
f32503258f server: remove cb_free, not needed anymore
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 18:26:19 +01:00
Marc-André Lureau
07d6dd6108 server: use reds_{link,stream}_free()
Be carefull removing the watch before, like __release_link

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 18:26:19 +01:00
Marc-André Lureau
fca602124d server: use reds_stream_remove_watch() helper
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 18:26:18 +01:00
Marc-André Lureau
b79e7320de server: add reds_stream_{read,write,free,remove_watch}()
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 18:26:15 +01:00
Marc-André Lureau
d47912241f server: s/RedsStreamContext/RedsStream
https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 16:55:22 +01:00
Marc-André Lureau
29be54f6d3 server/reds: remove unused readv
Let's not bother with it since nobody uses it, and it's not implemented for SSL anyway

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 16:55:22 +01:00
Marc-André Lureau
0e64e2d02c build: make it silent
This patch make it easier to spot warnings in compilation.  It should
work with older versions of automake that don't support silent rules.

If you want verbose build, make V=1.

Signed-off-by: Uri Lublin <uril@redhat.com>

https://bugs.freedesktop.org/show_bug.cgi?id=34795
2011-02-27 16:55:22 +01:00
Alon Levy
0f4a0aa07e server/tests/basic_event_loop: fix bzero warning 2011-02-11 19:13:03 +02:00
Alon Levy
0b687d9b23 server/red_worker: cursor_channel_send_item: don't downcast 2011-02-11 15:32:21 +02:00
Alon Levy
bb7cbceb97 server/red_worker: match channel_release_pipe_item_proc to red_channel 2011-02-11 15:32:21 +02:00
Alon Levy
53f5cf43ce server/red_worker: introduce an outgoing struct around out_bytes_counter 2011-02-11 15:32:21 +02:00
Alon Levy
d7521edac1 server/red_worker: renames to add channel_ prefix and consistent sig
s/disconnect_channel_proc/channel_disconnect_proc/
s/release_item_proc/channel_release_pipe_item_proc/
s/handle_message_proc/channel_handle_parsed_proc/

Adds RedChannel* channel as first parameter to hold_pipe_item_proc
2011-02-11 15:32:21 +02:00
Alon Levy
f8d3345ef7 server/red_worker: split cursor_channel_send_item
Split from cursor_channel_push
2011-02-11 15:32:21 +02:00
Alon Levy
67b3bf20d0 server/red_worker: use red_channel begin_send_message
s/red_begin_send_message/red_channel_begin_send_message/
2011-02-11 15:32:21 +02:00
Alon Levy
7d53a51da0 server/red_worker: add red_channel_init_send_data
Changes semantics of send to always hold/release regardless of block, like
red_channel. A hold is just a reference count increment or nop.
2011-02-11 15:32:21 +02:00
Alon Levy
859aa15806 server/red_worker: split display_channel_send_item
Split it out of display_channel_push.
2011-02-11 15:32:21 +02:00
Alon Levy
f8262c80ad server/red_worker: extract common_release_pipe_item from red_pipe_clear 2011-02-11 15:32:21 +02:00
Alon Levy
e588176dab server/red_worker: use red_channel pipe add versions
s/red_pipe_add/red_channel_pipe_add/
s/red_pipe_add_after/red_channel_pipe_add_after/
2011-02-11 15:32:21 +02:00
Alon Levy
a0a958c77b server/red_worker: shorten some lines using alias variables 2011-02-11 15:32:21 +02:00
Alon Levy
e8698ea0f8 server/red_worker: introduce CommonChannel
with everything (almost) not in red_channel's RedChannel

As a result of CommonChannel a free cb is added to EventHandler,
to take care of non zero offset for embedded EventHandler.
2011-02-11 15:32:20 +02:00
Alon Levy
9330dbac13 server/red_worker: use ack_data struct
start of move to red_channel based channels
2011-02-11 15:32:20 +02:00
Alon Levy
a185c1daf0 server/red_worker: change hold_item sig, drop the void*
changed to PipeItem *
2011-02-11 15:32:20 +02:00
Alon Levy
51da06793c server/smartcard: don't push our own error on reader add
The device already sends one. There are actually two connections going
on:
 server to client - this is the smartcard channel, it reuses the VSC protocol.
 server to device - this is an internal connection using VSC too.

We generally just passthrough all messages from the client to the device,
and from the device to the client. We only rewrite the reader_id because
the device knows about a single id (it is actually a card id), and we
may manage more then one in the future.

Bottom line is that there was an extra VSC_Error message reaching the client.
2011-02-09 12:11:51 +02:00
Alon Levy
c7c6f9aed0 server/smartcard: ignore VSC_Init from client 2011-02-07 21:32:40 +02:00
Alon Levy
612f9744df server/smartcard: print instead of assert on bad reader_id in smartcard_char_device_on_message_from_device 2011-02-07 21:32:40 +02:00
Alon Levy
fe83d01162 server/smartcard: libcacard uses network byte order, so we must too 2011-02-07 21:32:40 +02:00
Alon Levy
9d75e43226 server/smartcard: libcacard removed ReaderAddResponse 2011-02-07 21:31:23 +02:00
Alon Levy
4e48f65dc4 server/smartcard: s/reader_id_t/uint32_t/ (libcacard changed) 2011-02-07 20:27:35 +02:00
Alon Levy
8c17f83940 server/red_channel: style fix in red_channel_init_send_data 2011-02-07 19:22:44 +02:00
Alon Levy
c4d028510d server/red_channel: red_channel_pipe_clear: assert on NULL channel 2011-02-07 19:22:44 +02:00
Alon Levy
e9103c67ad server/red_channel: add TODO 2011-02-07 19:22:44 +02:00
Alon Levy
e655c5d26e server/red_channel: export red_channel_send 2011-02-07 19:22:44 +02:00
Alon Levy
10692e20ca server/red_channel: add red_channel_waiting_for_ack
small inline function to have the ack window logic.
2011-02-07 19:22:44 +02:00
Alon Levy
f45d17d68b server/red_channel: protect red_channel_push from NULL 2011-02-07 19:22:44 +02:00
Alon Levy
3476fe428d server/red_channel: reset pipe_size on clear (from red_worker) 2011-02-07 19:22:44 +02:00
Alon Levy
5062433d8a server/red_channel: red_channel_event: push on blocked
try to push either on signal (write available) or when blocked
and read signaled. From red_worker, copied for compatibility when
switching later to RedChannel in red_worker. Doesn't make a lot of
sense (but works), see comment in patch.
2011-02-07 19:22:44 +02:00
Alon Levy
23f13aa983 server/red_channel: use red_channel_receive 2011-02-07 19:22:44 +02:00
Alon Levy
a5afee2842 server/red_channel: add empty handle of SPICE_MSGC_DISCONNECTING
Simply ignored in red_channel_handle_message
2011-02-07 19:22:44 +02:00
Alon Levy
74d7405493 server/red_channel: add red_channel_receive (for red_worker) 2011-02-07 19:22:44 +02:00
Alon Levy
c0b7abaa48 server/red_channel: unstatic red_channel_pipe_clear (for red_worker) 2011-02-07 19:22:44 +02:00
Alon Levy
a30a602654 server/red_channel: unstatic red_channel_push (for red_worker) 2011-02-07 19:22:44 +02:00
Alon Levy
57b719b991 server/red_channel: two 80 column fixes 2011-02-07 19:22:44 +02:00
Alon Levy
33bede823a server/red_channel: add public red_channel_default_peer_on_error
for later use in red_worker
2011-02-07 19:22:44 +02:00
Alon Levy
c322873cf0 server/red_channel: add red_channel_pipe_add_after (from red_worker) 2011-02-07 19:22:44 +02:00
Alon Levy
23f37df548 server/red_channel: make client ack window configurable
from red_worker
2011-02-07 19:22:44 +02:00
Alon Levy
0512726b68 server/red_channel (tunnel): change sig of red_channel_handle_message
for later usage with red_worker
2011-02-07 19:22:44 +02:00
Alon Levy
26dda37c27 server/red_channel: make MAX_SEND_VEC 100
MAX_SEND_VEC was 100 for DisplayChannel's RedChannel implementation which is being replaced
with RedChannel in red_channel. So changing from 50 to 100 in red_channel
(make this configurble?) - effectively increased memory usage by:
(100-50)*sizeof(iovec)*(num_of_channels-2) ==(arch 64bit) 50*16*6 ~ 5k
Not terrible.
2011-02-07 19:22:44 +02:00
Alon Levy
b4c3b8a586 server/red_channel: reflect SpiceDataHeader fields in handle_parsed_proc 2011-02-07 19:22:44 +02:00
Alon Levy
194a6be5f7 server/red_channel: add red_channel_pipe_add_push 2011-02-07 19:22:44 +02:00
Alon Levy
7dfd7a0c77 server/red_channel: add hold_item (from red_worker)
hold_item called on init_send_data, matching release.
This is not the behavior of red_worker - we ref++ (==hold_item) when
sending the item, and --refs when releasing it, instead of only holding
if the send is blocked.

Note 1: Naming: hold_pipe_item is the proc name, the variable is called
hold_item, this is similar to release_item/release_pipe_item naming.

Note 2: All channels have empty implementation, we later use this when
red_worker get's RedChannelized.
2011-02-07 19:21:21 +02:00
Alon Levy
e571b5ebbb server/red_channel: add out_bytes_counter (unused) 2011-02-07 19:06:52 +02:00
Alon Levy
31db6ef8c2 server/red_worker: fix used but uninitialized warning (gcc 4.6.0) 2011-02-07 15:10:36 +02:00
Alon Levy
46c70521d5 client/server: warning fixes (gcc 4.6.0)
gcc 4.6.0 added "[-Werror=unused-but-set-variable]", this and the next
few fixes tend to that. Mostly harmless.
2011-01-25 17:22:48 +02:00
Alon Levy
d3b22d86f0 client/server: add missing USE_TUNNEL
disable some code that only makes sense when USE_TUNNEL is defined
in client and server channel security level setting.
2011-01-25 17:16:27 +02:00
Alon Levy
5a2ef3b21c client/server: add missing smartchannel channel security handling
The name to channel id mapping for the smartcard channel is missing,
add it in client and server.
2011-01-25 17:16:18 +02:00
Hans de Goede
c29e4f9dd8 Update license header for server/red_parse_qxl.c
This one mistakenly had a GPL header rather then an LGPL header.
2011-01-21 15:37:04 +01:00
Alon Levy
f16c2fccdd server/red_channel: fix segfault on red_channel_destroy if peer already removed 2011-01-16 11:59:08 +02:00
Alon Levy
2809d84724 server/inputs_channel: use outgoing marshaller in red_channel/RedChannel 2011-01-16 11:59:06 +02:00
Alon Levy
8fabff2a1e server/main_channel: use red_channel (most code is pipe send/marshall separation) 2011-01-15 20:54:48 +02:00
Alon Levy
444b322cab server/red_channel: no need for extra loop 2011-01-15 20:54:48 +02:00
Alon Levy
90c93eb3c1 server/red_channel: go marshaller for outgoing (copied from red_worker) 2011-01-13 06:56:54 +02:00
Alon Levy
e7e667f81d server/reds: don't remove agent if it's not connected 2011-01-13 06:56:54 +02:00
Alon Levy
26cd666be5 server/reds: protect reds_update_mouse_mode when main_channel is disconnected 2011-01-13 06:56:54 +02:00
Alon Levy
42522e0db9 server/reds: don't call close on NULL channel on atexit callback 2011-01-13 06:56:54 +02:00
Alon Levy
cd6c57e337 server/reds: fix possible segfault when accessing vdagent from reds_update_mouse_mode after vdagent set to NULL 2011-01-13 06:56:53 +02:00
Alon Levy
cdfa261dbb server/reds: s/reds_push_migrate_data_item/reds_marshall_migrate_data_item/ 2011-01-13 06:56:53 +02:00
Alon Levy
685f82a48e server: split main_channel from reds 2011-01-13 06:56:51 +02:00
Alon Levy
293f5f0df8 server/tests: split test_display_no_ssl to test_display_base, add streaming test 2011-01-10 14:11:37 +02:00
Alon Levy
2c16ef8f26 server/tests/test_display_no_ssl: add update_area, COPY_BITS to tested functions, make a queue of QXLCommandExt waiting (cursor still with production at get_command) 2011-01-10 14:11:37 +02:00
Alon Levy
92e4ab6d68 server/tests/test_display_no_ssl: add surface create/destroy test (commented out), and square mode (default) 2011-01-10 14:11:37 +02:00
Alon Levy
2124818788 server/tests: fix timer reset to allow setting next call during callback 2011-01-10 14:11:37 +02:00
Alon Levy
c1846506de server/tests/test_display_no_ssl: change color every circle 2011-01-10 14:11:37 +02:00
Alon Levy
618d13d4d1 server/tests/test_display_no_ssl: restart notify timer 2011-01-10 14:11:37 +02:00
Alon Levy
0707feca43 server/tests: basic_event_loop: reset timer after firing it 2011-01-10 14:11:37 +02:00
Alon Levy
9cdeac5da5 server/tests/test_display_no_ssl: disable cursor test until it works correctly 2011-01-10 14:11:22 +02:00
Alon Levy
4dcacefb06 server/test/test_display_no_ssl: add beginning of basic cursor item test. doesn't actually show anything on client. also, leaks. 2011-01-10 14:10:44 +02:00
Alon Levy
e62f4b6fc7 server/tests/test_display_no_ssl: make window 320x320, two colored updates, one in notify batch 2011-01-10 14:10:38 +02:00
Alon Levy
0438742dcc server/red_worker: use 1, not 4 when lz_encoding a top down image 2011-01-07 17:47:33 +02:00
Hans de Goede
c86fa96924 server: Update SPICE_SERVER_VERSION 2010-12-17 14:15:47 +01:00
Hans de Goede
926ee7a361 Makefiles: fix server/tests/test_util.h not being included in make dist 2010-12-17 14:14:39 +01:00
Hans de Goede
a96cea646a server: Update SPICE_SERVER_VERSION 2010-12-17 13:52:17 +01:00
Gerd Hoffmann
7bbc2ba090 move chardevs out of experimental
While we are at it:  There is no reason for chardev
support to stay in the experimental area, so move it out.
qemu should not need the "spice-experimental.h" file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-16 09:16:10 +01:00
Gerd Hoffmann
6acb817071 move switch-host migration out of experimental
seamless stays in the experimental area.
comments updates too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-16 09:16:10 +01:00
Gerd Hoffmann
4b1ea4e102 client migration: switch host
Implement server-side support for switch-host client migration.  Client
side support is present already in the tree.

Setting the migration information is done using the existing
spice_server_migrate_info() function.  A new
spice_server_migrate_switch() function has been added which triggers
sending out the switch-host message.

Seamless migration functions are left there for now.
spice_server_migrate_start() has been chamnged to just fail
unconditionally though as seamless migration is broken anyway.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-16 09:16:10 +01:00
Alon Levy
5d2aa8084e server/red_worker: fix worker->drawable_count
drawable_count was becoming negative. It tracks the number of
items in the worker->current_list ring. It was decremented correctly,
but incremented only in several cases. The cases it wasn't incremented
where:
 red_current_add_equal found an equivalent drawable
by moving the increment to where the item is added to current_list, in
__current_add_drawable, the accounting remains correct.

This has no affect other then correct accounting, as drawable_count isn't
used for anything.
2010-12-15 14:43:45 +02:00
Gerd Hoffmann
aafd8eea74 server: improve error handling
We should pass up errors instead of aborting.  Do that at least
for bind() failures which actually happen in real live due to the
tcp port being busy.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-12-09 14:50:36 +01:00
Alon Levy
8c6f94a679 server/tests: fix for AM_LDFLAGS introduction 2010-12-08 18:43:23 +02:00
Alon Levy
450278a299 server/tests: Makefile.am: use AM_LDFLAGS instead of LDFLAGS 2010-12-07 21:33:26 +02:00
Alon Levy
96da0a4819 server/inputs: return NULL on alloc_buf request for too large message 2010-12-07 21:32:34 +02:00
Alon Levy
380b5e9dd7 server/red_channel: error channel if alloc_msg_buf fails (returns NULL) 2010-12-07 21:32:34 +02:00
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
Alon Levy
40232f00ab server: bugfix - make vdi_port_write_retry reiterate if write_queue still not empty
The vdi_port_write_timer_started flag was not being reset, which prevented
another vdi_port_write_timer_start from actually starting the timer. Fix
is to change order of lines. This happens in the callback of the timer, so
no chance of double timer set.
2010-08-31 12:09:50 +03:00
Alon Levy
7166d95777 server: add subtype to SpiceCharDeviceInterface, use for vdagent 2010-08-31 11:00:50 +03:00
Alon Levy
061ec276ec server: rename SpiceVDIPort* to SpiceCharDevice* 2010-08-31 10:59:34 +03:00
Yonit Halperin
fbd874a464 server: fix red_current_flush to flush only the surface that was given as parameter
A side effect of the previous red_current_flush, which flushed all the surfaces, and was called on a new display channel connection, was
that red_handle_drawable_surfaces_client_synced sent the most updated surfaces images when needed. However, now, it should
explicitly call red_current_flush.
Moreover, since red_current_flush was called on a new display channel connection only if there was a primary surface,
if the connection of the display channel occurred at the moment of no primary surface, red_handle_drawable_surfaces_client_synced was buggy.
2010-08-30 18:53:29 +03:00
Gerd Hoffmann
b718f59d46 Bump versions.
Update #define in server/spice.h in preparation for the 0.6.0 release.
We also got some new functions, thus we have to increate the shared
lib minor number for spice-server.
2010-08-30 16:12:25 +02:00
Gerd Hoffmann
9681ebb671 Add config functions.
A bunch of configuration functions where never ported forward from
rhel-6 to upstream.  Add them so we can add qemu config options for
these settings.
2010-08-30 16:12:25 +02:00
Alon Levy
94028c1348 Merge commit 'ea298a14e1cde8b811baf6bd187287f18dde0dee' 2010-08-30 16:12:49 +03:00
Alon Levy
ea298a14e1 server: moved agent pipe headers to spice-protocol 2010-08-30 14:50:02 +03:00
Yonit Halperin
494f5d4e2c server: cleanups in destorying surfaces code 2010-08-30 10:12:16 +03:00
Yonit Halperin
27f18287e8 server: really wait for a surface to be destroyed, when calling destroy_surface_wait
Waiting till all the pipe items that are dependent on the surface will be sent.
This was probably the cause for freedesktop bug #29750.
2010-08-30 10:12:01 +03:00
Yonit Halperin
1c8ec8f1cf server: consider also PIPE_ITEM_UPGRADE when searching for drawables in red_clear_surface_drawables_from_pipe 2010-08-30 10:11:47 +03:00
Alexander Larsson
250203951b server: red_send_image() - append image data to right marshaller
The actual bitmap data was added to the main marshaller rather than
the submarshaller that pointed to the SpiceImage part. This made us
send too short messages failing demarshalling in the client.
2010-08-27 11:19:20 +02:00
Alexander Larsson
c13f931b5f server: red_send_image() initialize bitmap.flags
We're currently sending this to the network based on random memory.
2010-08-27 11:19:01 +02:00
Gerd Hoffmann
80bb4d95a0 zap more unused bits.
BufDescriptor isn't used at all.
Two AddBufInfo fields (slot_id and group_id) are not used any more.
2010-08-27 09:21:04 +02:00
Gerd Hoffmann
36a8113380 red_get_cursor: avoid extra copy 2010-08-27 08:43:44 +02:00
Gerd Hoffmann
81e14d76d1 fix red_cursur_flush segfault 2010-08-26 23:59:29 +02:00
Gerd Hoffmann
b274fcf3f5 zap dead typedefs 2010-08-26 23:41:42 +02:00
Gerd Hoffmann
465ecbb818 zap dead qxl chunk code 2010-08-26 23:39:14 +02:00
Gerd Hoffmann
a05741ce1b qxl parser: add cursor parsing 2010-08-26 23:37:24 +02:00
Gerd Hoffmann
ea2f97a810 qxl parser: complete QXL_SURFACE_CMD_CREATE parsing 2010-08-26 22:29:12 +02:00
Yonit Halperin
b9b5f8fd56 server: clean glz drawables when reseting qxl
When the we reset qxl, we destroy all srufaces. Since surfaces and glz
drawables are no longer dependent, we need to call red_display_clear_glz_drawables explicitly
in order to clear all our drawables references in the server.
2010-08-25 15:14:35 +03:00
Alexander Larsson
cbb9f700be server: Add missing break in switch case 2010-08-25 13:38:49 +02:00
Yonit Halperin
a960598e23 server: remove the no longer used glz drawables list that was maintained for each surface. 2010-08-24 10:10:36 +03:00
Yonit Halperin
1177718669 server: remove unnecessary dependency between surfaces and Glz drawables
Fixes freedesktop bug #28568
2010-08-24 10:10:10 +03:00
Alexander Larsson
2acc011c62 Fix mismerge in last commit 2010-08-23 16:56:17 +02:00
Alexander Larsson
0795368709 Remove USE_EXCLUDE_RGN define and !USE_EXCLUDE_RGN code 2010-08-23 16:34:41 +02:00
Alexander Larsson
7c25e23148 Remove STREAM_TRACE define and !STREAM_TRACE code 2010-08-23 16:34:41 +02:00
Yonit Halperin
f1299e0f35 Limiting video streaming to the primary surface. freedesktop bug #28088. 2010-08-23 13:31:51 +03:00
Alon Levy
c44b6acb09 server: add vdi_port write retry timer. RHBZ 616772 2010-07-22 11:14:26 +03:00
Alexander Larsson
e24d2094a4 Don't do manual marshalling for input channel 2010-07-21 10:14:06 +02:00
Alexander Larsson
bdeae7ffb2 server: Properly order rgb for 24bit bitmaps when sending to libjpeg
SPICE_BITMAP_FMT_24BIT order is bgr, libjpeg wants rgb.
This fixes freedesktop bug #28089
2010-07-20 14:05:36 +02:00
Alexander Larsson
5f664e0ffb Don't send padding over the network with video data 2010-07-20 11:33:57 +02:00
Alexander Larsson
12b08f2c3e codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using
the C struct array-at-end-of-struct. To make this work we also remove
all use of @end for switches (making them C unions).

We drop the zero member of the notify message so that we can avoid this
use of @end for a primitive in the marshaller (plus its useless to send
over the wire).

We change the offsets and stuff in the migration messages to real pointers.
2010-07-19 16:28:22 +02:00
Alon Levy
5cc9b924cb server vdi port: prevent recursive calls to read_from_vdi_port (required for spice-vmc) 2010-07-19 10:30:48 +03:00
Gerd Hoffmann
cc5b59e0f3 add SPICE_SERVER_VERSION
Allow to ifdef features which depend on a certain libspice-server release.
2010-07-14 19:01:41 +02:00
Yonit Halperin
c90183da94 server: enabling/disabling jpeg and zlib-over-glz via spice command line args 2010-07-14 12:16:23 +03:00
Gerd Hoffmann
b1761377d1 red_glz_compress_image: lines isn't needed any more 2010-07-13 10:11:48 +02:00
Alexander Larsson
f881a896a4 Don't marshall bitmap data as pointer, instead send inline 2010-07-09 16:52:36 +02:00
Alexander Larsson
1d119d527e Use the right enum types for bitmap_data.type comparisons 2010-07-09 12:02:15 +02:00
Alexander Larsson
633e962ac3 Make tunnel support optional in client too 2010-07-08 22:25:28 +02:00
Alexander Larsson
ceff16cad6 Make distcheck work 2010-07-08 20:20:35 +02:00
Alexander Larsson
0c505931dc Missed some misspelling fixes 2010-07-08 19:20:19 +02:00
Alexander Larsson
1a6e77d6d4 Fix various misspellings
letancy -> latency
compund -> compound
SpicedSubMessage -> SpiceSubMessage
modifaiers -> modifiers
massage -> message
outgoiong -> outgoing
AlphaBlnd -> AlphaBlend
remoth -> remote
modifires -> modifiers
secore -> secure
2010-07-08 18:26:37 +02:00
Alexander Larsson
4f54596e01 server: Remove unnecessary pci id/rev checks
There is no need to check the pci ids or revisions. Thats a contract
between qemu and the driver, and spice need not care, as long as
we get the right data from qemu.
2010-07-08 15:18:43 +02:00
Alexander Larsson
c60c995e60 Make all internal structures not be packed 2010-07-08 14:30:01 +02:00
Alexander Larsson
3c0329d27f Handle the new QXLCursorHeader type 2010-07-08 13:24:15 +02:00
Alexander Larsson
aa3d3db9f4 Use QXLPHYSICAL, not SPICE_ADDRESS in qxl parser 2010-07-08 13:11:31 +02:00
Alexander Larsson
31d2d6e4e4 Properly parse QXLLineAttrs.style 2010-07-08 12:43:33 +02:00
Gerd Hoffmann
fe4f90210f remove QXLInterface->has_command()
Not used any more, zap it before rolling up a release tarball.
2010-07-08 11:56:30 +02:00
Uri Lublin
b54037a1f4 server: add missing ifdef USE_OGL (red_worker.c) 2010-07-08 11:56:17 +02:00
Gerd Hoffmann
5ac88aa79f Properly parse QXLImage to the new-world SpiceImage
SpiceImage now replaces RedImage and has all image types in it.
All image data are now chunked (and as such not copied when demarshalling).
2010-07-07 23:58:33 +02:00
Alexander Larsson
f39d64f40b Convert SpicePath.segments to a pointer array 2010-07-05 20:45:13 +02:00
Gerd Hoffmann
3764a36472 Properly parse and marshall SpiceString 2010-07-02 16:47:51 +02:00
Alexander Larsson
007d128973 Update for the SpicePath.segments type change 2010-07-01 16:07:02 +02:00
Alon Levy
2ec023b892 - fix for noopengl patch for server
I still don't have commit access (can't ssh to anarchy) so if someone could commit this (alex) thanks,

Alon

Fix for no opengl patch - required to compile the server (fixes missing symbol gl_canvas_init).
2010-07-01 10:35:46 +02:00
Yonit Halperin
37b4ae4162 fix for not clearing the cursor ring when the primary surface is destroyed
fixes a crash in qxl_soft_reset
2010-07-01 10:32:25 +02:00
Alexander Larsson
00e1caf45d Simplify SpiceLineAttr by removing unsed stuff
Also in new protocol don't send style data if not needed.
2010-06-30 22:35:17 +02:00
Alexander Larsson
62d0c076eb Automatically marshall SpiceClipRects 2010-06-30 22:35:17 +02:00
Alexander Larsson
99f581ae56 Automatically marshall SpicePath 2010-06-30 22:35:17 +02:00
Alexander Larsson
a24a8ff72a Store SpicePath segment count rather than size
Internally and in the network protocol (for the new version) we
now store the actual number of segments rather than the size of the
full segments array in bytes. This change consists of multiple changes
to handle this:

* Make the qxl parser calculate num_segments
* Make the canvas stroke code handle the new SpicePath layout.
* Fix up is_equal_path in red_worker.c for the new layout
* replace multiple calls to spice_marshall_PathSegment with a single
  spice_marshall_Path call
* Make the byte_size() array size handling do the conversion from
  network size to number of elements when marshalling/demarshalling.
* Update the current spice protocol to send the segment count rather than
  the size
* Update the old spice protocol to use the new byte_size functionallity
  to calculate the size sent and the number of elements recieved
2010-06-30 22:35:17 +02:00
Gerd Hoffmann
f87f63fdf5 qxl-abi: handle clip rect and path references.
red_parse_qxl.c starts to follow QXLPHYSICAL references and build up
data structures.  Can zap a bunch of get_virt calls in red_worker.c,
followed by cleanups.

(de-) marshaller needs updates to deal with that.  Also I suspect with
the get_virt() calls being gone we can offload more work to generated
marshaller code.

client doesn't build.
2010-06-30 22:34:57 +02:00
Gerd Hoffmann
905c6283d5 add qxl chunk parser 2010-06-30 22:34:47 +02:00
Alexander Larsson
7627fba05d server: Don't call opengl if not enabled
If USE_OGL is not defined, really don't call or link in the opengl
backend.
2010-06-29 18:32:20 +02:00
Yonit Halperin
8d21bce435 remove unnecessary send of SPICE_MSG_DISPLAY_RESET
when SPICE_MSG_DISPLAY_RESET was sent, SPICE_MSG_DISPLAY_SURFACE_DESTROY had already
been sent for all surfaces.
It also caused a client crash since DisplayChannel::handle_reset assumes that screen
exists.
2010-06-29 13:59:46 +02:00
Gerd Hoffmann
58c23b6686 qxl abi: parse QXLRect. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
4fb61b9aa5 qxl abi: parse QXLPoint & friends. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
e7ec85a08f qxl abi: parse QXLCursorCmd. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
e03e4f0fc9 qxl abi: parse QXLSurfaceCmd. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
5de492e930 qxl abi: parse QXLMessage. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
fada35a173 qxl abi: parse QXLUpdateCmd. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
b081ec4b04 qxl abi: parse QXLClip. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
948806b583 qxl abi: parse QXLLineAttr. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
49f77eec2e qxl abi: parse QXLPattern. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
4de61f2dd8 qxl abi: parse QXLBrush. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
45ba74c795 qxl abi: parse QXLQMask. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
387f80422f qxl abi: parse QXLBlackness+QXLInvers+QXLWhiteness. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
21fffa15e1 qxl abi: parse QXLText. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
b39b130a84 qxl abi: parse QXLStroke. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
c26b574b40 qxl abi: parse QXLRop3. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
dffb0401e7 qxl abi: parse QXLTransparent. 2010-06-29 12:30:20 +02:00
Gerd Hoffmann
e81c6ef7c4 qxl abi: parse QXLCopy + QXLBlend.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:20 +02:00
Gerd Hoffmann
63e07be145 qxl abi: add missing QXLCopyBits 2010-06-29 12:30:19 +02:00
Gerd Hoffmann
08cfd6beaf qxl abi: parse QXLOpaque.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:19 +02:00
Gerd Hoffmann
ef3e20e29f qxl abi: parse QXLFill.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:30:19 +02:00
Gerd Hoffmann
85155b3f44 qxl abi: parse QXLAlphaBlnd (+Compat) 2010-06-29 12:30:19 +02:00
Gerd Hoffmann
856e2ba355 qxl abi: parse QXLCompatDrawable. 2010-06-29 12:30:19 +02:00
Gerd Hoffmann
11034dda42 qxl abi: parse QXLDrawable. 2010-06-29 12:30:19 +02:00
Gerd Hoffmann
c17fdfd053 improve memory slot error logging. 2010-06-29 12:30:19 +02:00
Alexander Larsson
7e26ff3c26 Replace log4cpp with custom log function
Also prints a simpler error to stderr for WARN or above so that
we print something on the commandline if something go wrong.
2010-06-28 21:54:53 +02:00
Alexander Larsson
9655dc30e9 Remove support for clip by path
This is not supported currently anyway and was not generated before.
2010-06-24 14:30:00 +02:00
Gerd Hoffmann
b6efc72001 drop bogous get_virt_delta calls 2010-06-23 13:49:21 +02:00
Alexander Larsson
9123e24e7b Add destructor for demarshalled messages
This is required because we don't want to free messages that just
refer to the unparsed message (like SpiceMsgData).

Also, in the future we might need it for more complex demarshalling.
2010-06-22 10:53:24 +02:00
Yonit Halperin
ae1de849ac fix for not reseting client palette caches on migration 2010-06-21 15:18:46 +02:00
Yonit Halperin
537280f183 Lossy compression of RGBA images (on WAN connection)
The RGB channels are compressed using JPEG.
The alpha channel is compressed using LZ.
2010-06-21 15:18:26 +02:00
Yonit Halperin
25bb38f643 applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
Alexander Larsson
0f2e037834 Add server/demarshaller.h 2010-06-18 20:27:32 +02:00
Alexander Larsson
972951dbb7 Make sound data @as_ptr to avoid copying data 2010-06-18 20:27:32 +02:00
Alexander Larsson
4c1094acce Make all message structs internal to spice
We move all message structs from spice-protocol to spice as
we want to be able to change these as needed internally. The
on-network format is no longer defined by these structures anyway,
but rather by the spice protocol description.
2010-06-18 20:27:32 +02:00
Alexander Larsson
c553fafe4b Use generated demarshallers in server 2010-06-18 20:27:32 +02:00
Alexander Larsson
ec10a1662f Generate demarshallers on server side 2010-06-18 20:27:32 +02:00
Alexander Larsson
d9772344e6 Re-enable cache freeing
I don't know why this was disabled but it seems like a bad idea
2010-06-18 20:27:32 +02:00
Alexander Larsson
04e0c6e5b2 Convert reds.c to use SpiceMarshaller 2010-06-18 20:27:31 +02:00
Alexander Larsson
8418da7ab2 Convert snd_worker.c to use SpiceMarshaller and generated marshallers 2010-06-18 20:27:31 +02:00
Alexander Larsson
cfc86f3340 Convert red_worker.c to use SpiceMarshaller for marshalling 2010-06-18 20:27:31 +02:00
Alexander Larsson
e2728082d0 Generate marshallers in server 2010-06-18 20:27:27 +02:00
Alexander Larsson
0cca1ed2af Add SpiceMarshaller for easy marshalling 2010-06-18 16:32:11 +02:00
Alexander Larsson
1ba1ce52ed Use the new enums for keyboard modifier flags 2010-06-18 16:32:10 +02:00
Yonit Halperin
3d7c1eaa18 server: optimize red_pipe_replace_rendered_drawables_with_images (lossy bitmaps support related) 2010-06-09 11:43:31 +02:00
Yonit Halperin
8b02360033 init/destroy lossy surface region 2010-06-09 11:41:02 +02:00
Yonit Halperin
ba32024ad1 enabling jpeg on low bandwidth connection 2010-06-09 11:41:02 +02:00
Yonit Halperin
1a752e3884 not using jpeg when sending a surface to the client (the whole surface)
When a surface is sent to the client using red_send_surface_image, operations were already
performed on it. Thus it may combine, especially if it is a primary surface, both "picture-like" areas
and areas that are more "artificial". In order to avoid noticeable artifacts, such surface will be sent lossless.
2010-06-09 11:41:02 +02:00
Yonit Halperin
0c199b0886 send qxl commands to client: support for resending lossy components when jpeg compression is enabled 2010-06-09 11:41:02 +02:00
Yonit Halperin
c970f41f8e infrastructure routines for resending to the client part of surfaces that have been sent lossy.
The code also handles cases in which the server doesn't hold anymore these surfaces parts, i.e., when
it holds a more updated version of them. This scenario is handled by replacing commands that were rendered, with images.
2010-06-09 11:41:02 +02:00
Yonit Halperin
5d01cae430 introducing lossy and lz compression in red_send_image 2010-06-09 11:41:02 +02:00
Yonit Halperin
2fc2f13be9 lossy surface regions in the client: infrastructure for tracking and updating 2010-06-09 11:41:02 +02:00
Yonit Halperin
5d2ae66f50 support for lossy images in the pixmap cache and fill bits
1) add an option to determine if a bitmap can be sent lossy to the client
2) when required, replacing lossy cache items with their correspending
   lossless bitmaps
2010-06-09 11:41:01 +02:00
Yonit Halperin
263646a1f7 JPEG support: introducing jpeg encoding for spice bitmaps 2010-06-09 11:40:25 +02:00
Yonit Halperin
ea74fc6454 server: fix bitmap flags assignment in red_send_image 2010-06-09 11:25:44 +02:00
Gerd Hoffmann
b0bb395576 sound: code style fixups 2010-05-26 08:41:24 +02:00
Alexander Larsson
f9da2720ae Fix some misspelled identifiers
severty -> severity
SpiceResorceID -> SpiceResourceID
SpiceResorceList -> SpiceResourceList
resorces -> resources
ped_size -> pad_size
postition -> position
2010-05-21 11:14:29 +02:00
Alexander Larsson
d69b0829a6 RedWorkeMessage -> RedWorkerMessage 2010-05-21 10:56:05 +02:00
Alexander Larsson
012bd25779 Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
Gerd Hoffmann
d351bb35ce sound channels: restart audio on client reconnect. 2010-05-21 09:28:25 +02:00
Alexander Larsson
0b76eae6eb Change leftover VD_INTERFACE_RECORD to SPICE_INTERFACE_RECORD 2010-05-19 14:55:41 +02:00
Alexander Larsson
2f10d6db46 Add missing backslash continuation in makefile 2010-05-19 12:30:00 +02:00
Gerd Hoffmann
d9084bfb64 Revert "[debug] migration troubleshooting"
This reverts commit 08927fabe5.
2010-05-19 12:09:22 +02:00
Gerd Hoffmann
f67b2e7488 complete NetWireInterface redesign, make red_tunnel_worker.c build. 2010-05-19 11:44:40 +02:00
Gerd Hoffmann
9204a5903a add spice-experimental.h
Supposed to be used for work-in-progress bits,
where interfaces are not finalized yet.

Moved over vdi port interface, tunnel interface
and spice client migration functions.
2010-05-19 11:22:08 +02:00
Gerd Hoffmann
981abd3fee zap vd_interface.h
move over content to spice.h
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
3f4d6c6ad6 vd_interface.h cleanups.
Drop leftover bits which are not used any more.
Rename DrawArea to QXLDrawArea.
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
5b0bc279c9 NetWireInterface: redesign 2010-05-19 11:22:07 +02:00
Gerd Hoffmann
a8419b00dc zap MigrationInterface
Remove remaining MigrationInterface bits.
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
cb5f500aa6 migration: new api
Add new API for migration, based on what RHEL-6 has.
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
08927fabe5 [debug] migration troubleshooting 2010-05-19 11:22:07 +02:00
Gerd Hoffmann
2303568581 zap migration code
Drop all code which depends on accessing the migration file handle.
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
20da2f162a replace worker load/save with loadvm_commands, allow keeping surface content
Add worker->loadvm_commands.  qemu will uses this to send a series of
commands needed to restore state after savevm/loadvm and migration.
That will be one create-surface command per surface and one cursor-set
command for the local pointer.

The worker->save/load functions are not needed any more.
Likewise the interface->{get,set}_save_data callbacks.

Surfaces created via loadvm_commands *will* not be cleared.  Also
primary surfaces are not cleared any more (unconditionally, although
we could do that conditionally on loadvm using the flags field in
QXLSurfaceCreate).
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
6bdf38daf8 surface: keep metadata (aka create command) in device memory.
With this patch applied the spice server will not release surface create
commands for the whole lifecycle of the surface.  When the surface is
destroyed both create and destroy commands are released.

This has the effect that the surface metadata (size, depth, ...) is kept
in qxl device memory.  This in turn makes it alot easier for qemu to
handle savevm/loadvm.  It just needs to do some minimal command parsing
and maintain pointers to the create commands for the active surfaces.
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
3cffcf98a1 kill spice_server_set_mouse_absolute
Not needed.  Just register/unregister the tablet interface instead.
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
ccfbbae513 vdi port: redesign.
Pretty straight forward.

One thing we should think about is if and how we are going to deal
with multiple ports here?

With vdi port using virtio-serial as communication channel to the guest
it is easy to have multiple ports, i.e. we might want to use a second
instance for clipboard data.  That implies that we need support for
multiple channels all the way through the stack ...
2010-05-19 11:22:07 +02:00
Gerd Hoffmann
2e47435ecb constify SpiceBaseInterface 2010-05-19 11:22:07 +02:00
Gerd Hoffmann
6fdcb9310d SoundInterfaces: redesign 2010-05-19 11:22:07 +02:00
Gerd Hoffmann
4701a063da TabletInterface: redesign 2010-05-19 11:22:07 +02:00
Gerd Hoffmann
d3735feea6 QXL: redesign. 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
58273e3a32 MouseInterface: redesign 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
4461c74918 KeyboardInterface: redesign.
This is the direction I wanna take with all interfaces:  Clearly
separate interface (aka version information and function pointers)
and state information.  SpiceKbdInterface defines the interface,
SpiceKbdInstance maintains per-instance state information.  Keyboard
hasn't much beside a pointer to SpiceKbdInterface, for other
interfaces this very likely will be different.
2010-05-19 11:22:06 +02:00
Gerd Hoffmann
10e6d8b53c s/CoreInterface/SpiceCoreInterface/ 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
30c740201d VDInterface: redesign.
VDInterface has been renamed to SpiceBaseInterface. Dropped base_version
element, shlib versioning should be used instead.  Dropped id element,
it is passed to spice_server_add_interface() instead.  Now
SpiceBaseInterface has static information only, multiple interface
instances can share it.

Added SpiceBaseInstance struct for maintaining per-instance state
information.  Adapted spice_server_{add,remove}_interface() functions
to the new world.
2010-05-19 11:22:06 +02:00
Gerd Hoffmann
a97875bc3f minor timer interface cleanups.
Make the timer interface largely look like the watch interface.
Simliar naming convention for the functions (timer_*) and a
opaque SpiceTimer type.
2010-05-19 11:22:06 +02:00
Gerd Hoffmann
536212322b new watch api: kill old api 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
a5145cc93e new watch api: switch channels 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
e8a2cca026 new watch api: switch sound 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
614fa00903 new watch api: switch migration 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
5549de4b10 new watch api: switch inputs 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
d54f1103fa new watch api: switch ssl accept 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
2dda5683b6 new watch api: switch main channel 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
1a69ea6627 new watch api: switch liasync read 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
d1ab29c1af new watch api: switch listening sockets 2010-05-19 11:22:06 +02:00
Gerd Hoffmann
4c67874a6d introduce new watch api
This patch adds a new file handle watch interface to libspice, featuring
three callbacks:

  (1) watch_add() -- create a new file watch.
  (2) watch_update_mask() -- change event mask.  spice frequently
                             enables/disables write notification.
  (3) watch_remove() -- remove a file watch.

libspice users must implement these functions to allow libspice
monitoring file handles.

The old interface (set_file_handlers) doesn't explicitly express the
lifecycle of a watch.  Also it maps 1:1 to a qemu-internal function.
In case the way qemu implements file watches changes (someone sayed
QemuIONotifier?) this will break horribly.  Beside that it is very
bad style.

Follwing patches will switch over users one by one to the new interface
and finally zap the old one.
2010-05-19 11:22:06 +02:00
Gerd Hoffmann
91f747ea1d fix visibility 2010-05-19 11:22:05 +02:00
Gerd Hoffmann
fe8b838341 zap CoreInterface->{term_printf,log}
Was used to print stuff to the qemu monitor.
Fundamentally incompatible with QMP.  Remove.
2010-05-19 11:22:05 +02:00
Gerd Hoffmann
3f7ea8e7a4 zap qterm interfaces
old way to handle monitor, obsolete.
2010-05-19 11:22:05 +02:00
Gerd Hoffmann
881c685f90 zap CoreInterface->(un)register_change_notifiers()
spice_server_add_interface() and spice_server_remove_interface()
can be used instead.
2010-05-19 11:22:05 +02:00
Gerd Hoffmann
df95728bf0 zap CoreInterface->next()
Interfaces must be registered after spice_server_init().
The "next" callback is used to discover interfaces
registered before spice_server_init().  Which is a empty
list and thus pretty pointless.  Remove it.
2010-05-19 11:22:05 +02:00
Gerd Hoffmann
43caec519e channel security cleanup
- drop spice_channel_name_t enum, use spice-protocol defines instead.
- switch spice_server_set_channel_security() channel parameter from
  enum to string.
- drop spice_server_set_default_channel_security(), use
  spice_server_set_channel_security with channel == NULL instead.
2010-05-19 11:22:05 +02:00
Gerd Hoffmann
edc1af5f67 zap spice_parse_args + spice_usage_str
First step to throw out the old interface.
2010-05-19 11:22:05 +02:00
Alexander Larsson
25bca7a286 Minor whitespace cleanup 2010-05-19 11:13:47 +02:00
Alexander Larsson
ee1e60c4a0 Make it --enable-tunnel work 2010-05-19 11:13:06 +02:00
Yonit Halperin
66a7c4a5e5 server: fix invalid self loop in surfaces dependencies.
Cyclic dependencies between surfaces mustn't occur. They can cause invalid rendering -
recent drawables might be rendered before older ones.
2010-05-03 16:40:37 +02:00
Dan Kenigsberg
270328e5c0 spice server: fix typo in private key error message 2010-05-03 16:40:37 +02:00
Alexander Larsson
ae40f270cf Remove all mentions of "cairo" from the code
The command line option is renamed from "cairo" to "sw", and
similarly all filenames and types from Cairo to Sw (and similar).
2010-05-03 12:38:02 +02:00
Alexander Larsson
295c8ed8bc Don't send alpha bytes for primary surface
The framebuffer is not used as a source for alpha blends, so we never
need to scan it for alpha bytes.
2010-04-30 09:54:01 +02:00
Gerd Hoffmann
7425253cec iovec: add sanity check
Adds sanity check to iovec setup.  In theory this should never ever
trigger.  In practice guest driver bugs can make it trigger.  This
patch avoids qemu burning cpu in a endless loop, instead we'll print a
message and abort.  Not sure whenever there is a more graceful way to
handle the situation ...
2010-04-29 18:20:15 +02:00
Gerd Hoffmann
ae8429d0c5 fix worker->stop surface cleanup 2010-04-29 18:19:56 +02:00
Alexander Larsson
42e83e3843 Add support for SPICE_IMAGE_FLAGS_HIGH_BITS_SET 2010-04-28 15:43:41 +02:00
Alexander Larsson
c2f38a68ba If we have alpha in a 32bit rgb surface, ensure we send that
If we don't then alpha is lost which is problematic if the surface
is later used as with alpha_blend and SRC_SURFACE_HAS_ALPHA.
2010-04-23 16:41:47 +02:00
Alexander Larsson
395b5a5626 Server: Use the right image format when updating from a surface 2010-04-23 16:41:47 +02:00
Alexander Larsson
4f5a09a73d Make each surface its own depth/format
Surface creation now specifies the exact format, not only the bit depth
of each surface which is used for rendering.

Additionally we now actually store the surfaces in that format, instead
of converting everything to 32bpp when drawing or e.g. handling palettes.
2010-04-23 16:41:42 +02:00
Alexander Larsson
98d91203c5 Make client canvas and pixmaps handle more formats and simplify
We now support 16bit format pixmaps as well as the old ones. Including
both 555 and 565 modes.

We drop the palette argument for pixmap construction as it was only
used for black/white anyway.

Canvas creation is simplified so that there is no separate set_mode
state. Canvases are already created in the right mode and never change.
2010-04-23 16:36:35 +02:00
Izik Eidus
99341e058f spice: server: change update_area command
The new command return dirty area to be used
by users that want spice to render localy or
into some framebuffer (sdl / vnc)

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-14 19:38:49 +03:00
Alexander Larsson
c97116aeb9 Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Alexander Larsson
288a9ad03f Use fast DCT method for better jpeg compression performance 2010-04-12 20:54:35 +02:00
Izik Eidus
ad1a4849ee spice server: fix validate_chunk
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-12 13:43:38 +03:00
Izik Eidus
03fb4e05be take the right lock when freeing glz stuff of surfaces
this was noticed by Yonit.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-09 22:47:03 +03:00
Alexander Larsson
34fb3f6806 Split out the memslot stuff from red_worker.c to its own files
This is required so that we can have code in other files that does address
validation.
2010-04-09 16:51:52 +02:00
Yonit Halperin
a3700a1bfb server: fix race condition in lz global dictionary, in its image segments list 2010-04-09 10:11:09 +02:00
Alexander Larsson
de4306af33 Initialize _kill_mark so we don't get spurious valgrind warnings 2010-04-08 17:09:32 +02:00
Izik Eidus
80e1379ff6 spice server: fix not sent depth size for surfaces
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-08 10:25:07 +03:00
Yonit Halperin
4acf155fb2 server configuration: make network redirection support optional
By default it is disabled. To enable: configure --enable-tunnel.
When active, requires libslirp.
2010-04-06 17:45:04 +02:00
Izik Eidus
cc943035c9 spice server: try to be less brutal when changing res or when flushing the tree
The idea is that we can try to defer some stuff to be later
send in the pipe if the pipe is not fulled yet, moreover
we will then walk on the pipe using:
red_clear_surface_drawables_from_pipe() and will try to
remove the uneeded objects of this surface

Still some room to improvment but later...

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-06 02:02:38 +03:00
Izik Eidus
da2afcff8c spice server: remove surface_id and surfaces_dest[3] from guest mem
Validate the surface_ids just once and keep them in safe
memory area

Make things simpler

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-06 01:11:59 +03:00
Izik Eidus
9076297d1d spice-server: when destroying a surface don`t send uneeded items
Just skip the items of destroyed surface that are found in the pipe
before we skip them, we check if they are needed by other users...

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-05 07:39:05 +03:00
Izik Eidus
2ae3ab9e09 spice-server: remove glz objects related to surface when destroying a surface
make the surface released faster in the release ring
as well as clean unneeded reference into the glz

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-05 05:39:39 +03:00
Izik Eidus
925140aa03 spice: reds: fix uninitlized pointer
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-05 05:33:14 +03:00
Izik Eidus
4a208b3644 libspice: add off screens support
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:35:31 +03:00
Izik Eidus
27a8ec1ef4 spice server: surface create/destroy protocol support
Now we can send commands from the server to the client
to destroy surfaces (right now just the primary surface)

Needed for offscreens support)

Another patch`s on the way.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:34:48 +03:00
Alexander Larsson
e9b5846704 Rename .so spice-server.so
Also change include dir to "spice-server" for consistency.

libspice.so conflicted with the tclspice package, and its also
a clarification for when we create a spice client library.
2010-03-24 17:13:42 +01:00
Alexander Larsson
4a36b98440 Get rid of more out-of-memory checks
We already check this in spice_malloc now
2010-03-24 15:57:33 +01:00
Yonit Halperin
66310f99e0 spice: server: Being more permissive in video identification
In 'filter' video streaming mode, use a more permissive threshold for distinguishing
'realistic' streams from 'textaul'/'artificial' streams. The previous threshold classified
streams that were scaled on the guest as artificial and thus they were not recoginized as videos.
2010-03-24 15:23:39 +01:00
Yonit Halperin
d2edac47cd spice: server: avoid video streaming of small images
I added a lower limit to the size of images that are being streamed.
The limit is only active in "filter" video streaming mode.
This will prevent blurry animated icons.
2010-03-24 15:23:07 +01:00
Alexander Larsson
dcef400d30 Fix uninitilized memory read in stroke_fill_spans()
y2 was not initialized
2010-03-18 10:40:18 +01:00
Gerd Hoffmann
b5f25486ef new libspice api: spice_server_add_get_{sock, peer}_info() 2010-03-18 10:26:01 +01:00
Gerd Hoffmann
7c1c66a10e new libspice api: spice_server_add_renderer() 2010-03-18 10:23:52 +01:00
Alexander Larsson
d94cb8e1ba Use spice allocator in server/ 2010-03-11 12:14:08 +01:00
Alexander Larsson
440ac41cf1 New memory allocators that exit on OOM and handle multiplication overflow
Every place that does a regular malloc/calloc and aborts on failure
should use spice_malloc/spice_mallo0 instead, which is leaner and cleaner.

Allocations of dynamically sized arrays can use g_malloc_n or g_new etc
which correctly handle multiplication overflow if some of the arguments
are not trusted.
2010-03-11 12:13:59 +01:00
Alexander Larsson
eccbe9bb1a Revert "Fix possible quic_usr_more_lines_unstable() crash"
This reverts commit 34e6a0a0d5.

Turns out this wasn't needed and the crash was due to other changes.
2010-03-10 12:06:41 +01:00
Gerd Hoffmann
52ec6a48ee new libspice api: add spice_server_set_mouse_absolute() 2010-03-09 14:56:37 +01:00
Gerd Hoffmann
593fb119bc new libspice api: add spice_server_set_channel_security() 2010-03-09 14:53:37 +01:00
Gerd Hoffmann
0c23da34c5 new libspice api: make spice_channel_name_t part of the public api. 2010-03-09 14:51:40 +01:00
Gerd Hoffmann
d60d3eda88 new libspice api: add spice_server_{get, set}_image_compression()
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-03-09 14:33:24 +01:00
Gerd Hoffmann
505f7d8832 new libspice api: make image_compression_t part of the public api. 2010-03-09 14:29:51 +01:00
Gerd Hoffmann
2e1b661434 new libspice api: configure listen addr, add ipv6 suppor 2010-03-09 14:23:57 +01:00
Gerd Hoffmann
b4f5752a0e new libspice api: configure tls 2010-03-09 14:22:19 +01:00
Gerd Hoffmann
1ecd01f586 new libspice api: zap function pointer indirection.
Make register_*_notifier calls optional, long term they should go away
entriely.  Add direct library calls as replacement.
2010-03-09 14:20:36 +01:00
Gerd Hoffmann
4e014aa13f new libspice api: configure port + ticket
Add new functions to configure spice port and ticketing.  Yes, this is
incomplete, it includes just the most important bits to get something
up'n'running.

These functions are supposed to replace both spice_parse_args() and
the monitor interaction via qterm interface.
2010-03-09 14:18:20 +01:00
Gerd Hoffmann
232dbd8710 new libspice api: alloc, initi and free spice server instances.
The implementation can't handle multiple spice server instances at the
same time right now.  The API allows this though, so if we fixup the
implementation some day we don't have to change the API.
2010-03-09 14:14:02 +01:00
Gerd Hoffmann
34e6a0a0d5 Fix possible quic_usr_more_lines_unstable() crash
quic_usr_more_lines_unstable() assumes it can allways copy a complete
scanline.  Well, it can't.  In case the screen rectangle which needs
updating has an x-offset greater than zero *and* includes the last
scanline of the screen it will overflow the source buffer by
x-offset * bytes-per-pixel bytes.
2010-03-09 13:38:13 +01:00
Alexander Larsson
90c5766caf Use macros from <spice/macros.h> rather than duplicate them 2010-03-09 11:10:00 +01:00
Alexander Larsson
f8217d8b96 Move virtualization of canvas drawing into common/canvas_base
Instead of having two virtualizations of the canvas we push the
virtualization into the canvas code itself. This not only avoids
the duplication of this code, it also makes the exposed API for the
canvas much smaller (in terms of exported API).

It also lets us use the virtualization to implement basic support
for operations in canvas_base which is then overridden by each canvas
implementation.
2010-03-08 19:45:28 +01:00
Alexander Larsson
05697e502d Make virt mapping an interface 2010-03-08 19:45:28 +01:00
Alexander Larsson
f7a77f9881 Make glz_decoder non-optional canvas_base in canvas constructors
It can still be NULL, but we simplify the headers by always including it.
There is no practical performance difference here.
2010-03-08 19:45:27 +01:00
Alexander Larsson
239b2b66b2 Remove qcairo dependency, only use pixman 2010-02-23 22:52:06 +01:00
Alexander Larsson
7992266ccf Remove cairo_t from cairo canvas 2010-02-23 22:52:06 +01:00
Alexander Larsson
98dde80ed3 Replace custom region implementation with pixman_region32_t
pixman_region32_t is an efficient well tested region implementation (its
the one used in X) that we already depend on via pixman and use in
some places. No need to have a custom region implementation.
2010-02-23 22:52:06 +01:00
Alexander Larsson
16780a7b81 Use pixman_image_t instead of cairo_surface_t as the generic pixman container
This allows us to use the simpler dependency of pixman outside of the
cairo backend, and it later lets us move the cairo backend to using
pixman only.
2010-02-23 22:52:01 +01:00
Alexander Larsson
0b0342ee7e Turn image and palette cache into c style dynamic interface
Instead of passing a bunch of function pointer and an opaque
pointer we make a real type and add a vtable pointer to it.
This means we can simplify all the canvas constructors, etc.
2010-02-23 14:43:20 +01:00
Alexander Larsson
60a189f250 Add line rasterizer 2010-02-23 14:43:20 +01:00
Alexander Larsson
9091e763a8 Add pixman utilities
This includes:
 * pixman region from SpiceRects
 * rop2 enum
 * solid fill
 * solid fill with rop
 * tiled fill
 * tiled fill with rop
 * blit
 * blit with rop
 * copy rect
2010-02-23 14:43:15 +01:00
Alexander Larsson
39be5a8b13 Use standard int types and <spice/types.h> 2010-02-04 18:49:05 +01:00
Alexander Larsson
16540e9953 Use the new header names
I just ran:
 find -name "*.[ch]" | xargs sed -i -f ../spice-protocol/includes.sed
 find -name "*.cpp" | xargs sed -i -f ../spice-protocol/includes.sed
2010-02-04 18:49:05 +01:00
Alexander Larsson
1f51697852 Rename symbols that were changed in spice-protocol
This is an automatic change using:
$ find -name "*.[ch]" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
$ find -name "*.cpp" | xargs ../spice-protocol/rename-identifiers.sh ../spice-protocol/renames
2010-02-04 18:49:00 +01:00
Alexander Larsson
3d84818a7b Depend on spice-protocol module
This doesn't actually use the new module, just sets it up for use.
2010-02-04 16:54:17 +01:00
Izik Eidus
2ba69f9f88 libspice: add surface 0 support
This include alot of infestracture for off screens.

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-01-28 04:46:29 +02:00
Yonit Halperin
3eae1c80d9 server,client: server authentication for secured channels.
3 available mechanisms:  by public key, by host name, and by certificate subject name.
In the former method, chain of trust verification is not performed.
The CA certificate files are looked for under <spice-config-dir>/spice_truststore.pem

windows <spice-config-dir>=%APPDATA%\spicec\
linux <spice-config-dir>=$HOME/.spicec/
2010-01-11 19:10:54 +02:00
Yaniv Kamay
81945d8971 server: add new vd interface QTerm2Interface 2010-01-06 19:05:36 +02:00
Izik Eidus
3e1d328e37 spice: fix server crush in case connecting without qxl device
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-12-24 00:26:52 +02:00
Izik Eidus
cb0cd69933 spice: fix ssl compiling errors
(openssl api was changed, so lets have ifdef to compile in all cases)

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-12-22 21:39:17 +02:00
Yaniv Kamay
aa1481378f spice: sever: increase client timeout
Increase client timeout in order to prevent unnecessary
disconnecting of client while the connection is over WAN.

Tested by changing WinXP resolution (with desktop background) while
connecting over WAN (1.5Mbit 150Kbit)
2009-12-21 19:24:47 +02:00
Yaniv Kamay
31dff987ec spice: sever: remove assert on nop copy bits 2009-12-21 13:28:15 +02:00
Yonit Halperin
00d5bf8b95 spice server: heuristic for distinguishing between "real" videos and textual streams 2009-11-30 18:45:06 +02:00
Izik Eidus
a70110c4e5 spice: server: add memslots support.
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-11-23 20:54:11 +02:00
Izik Eidus
4c72ba138c spice server: fix gl
red_worker: put invalidate at the right places

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2009-11-09 17:41:30 +02:00
Yaniv Kamay
c12c3facbd fix build on Debian 2009-10-26 23:30:41 +02:00
Yonit Halperin
ef213c66c1 tunnel 2009-10-18 17:42:37 +02:00
Yaniv Kamay
c1b79eb035 fresh start 2009-10-14 15:06:41 +02:00