Commit Graph

1402 Commits

Author SHA1 Message Date
Francois Gouget
bd2bbe2fdd server: Include stdint.h for int64_t
This fixes a compilation error with gcc 4.4 on RHEL 6.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-16 10:21:14 +00:00
Francois Gouget
dc169cea90 server: Remove the display_channel_attach_stream() prototype
It is unused.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-13 17:36:30 +00:00
Marc-André Lureau
105fad7e87 worker: don't use weird RedCompressedBuf nbytes shifting
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-13 13:43:35 +00:00
Victor Toso
08230ee171 spicevmc: set state of DeviceInstance to NULL
After spice_char_device_state_destroy is called spicevmc should not keep
reference to that memory. state->chardev_st and sin->st point to the
same SpiceCharDeviceState and both should be set to NULL when it is
destroyed.
2015-11-13 12:01:26 +01:00
Victor Toso
c429574bb6 char-device: set to NULL freed pointers on destroy
As SpiceCharDeviceState is only unref'ed on
spice_char_device_state_destroy the same device could be destroyed more
then once so the pointers that are freed should be set to NULL.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1281455
2015-11-13 12:01:26 +01:00
Pavel Grunt
57fe8ce268 reds: Do not abort due to wrong header
Just prevent the buggy client from connecting.

 #0  0x00007fffe83b2a98 in raise () at /lib64/libc.so.6
 #1  0x00007fffe83b469a in abort () at /lib64/libc.so.6
 #2  0x00007ffff7b1533d in spice_logv (log_domain=0x7ffff7b87226 "Spice", log_level=SPICE_LOG_LEVEL_ERROR, strloc=0x7ffff7b92aba "reds.c:1373", function=0x7ffff7b94f40 <__FUNCTION__.31775> "reds_send_link_ack", format=0x7ffff7b871fe "assertion `%s' failed", args=args@entry=0x7fffffffcb68) at log.c:109
 #3  0x00007ffff7b15468 in spice_log (log_domain=log_domain@entry=0x7ffff7b87226 "Spice", log_level=log_level@entry=SPICE_LOG_LEVEL_ERROR, strloc=strloc@entry=0x7ffff7b92aba "reds.c:1373", function=function@entry=0x7ffff7b94f40 <__FUNCTION__.31775> "reds_send_link_ack", format=format@entry=0x7ffff7b871fe "assertion `%s' failed") at log.c:123
 #4  0x00007ffff7aee335 in reds_handle_read_link_done (link=0x555556b27c70)
     at reds.c:1373
 #5  0x00007ffff7aee335 in reds_handle_read_link_done (opaque=0x555556b27c70)
     at reds.c:2139
 #6  0x000055555588acc6 in qemu_iohandler_poll ()
 #7  0x000055555588a8e1 in main_loop_wait ()
 #8  0x0000555555614064 in main ()

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1281442

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-13 09:15:02 +00:00
Victor Toso
a263c651e1 char-device: free all memory pool when no clients
When no client is connect we should not need to keep the memory pool
used by char-device. In most situations this is not significant but
when using webdav this could mean freeing MAX_POOL_SIZE bytes

Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350
2015-11-13 08:15:38 +01:00
Victor Toso
2832fdf25a char-device: Define a memory pool limit
Otherwise the amount of unused memory could grow while transfering big
chunks of data. This change only means that once the memory was used it
will not be stored again after the limit was reached.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350
2015-11-13 08:15:38 +01:00
Victor Toso
d7bee1bc56 char-device: fix usage of free/unref on WriteBuffer
There are places were the could should definetly free the
SpiceCharDeviceWriteBuffer and places that it should only unref it. The
current use of spice_char_device_write_buffer_free was missleading.

This patch creates the spice_char_device_write_buffer_unref and properly
call these two functions.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=91350
2015-11-13 08:14:31 +01:00
Frediano Ziglio
1ab8df03ce worker: fix compiling with COMPRESS_STAT enabled
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-12 13:25:09 +00:00
Pavel Grunt
f4810b0065 worker: Remove usage of streaming_video global in DisplayChannel
Avoid creating streams for every image due to not properly initialized
DisplayChannel->stream_video field.

