Commit Graph

754 Commits

Author SHA1 Message Date
Alon Levy
5cbffe794f Release 0.11.0
Current bumped and age bumped for new intefaces only (no backward
incompatible changes).

New libtool version is 2.0.1, using --version-info instead of
--version-name. Doing the version change and --version-name to
--version-info change here to avoid changing the libtool version twice.

Added interfaces:
    spice_server_set_name
    spice_server_set_uuid
    spice_server_set_listen_socket_fd
    spice_server_is_server_mouse

New library name in linux:
    libspice-server.so.1.1.0
Old:
    libspice-server.so.1.0.2
2012-06-12 17:55:28 +03:00
Alon Levy
2465a8d801 server/red_channel: s/channle/channel 2012-06-07 12:26:05 +03:00
Alon Levy
70c706e0b5 server/spice.h: s/Pleaes/Please/ 2012-06-05 15:44:36 +03:00
Yonit Halperin
858a1aaa34 server/red_channel: do not attempt to write if the channel client is disconnected
The red_channel_client_event call to red_channel_client_receive might result
in a disconnected channel client. The following call to
red_channel_client_push may call to red_peer_handle_outgoing with a
disconnected socket.
2012-05-31 09:58:02 +03:00
Yonit Halperin
2d2121a170 server/red_channel: fix possible access to released channel clients
Added ref count for RedChannel and RedChannelClient.

red_channel.c/red_peer_handle_incoming call to
handler->cb->handle_message might lead to the release of the channel
client, and the following call to handler->cb->release_msg_buf will be
a violation.

This bug can be produced by causing main_channel_handle_parsed
call red_client_destory, e.g., by some violation in
reds_on_main_agent_data that will result in a call to reds_disconnect.
2012-05-31 09:39:14 +03:00
Yonit Halperin
d691602784 server/red_worker: fix red_wait_pipe_item_sent
Resolves: rhbz#824384

red_wait_pipe_item_sent mistakingly returned without waiting for sending the given pipe item
when the channel wasn't blocked. As a result, we failed when we had to
destroy a surface (e.g., QXL_IO_DESTROY_ALL_SURFACES) and to release all
the drawables that are depended on it (by removing them or waiting they will be sent).
In addition, red_wait_pipe_item_sent increased and decreased the reference to the pipe item
using channel_cbs->hold_item, and channel_cbs->release_item. However,
these calls can be called only by red_channel, otherwise
display_channel_client_release_item_before_push is called twice and
leads to a double call to ring_remove(&dpi->base).
Instead ref/put_drawable_pipe_item should be called.
2012-05-24 11:23:00 +03:00
Yonit Halperin
c59b2884a2 server/red_channel: remove red_channel_client_item_being_sent
The above routine was risky, since red_channel_client_init_send_data
can also be called with item==NULL. Thus, not all pipe items can be tracked.
The one call that was made for this routine was not necessary.
2012-05-24 11:00:33 +03:00
Yonit Halperin
038ae54b1c server: handle red_channel_client_create returning NULL 2012-05-21 09:08:50 +03:00
Yonit Halperin
1b9162b5cf server/red_channel: prevent creating more than one channel client with the same type+id 2012-05-21 09:08:42 +03:00
Yonit Halperin
720d316153 server/video: do not allow non-streamable drawables be stream candidates
Resolves: rhbz#820669

Fix a segfault caused by a call to __red_is_next_stream_frame made by
red_stream_maintenance, with a drawable that is not a DRAW_COPY one.
The segfault is a reault of __red_is_next_stream_frame accessing
red_drawable->u.copy.src_bitmap for a non DRAW_COPY drawable.
2012-05-21 08:58:38 +03:00
Yonit Halperin
dd0d4959bb server/tests: test_display_streaming - test wide sized frames
Before, we tested only higher frames, while wider frames would have
triggered a bug in mjpeg_encoder, when spice is linked with libjpeg and
not libjpeg-turbo.
2012-05-16 08:55:11 +03:00
Yonit Halperin
d0a57ac22b server/mjpeg_encoder: realloc encoder->row, when a wider frame is given
Fix crashes when there are sized wider frames in the stream, and we are
linked with libjpeg.

Related : rhbz#813826
Resolves: rhbz#820669
2012-05-16 08:55:11 +03:00
Alon Levy
05f4276cc1 server: move self_bitmap_image to RedDrawable
Simplify keeping count of self_bitmap_image by putting it in
RedDrawable. It is allocated on reading from the command pipe and
deallocated when the last reference to the RedDrawable is dropped,
instead of keeping track of it in GlzDrawable and Drawable.
2012-05-15 18:01:54 +03:00
Alon Levy
cc1fd8eae7 server/red_worker/put_red_drawable: s/drawable/red_drawable/ 2012-05-15 18:01:51 +03:00
Alon Levy
c6bb40947f server/red_worker/red_handle_self_bitmap: add red_drawable local, one extra whitespace line removed 2012-05-15 18:01:47 +03:00
Alon Levy
96bfcea965 server/red_worker: rename SpiceImage *self_bitmap to self_bitmap_image 2012-05-15 18:01:42 +03:00
Alon Levy
8f65b3fb36 Revert "server/red_worker: fix possible leak of self_bitmap"
This reverts commit 35dbf3ccc4.

