summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* replay: fix typo in messageFrediano Ziglio2015-08-271-1/+1
| | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
* Avoid core calling spice_server_destroyFrediano Ziglio2015-08-261-2/+5
| | | | | | | | | spice_server_destroy calls reds_exit which is called also at exit time (is registered with atexit) so avoid to keep dangling pointers. Currently this does not happen as spice_server_destroy is not called by Qemu. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* prevent integer overflow on 32 bitFrediano Ziglio2015-08-261-1/+1
| | | | | | | | | | | On 32 bit machine timespec->tv_sec (time_t) is 32 bit. Also 1000 * 1000 * 1000 is 32 bit. The multiplication of 2 32 bit integers gives a 32 bit integer, however this can overflow. Converting the first factor to 64 bit before the multiplication solves the issue. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* remove unused SAME_PIXEL macroFrediano Ziglio2015-08-261-3/+0
| | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* build-sys: Remove test_spice_version.hChristophe Fergeau2015-08-262-45/+0
| | | | | | | This script was used at make distcheck time to verify consistency of the version number defined in configure.ac and in spice-server headers. Since commit ab12cf414c, these 2 version numbers can no longer be out of sync, so we can drop this script.
* server: Readd spice-experimental.hChristophe Fergeau2015-08-262-0/+7
| | | | | | | | | | | | | | Commit 3c6b4e41 removed spice-experimental.h as this header was not used, nor supposed to be used. However, QEMU had been including it (without using any of its symbols) until commit v2.3.0-rc0~135^2~1 As this is fairly recent (Nov 2014), building older QEMUs with new spice-server releases, or even bisecting QEMU will be broken as they will be looking for a no-longer available header. This commit readds a spice-experimental.h file, however it only contains a #warning indicating this file is deprecated. This means older QEMU will build now, but only if they were configured with --disable-werror.
* build-sys: Require a new enough spice-protocol in .pc fileChristophe Fergeau2015-08-262-2/+4
| | | | | | spice-server headers expose SpiceImageCompression which is only available from recent spice-protocol releases. This dependency must be expressed in Requires and not Requires.private
* remove wrong statement terminator from preprocessor macroFrediano Ziglio2015-08-251-1/+1
| | | | | | | | Actually not causing problems as when used is always followed by another terminator but better to fix the definition. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
* Use MAX macro to compute the maximum valueFrediano Ziglio2015-08-251-1/+1
| | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* replay: use plain pthread for mutex/conditionFrediano Ziglio2015-08-251-15/+15
| | | | | | | | Mutex/conditional require Glib 2.32 which is not available in RHEL6. Use plain pthread to make this module compatible with RHEL6. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Fabiano Fidencio <ffidenci@redhat.com>
* replay: fix check for QXL_SURF_FLAG_KEEP_DATA flagFrediano Ziglio2015-08-252-2/+2
| | | | | | | | A logical and (&&) was used instead of a bit one (&). Was working just as is the only flag defined. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Fabiano Fidencio <ffidenci@redhat.com>
* worker: remove unused members from DrawableFrediano Ziglio2015-08-241-3/+0
| | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
* server/tests/spice-server-replay: introduceAlon Levy2015-08-222-0/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usage: spice-server-replay -p <port> -c <client command line> <cmdfile> will run the commands from cmdfile ignoring timestamps, right after a connection is established from the client, and will SIGINT the client on end of cmdfile, and exit itself after waiting for the client. spicy-stats from spice-gtk is useful for testing, it prints the summary of the traffic on each channel. You can also run with no client by doing: spice-server-replay <cmdfile> For example, the 300 MB file (compressed to 4 MB with xz -9) available at [1] produces the following output: spicy-stats total bytes read: total bytes read: inputs: 214 display: 1968983 cursor: 390 main: 256373 You could run it directly like so: curl http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz | \ xzcat | server/tests/spice-server-replay -p 12345 -c `which spicy-stats` - Known Problems: * Implementation is wrong. Should do a single device->host conversion (i.e. get_virt), and then marshall/demarshall that (i.e. RedDrawable). * segfault on file read done resulting in the above spicy-stats not being reproducable (well, up to 1% yes). [1] http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz Now based on glib including using an asyncqueue for reading the playback file, and proper freeing of the allocated commands, with --slow, --compression and a progress timer, and doesn't use more then nsurfaces. Signed-off-by: Alon Levy <alon@pobox.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
* server/red_worker: record to SPICE_WORKER_RECORD_FILENAMEAlon Levy2015-08-211-3/+37
| | | | | | | | | | | | | | | | | | if the environment variable in the title is set and can be opened for writing a log of all display commands (no cursor commands yet) and any QXLWorker calls (particularily primary create and destroy) will be logged to that file, and possible to replay using the replay utility introduced later. For an example file (4 MB download, 300 MB after unpack with xz, these 300 MB are themselves reduced from 1.2GB using zlib compression for any chunk): (old file without a header) http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz Signed-off-by: Alon Levy <alon@pobox.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
* server/red_{record, replay}.[ch]: introduceAlon Levy2015-08-216-0/+2144
| | | | | | | | | | | | | | | | | | | Currently hand crafted with some sed scripts and alot of vim macros from red_parse_qxl after considering the logger in qemu/hw/qxl-logger.c and seeing it was incomplete. The only problem with logging from the server and not from qemu is that it requires coordinated shutdown to avoid half a message. Should be automatically generated from a declarative syntax, i.e. qxl.proto. Note: zlib compression is introduced in a disabled state, see ZLIB define Now with a simple versioned header and generated ids by the server instead of based on the recorded file, and doesn't use more then 1024 surfaces (configurable). Signed-off-by: Alon Levy <alon@pobox.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
* server/dispatcher: add extra_dispatcher, hack for red_recordAlon Levy2015-08-202-0/+22
| | | | Signed-off-by: Alon Levy <alon@pobox.com>
* tests: use glib main loopMarc-André Lureau2015-08-202-190/+97
|
* Remove use of INLINEAlon Levy2015-08-205-20/+18
| | | | It's #define'd to 'inline', and only used in the GLZ encoder.
* build-sys: Remove spice-protocol submoduleChristophe Fergeau2015-08-204-1/+6
| | | | | It's seeing regular releases and is API stable, so we don't need to bundle it with spice-server
* mjpeg and jpeg encoder: fix alignment warningsVictor Toso2015-08-202-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As the input line could be uint8_t*, uint16_t* or uint32_t*, changing the default from uint8_t* to void* seems the correct choice to deal with upcasting warnings. Regarding chunks->data allocation, I quote Frediano explantion: "Lines came from spice_bitmap_get_line. This function assume that bitmap data is split among chunks each containing some lines (always full lines). If chunk->data is allocated using malloc or similar SHOULD (not 100% sure) be 4 bytes aligned so in our cases (8, 16, 24 or 32 bit images) should be aligned enough. All the casts unfortunately came from the fact we compute based on pixel bytes to make it generic so we use uint8_t*." and "Looking at code looks like these chunks came from the virtual machine. So the question is... why should the virtual machine give use some not-pixel align data? I would put a large comment to state that we assume VM send aligned data, would be stupid for the VM to not align it!" clang output: jpeg_encoder.c:109:26: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint16_t *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Werror,-Wcast-align] uint16_t *src_line = (uint16_t *)line; ^~~~~~~~~~~~~~~~ jpeg_encoder.c:144:26: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] uint32_t *src_line = (uint32_t *)line; ^~~~~~~~~~~~~~~~ mjpeg_encoder.c:260:23: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint16_t *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Werror,-Wcast-align] uint16_t pixel = *(uint16_t *)src; ^~~~~~~~~~~~~~~
* glz: WindowImageSegment lines lines_end as void*Victor Toso2015-08-201-2/+2
| | | | | | | | | | | Instead of using uint8_t* which can cause several warnings on casting as the example below: ./glz_encode_tmpl.c:321:29: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'rgb16_pixel_t *' (aka 'unsigned short *') increases required alignment from 1 to 2 [-Werror,-Wcast-align] ref_limit = (PIXEL *)(seg->lines_end); ^~~~~~~~~~~~~~~~~~~~~~~~~
* migration_protocol: use SPICE_MAGIC_CONSTVictor Toso2015-08-201-5/+6
| | | | | spice-protocol has a new define to create the magic constants, let's use that.
* red_parse_qxl: Do not compute abs unsigned intVictor Toso2015-08-121-1/+1
| | | | | | | | | | | SpiceBitmap's stride is uint32_t. from clang: red_parse_qxl.c:452:41: error: taking the absolute value of unsigned type 'uint32_t' (aka 'unsigned int') has no effect bitmap_size = red->u.bitmap.y * abs(red->u.bitmap.stride); ^
* server/inputs_channel: Cope with NULL keyboard in release_keys()Alon Levy2015-08-121-1/+6
| | | | | This fixes a test_display_no_ssl segfault on client disconnect when the keyboard was never initialized.
* red_parse_qxl: remove unused variableVictor Toso2015-08-111-4/+0
|
* Remove unused struct RedsOutItemJonathon Jongsma2015-08-111-5/+0
|
* RedChannel: remove unused BufDescriptor structJonathon Jongsma2015-08-111-5/+0
|
* Remove unused snd_get_playback_compression() methodChristophe Fergeau2015-08-112-6/+0
|
* Fix typo in comment in char_device.hChristophe Fergeau2015-08-111-1/+1
|
* Fix typo in commentsJonathon Jongsma2015-08-111-2/+2
|
* Move RedsMigSpice to main-channel.hJonathon Jongsma2015-08-112-8/+8
| | | | | This is the place that needs the complete type definition. If it is defined in reds.h, it can create circular references.
* Cleanup: move static function declarations out of headerJonathon Jongsma2015-08-112-4/+4
| | | | | It doesn't make much sense to have static function declarations in a header, even a private header. So move them down into the source file.
* worker: remove unused preload_group_idMarc-André Lureau2015-08-111-4/+0
|
* channel: minor simplificationMarc-André Lureau2015-08-111-6/+1
|
* server: remove unused CursorDataMarc-André Lureau2015-08-111-9/+0
|
* server: use more const CoreInterfaceMarc-André Lureau2015-08-112-5/+5
|
* worker: move red_init_*() functionsMarc-André Lureau2015-08-111-8/+10
| | | | | | There is a red_init() methods, we can group all the red_init_*() calls in it rather than calling red_init() followed by all these calls in our main function.
* spice-common: codegen: ptypes.py: keep attribute names in setsUri Lublin2015-08-041-0/+0
| | | | This fixes the build on RHEL-6
* Adjust to new SpiceImageCompress nameChristophe Fergeau2015-07-2911-57/+65
| | | | | | | | This has been renamed to SpiceImageCompression in order to avoid clashes with older spice-server in the SPICE_IMAGE_COMPRESS_ namespace. This commit is a straight rename of SpiceImageCompress to SpiceImageCompression and SPICE_IMAGE_COMPRESS_ to SPICE_IMAGE_COMPRESSION_
* Add libraries such as -lm and -lpthread to the tests build line.Jeremy White2015-07-281-0/+1
| | | | | | | | | | | | | This prevents a compile error on Debian Jessie, from git, such as this: /usr/bin/ld: test_playback.o: undefined reference to symbol 'sin@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line This is fairly subtle, and Debian specific. It only happens when you use autoreconf to generate a new libtool script. Debian patches that script to require an explicit setting to link with all dependent libraries. It should be harmless on other distros, and it does save us Debian guys some hassle.
* reds: Assure we don't have stale statistic files before trying to create a ↵Frediano Ziglio2015-07-201-0/+1
| | | | | | | | | | | | | | | | | new one If a previous Qemu executable is not able to delete the statistic file on the next creation with same name (statitics file are based on pid numbers so if pid get reused for another Qemu process you get the same name) it fails as you can't open a file with 0444 permissions (these are the permission used to create these files). This patch assure there are no stale file trying to remove it before the creation of the new one. As file is based on pid and name used for spice you are not deleting another file. Fixes: rhbz#1177326 Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
* server: spice_debug() messages don't need a trailing '\n'.Francois Gouget2015-07-202-3/+3
| | | | Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
* server: Weakly try to get a better latency value for the bandwidth test.Francois Gouget2015-07-201-1/+2
| | | | | | | | | NET_TEST_WARMUP_BYTES is 0 so the warmup ping is the same as the one we use to measure the latency. Even if it was not, the actual latency would be the MIN() of both anyway so we might as well use both roundtrip times to ward off latency jitter a bit. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
* server: Don't reset the latency before showing it in the invalid net test ↵Francois Gouget2015-07-201-3/+3
| | | | | | error message. Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
* Use desired image compression for the first imagePavel Grunt2015-07-131-7/+7
| | | | | | red_marshall_image() allows to use other than QUIC compression only when auto_lz or auto_glz image compression is set. Other images don't have the problem because they are compressed using red_compress_image()
* Handle preferred image compression messagesJavier Celaya2015-06-301-0/+25
|
* Use image compress constants from spice-protocolJavier Celaya2015-06-307-23/+15
|
* server: Remove the rate_control_is_active field from MJpegEncoder.Francois Gouget2015-06-293-12/+16
| | | | It is redundant with the corresponding callbacks.
* server: Fix an incorrect time calculation.Francois Gouget2015-06-291-1/+1
| | | | Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
* HAVE_CLOCK_GETTIME is not used so remove it.Francois Gouget2015-06-291-4/+1
| | | | Signed-off-by: Francois Gouget <fgouget@codeweavers.com>