Regression since: 4987df8e67

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-12 12:32:27 +00:00
Marc-André Lureau
120c9ae38b worker: move some tree container functions
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-12 12:26:47 +00:00
Marc-André Lureau
cc8107c830 worker: rename a bit current_add functions
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-12 12:09:34 +00:00
Jonathon Jongsma
6380c43258 worker: Remove duplicate DISPLAY_CLIENT_TIMEOUT define
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-11 15:48:56 +00:00
Marc-André Lureau
7b1d03508d worker: move RED_WORKER_STAT, make it compile again
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-11 15:42:10 +00:00
Jonathon Jongsma
892feff458 worker: Move drawable utility functions to display channel
Functions that check the equality of a path, brush, etc are moved the
display channel source file to prepare for moving the surfaces to the
display channel.

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-11 12:01:29 +00:00
Jonathon Jongsma
0e7617e51f worker: Move is_opaque_item() to tree.h
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-11 11:59:58 +00:00
Marc-André Lureau
a7fc621750 worker: move drawable to display
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-11 09:53:40 +00:00
Marc-André Lureau
7b3f277a72 worker: move current to display
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-10 17:38:48 +00:00
Marc-André Lureau
4a1668a755 worker: move red_destroy_surface_item()
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-10 17:38:48 +00:00
Marc-André Lureau
4987df8e67 worker: move stream to display channel
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-10 17:38:39 +00:00
Marc-André Lureau
5a216d2eb1 worker: move DisplayChannel/DisplayChannelClient functions together
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-10 17:18:45 +00:00
Marc-André Lureau
921ec344bc worker: rename functions that handle DisplayChannelClient
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:10:07 +00:00
Marc-André Lureau
885557f117 worker: move stream functions to a new stream.c file
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:09:28 +00:00
Marc-André Lureau
1e4abdc15d worker: move stream definitions to a new stream.h file
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:06:08 +00:00
Marc-André Lureau
ab2e8a9cc0 worker: fix RED_STREAM_TIMOUT macro spelling
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 15:43:22 +00:00
Frediano Ziglio
1763e7ebf2 remove server/stream.h file added by mistake in previous commit
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2015-11-10 15:42:08 +00:00
Marc-André Lureau
face40e19e worker: move image cache to display
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-10 10:02:08 +00:00
Marc-André Lureau
1b9d767ca7 worker s/surfaces_dest/surface_deps
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-10 09:35:42 +00:00
Pavel Grunt
0426524546 syntax-check: Add missing #include <config.h> 2015-11-09 19:41:28 +01:00
Pavel Grunt
1eb94c0fb0 red_dispatcher: Remove unused signal.h include 2015-11-09 19:41:22 +01:00
Marc-André Lureau
9c57505849 worker: group add_memslot
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-09 17:03:34 +00:00
Marc-André Lureau
873639abf7 worker: remove unused NUM_CURSORS define
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-09 16:59:28 +00:00
Marc-André Lureau
66ed1f63b8 worker: make more functions static
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2015-11-09 14:51:19 +00:00
Marc-André Lureau
df716c5c53 worker: remove unused function
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2015-11-09 14:50:45 +00:00
Marc-André Lureau
7eee2de67c worker: rename {put,ref}_red_drawable
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2015-11-09 14:34:45 +00:00
Marc-André Lureau
88ce49b661 worker: s/destroy_surface/surface_unref
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-09 11:34:43 +00:00
Frediano Ziglio
4ef2618f52 worker: remove unused parameter from remove_shadow
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-09 10:46:50 +00:00
Marc-André Lureau
e2a3d57735 worker: remove some useless counters
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-09 10:46:36 +00:00
Marc-André Lureau
cd15fcb627 dispatcher: remove receive_data and send_data functions
Use read_safe/write_safe instead which do the same stuff

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-09 10:25:32 +00:00
Marc-André Lureau
452edd8f7a server: create display and cursor channels in RedWorker constructor
Instead of requiring the dispatcher to send a message to the worker to
create the display channel and cursor channel, just create them when
the worker is created.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-09 10:24:21 +00:00
Marc-André Lureau
ff1b0b88b8 worker: use RED_CHANNEL_CLIENT for dcc
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 13:38:03 +00:00
Pavel Grunt
6ebb2ebe2a spicevmc: Return early when instance has no device state
Same approach as in spice_server_char_device_wakeup().
Avoid segmentation fault when the webdav channel (spice port channel) is
used with the vnc display:
 #0  0x00007ffff7aab734 in spice_char_device_state_opaque_get (dev=0x0)
     at char_device.c:720
 #1  0x00007ffff7b0850c in spice_server_port_event (sin=<optimized out>, event=<optimized out>) at spicevmc.c:578
 #2  0x0000555555787ba4 in set_guest_connected (port=<optimized out>, guest_connected=1) at hw/char/virtio-console.c:89
 #3  0x0000555555678d7c in control_out (len=<optimized out>, buf=0x55555775c3a0, vser=0x5555578d1540) at /home/pgrunt/RH/qemu/hw/char/virtio-serial-bus.c:404
 #4  0x0000555555678d7c in control_out (vdev=0x5555578d1540, vq=0x555557941bc8)
     at /home/pgrunt/RH/qemu/hw/char/virtio-serial-bus.c:441
 #5  0x000055555588eb98 in aio_dispatch (ctx=0x5555562e1a50) at aio-posix.c:160
 #6  0x00005555558829ee in aio_ctx_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at async.c:226
 #7  0x00007ffff2010e3a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
 #8  0x000055555588d8fb in main_loop_wait () at main-loop.c:211
 #9  0x000055555588d8fb in main_loop_wait (timeout=<optimized out>)
     at main-loop.c:256
 #10 0x000055555588d8fb in main_loop_wait (nonblocking=<optimized out>)
     at main-loop.c:504
 #11 0x000055555561b664 in main () at vl.c:1891
2015-11-06 11:26:17 +01:00
Marc-André Lureau
e76f402952 worker: move shadow_new() and container_new()
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 10:10:40 +00:00
Marc-André Lureau
c9bb089869 worker: use more DCC_TO_WORKER
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 10:03:12 +00:00
Marc-André Lureau
ed70743f7c worker: move some compress stats to display
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:35:16 +00:00
Marc-André Lureau
e839dc23b3 worker: rename WORKER_FOREACH_DCC_SAFE macro to FOREACH_DCC
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:28:49 +00:00
Marc-André Lureau
de1ab756b0 worker: remove unused WORKER_TO_DCC macro
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:23:02 +00:00
Marc-André Lureau
13888ae6a2 worker: rename red_pipe_add_drawable* to dcc_add_drawable*
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:22:51 +00:00
Marc-André Lureau
f1c7bca4d4 worker: move delta computation
Move delta computation from red_add_drawable to red_current_add_with_shadow.

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-06 09:16:02 +00:00