accidentally pushed v1 of patches, reverting in preperation of pushing
v2.
2012-05-15 18:01:04 +03:00
Alon Levy
35dbf3ccc4 server/red_worker: fix possible leak of self_bitmap
After the previous patch moving self_bitmap freeing inside red_drawable
ref count, we have a possible self_bitmap leak:

red_process_commands
 red_get_drawable | red_drawable #1, red_drawable->self_bitmap == 1
  red_process_drawable | rd #2, d #1, d->self_bitmap != NULL
   release_drawable | rd #1, d# = 0, try to release self_bitmap, but
                        blocked by rd #1
  put_red_drawable | rd #0

This patch moves the call to release_drawable after the call to
put_red_drawable, thereby fixing the above situation.
2012-05-14 14:39:10 +03:00
Alon Levy
bab771c10d server/red_worker/red_process_commands: rename drawable to red_drawable (later add a local drawable) 2012-05-14 14:36:33 +03:00
Alon Levy
c8cefd4a8f server/red_worker: red_process_drawable: have single point of exit 2012-05-14 14:32:23 +03:00
Yonit Halperin
6935bd3d60 server/red_worker: don't release self_bitmap unless refcount is 0
RHBZ: 808936
2012-05-14 10:33:31 +03:00
Yonit Halperin
c211774422 server/mjpeg_encoder: fix wrong size assigned to dest_len
It should have been the allocated size and not the occupied one.
This led to a lot of unnecessary allocations and deallocations.
2012-05-10 14:06:59 +03:00
Yonit Halperin
fecc1e3d4d server/mjpeg_encoder: Fix memory leak for the inital output buffer given for each frame 2012-05-10 14:01:04 +03:00
Alon Levy
ce8e865cf1 server/reds: add "usbredir" to recognized channel names
RHBZ: 819484

Signed-off-by: Alon Levy <alevy@redhat.com>
2012-05-07 14:37:50 +03:00
Yonit Halperin
4c88034845 server/tests/test_display_streaming: include tests for clip and sized frames
CC: Alon Levy <alevy@redhat.com>
2012-05-03 13:09:54 +03:00
Yonit Halperin
c44726bd5f server/tests: use the correct dimensions in SIMPLE_UPDATE 2012-05-03 13:09:54 +03:00
Yonit Halperin
a267a4b315 server/tests: add SLEEP command to test_display_base 2012-05-03 13:09:53 +03:00
Yonit Halperin
bccf5bc35a server/tests: add clip to SIMPLE_DRAW_BITMAP 2012-05-03 13:09:53 +03:00
Alon Levy
3373cda434 server/tests/test_display_streaming: update to create sized frames 2012-05-03 13:09:52 +03:00
Alon Levy
8778b8eb2c server/tests: add SIMPLE_DRAW_SOLID and SIMPLE_DRAW_BITMAP 2012-05-03 13:09:51 +03:00
Alon Levy
76fd64ad96 server/tests: refactor Command 2012-05-03 13:09:51 +03:00
Alon Levy
703f32cda9 server/tests: add test_get_width/test_get_height 2012-05-03 13:09:50 +03:00
Alon Levy
2f02599e6a server/tests: refactor test_display_base 2012-05-03 13:09:50 +03:00
Yonit Halperin
8c9114f9f4 server/red_worker/video: don't override the clip in areas that belong only to sized frames 2012-05-03 13:09:49 +03:00
Yonit Halperin
318dce4abb server/red_worker.c/video: add support for frames of different sizes
rhbz #813826

When playing a youtube video on Windows guest, the driver sometimes(**) sends
images which contain the video frames, but also other parts of the
screen (e.g., the youtube process bar). In order to prevent glitches, we send these
images as part of the stream, using SPICE_MSG_DISPLAY_STREAM_DATA_SIZED.

(**) It happens regularly with the you tube html5 player. With flash,
it occurs when moving the cursor in the player area.
2012-05-03 13:07:01 +03:00
Yonit Halperin
0f1fb0ecc2 Update the spice-common submodule
spice-common changes: STREAM_DATA_SIZED message was added in order to support
video streams with frames that their size is different from the initial size
that the stream was created with.

This patch also includes server and client adjustments to the new
SpiceMsgDisplayStreamData.
2012-05-03 12:31:03 +03:00
Yonit Halperin
21b857f3ce server/red_worker/video: don't detach a drawable from a stream due to it being rendered.
The previous patch took care that streams will be upgraded by a surface
screenshot and not the last frame, if necessary. Thus, there is no
more a reason for detaching drawables from streams when they are
rendered. Moreover, detaching such drawables can cause glitches, in
case they are still in the pipe, and red_update_area is called
frequently and leads to stream frames rendering.
2012-05-03 12:31:02 +03:00
Yonit Halperin
81fe00b08a server/red_worker/video: upgrade stream by a screenshot instead of the last frame, if needed
Upgrading a stream: When the stream's visible region is bigger than the one of the last
frame, we will send an updated screenshot of the visible region, instead
of sending the last frame losslessly.
2012-05-03 12:30:59 +03:00
Yonit Halperin
80f0865b44 server/red_worker/video: maintain visible region and clip region for streams
Differentiate between the clipping of the video stream, and the region
that currently displays fragments of the video stream (henceforth,
vis_region). The latter equals or contains the former one. For example,
let c1 be the clip area at time t1, and c2 be the clip area at time t2,
where t1 < t2. If c1 contains c2, and at least part of c1/c2, hasn't been
covered by a non-video images, vis_region will contain c2, and also the part
of c1/c2 that still displays fragments of the video.
When we consider if a stream should be "upgraded" (1), due to its area
being used by a rendering operation, or due to stopping the video, we
should take into account the vis_region, and not the clip region (next
patch: not upgrade by the last frame, but rather by vis_region).
This fix will be more necessary when sized frames are introduced (see the
following patches). Then, the vis_region might be larger
than the last frame, and contain it, more frequently than before.

(1) "upgrading a stream" stands for sending its last frame losslessly. Or more
precisely, lossless resending of all the currently displayed lossy areas, that were
sent as part of the stream.
2012-05-03 12:30:55 +03:00
Yonit Halperin
3ccc9de184 server/red_worker: add get_stream_id 2012-05-03 12:30:54 +03:00
Jeremy White
8d3ebe31dd Force 64 bit multiplication on 32 bit systems; fixes a bug where the server times out the display channel freakily fast. 2012-04-27 11:29:31 +03:00
Daniel P. Berrange
ef78242e19 Add some more 'noreturn' annotations
Methods which longjump, unconditionally raise an
exception, or call _exit()  cannot return control
to the caller so should be annotated with 'noreturn'

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 11:31:14 +01:00
Daniel P. Berrange
49e2b2679f Fix typo in is_equal_brush
The 3 part of the conditional in the is_equal_brush method
compared the b1->u.color field to itself, instead of b2->u.color

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 11:31:14 +01:00
Daniel P. Berrange
e71cb83680 Ensure config.h is the first include in the file
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:49:34 +01:00
Daniel P. Berrange
39565707a9 Make some int->pointer casts explicit
Tell the compiler that was really do intend to cast from int
to pointer, to prevent warnings about implicit casts

* server/tests/test_display_base.c: Add explicit casts

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:49:25 +01:00
Daniel P. Berrange
7af613362a VSCMsgHeader.reader_id is unsigned, so don't check for >= 0
* server/smartcard.c: Fix assertion to not check for >= 0 on
  unsigned variable

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00
Daniel P. Berrange
84c7a95c22 Avoid jumping across variables declarations with initializers
If a 'goto' statement jumps across a variable declaration
which also has an initializer, the variable is in an undefined
state. Splitting the the declaration & initialization doesn't
change that, but the compiler can at least now detect use of
the unintialized variable

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00
Daniel P. Berrange
3be7df0980 Convert cases of () to (void)
* server/reds.c, server/smartcard.c: s/()/(void)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00
Daniel P. Berrange
93d8ca8191 Remove 2 *MB* stack frame in red_worker_main
The red_worker_main method allocates a RedWorker struct instance
on the stack. This struct is a full 2 MB in size which is not
at all resonable to allocate on the stack.

* server/red_worker.c: Move RedWorker struct to the heap

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00
Daniel P. Berrange
eeb2b65a7d Mark some variables as volatile
When using setjmp/longjmp the state of local variables can be
undefined in certain scenarios:

[quote man(longjmp)]
       The values of automatic variables are unspecified  after  a
       call to longjmp() if they meet all the following criteria:

       ·  they are local to the function that made the correspond‐
          ing setjmp(3) call;

       ·  their values are changed between the calls to  setjmp(3)
          and longjmp(); and

       ·  they are not declared as volatile.
[/quote]

* server/red_worker.c: Mark some vars as volatile

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:42:15 +01:00