summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* build-sys: fix some automake warningMarc-André Lureau2013-09-173-3/+3
| | | | | client/Makefile.am:199: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') server/tests/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
* Fix _FORTIFY_SOURCE redefine errorDunrong Huang2013-09-101-1/+1
| | | | | | | | | | | | If the _FORTIFY_SOURCE has been already defined, we shouldn't redefine it, or it will raise a build error as below: In file included from agent-msg-filter.c:21:0: ../config.h:17:0: error: "_FORTIFY_SOURCE" redefined [-Werror] agent-msg-filter.c:1:0: note: this is the location of the previous definition Suggested-by: Christophe Fergeau <cfergeau@redhat.com> Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
* red_parse_qxl: Change spice_error() to spice_warning()Christophe Fergeau2013-09-021-3/+4
| | | | | | | | After eb09c25c, red_parse_qxl.c still has some spice_error() which will kill the server even though the code is trying to return an error when the spice_error() is hit. This commit replaces these occurrences with a spice_warning() which will not kill spice-server.
* server: bitmap_consistent: replace spice_error with spice_warningUri Lublin2013-09-021-1/+1
| | | | | | | | | bitmap_consistent should return true or false. Currently it aborts instead of returning false, due to spice_error. Replacing spice_error with spice_warning, provides information and returns false, as expected. This fixes Fedora bz#997932
* client: add some missing USE_GUI define guardsAlon Levy2013-08-291-0/+4
|
* red_worker: fix call to dump_bitmap (too many args)Yonit Halperin2013-08-221-1/+1
|
* spice_bitmap_utils: fix dump_bitmapYonit Halperin2013-08-221-3/+3
|
* main_channel: monitoring client connection statusYonit Halperin2013-08-143-9/+23
| | | | | | | rhbz#994175 Start monitoring if the client connection is alive after completing the bit-rate test.
* red_channel: add option to monitor whether a channel client is aliveYonit Halperin2013-08-142-0/+133
| | | | | | | | | | rhbz#994175 When a client connection is closed surprisingly (i.e., without a FIN segment), we cannot identify it by a socket error (which is the only way by which we identified disconnections so far). This patch allows a channel client to periodically check the state of the connection and identify surprise disconnections.
* red_channel: add on_input callback for tracing incoming bytesYonit Halperin2013-08-142-0/+9
| | | | The callback will be used in the next patch.
* spice_timer_queue: don't call timers repeatedlyYonit Halperin2013-08-141-3/+1
| | | | | | | | | For channels that don't run as part of the main loop, we use spice_timer_queue, while for the other channels we use qemu timers support. The callbacks for setting timers are supplied to red_channel via SpiceCoreInterface, and their behavior should be consistent. qemu timers are called only once per each call to timer_start. This patch assigns the same behaviour to spice_timer_queue.
* server: split spice_image_cache from red_workerAlon Levy2013-08-144-157/+177
|
* server/red_worker: s/image_cache_eaging/image_cache_aging/Alon Levy2013-08-141-2/+2
|
* server: move surface_format_to_image_type to spice_bitmap_utilsAlon Levy2013-08-143-24/+23
|
* server: s/red_wait_all_sent/red_channel_wait_all_sent/Alon Levy2013-08-143-5/+5
|
* server: move three functions to red_channelAlon Levy2013-08-145-119/+134
| | | | | | | | | | | | | | | Three blocking functions, one was split to leave the display channel specific referencing of the DrawablePipeItem being sent inside red_worker, but the rest (most) of the timeout logic was moved to red_channel, including the associated constants. Moved functions: red_channel_client_wait_pipe_item_sent red_wait_outgoing_item red_wait_all_sent Introduces red_time.h & red_time.c for a small helper function dealing with time.h
* server: move bit set/clear utilities out of red_worker.hAlon Levy2013-08-145-19/+28
|
* server: move dump_bitmap to separate fileAlon Levy2013-08-144-153/+162
|
* server/red_worker.c:red_process_drawable: rename item to drawableAlon Levy2013-08-141-16/+16
|
* server/red_worker.c:red_process_drawable: rename drawable to red_drawableAlon Levy2013-08-141-8/+9
|
* red_worker: mark DRAW_ALL as brokenAlon Levy2013-08-141-0/+1
| | | | | | | setting DRAW_ALL define doesn't produce correct rendering. Using update_area instead of red_draw_qxl_drawable will work but it shouldn't be required. This is not work I intend to do right now, so marking it for anyone looking at this in the future.
* red_worker: decrease the timeout when flushing commands and waiting for the ↵Yonit Halperin2013-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | client. 150 seconds is way too long period for holding the guest driver and waiting for a response for the client. This timeout was 15 seconds, but when off-screen surfaces ware introduced it was arbitrarily multiplied by 10. Other existing related bugs emphasize why it is important to decrease the timeout: (1) 994211 - the qxl driver waits for an async-io reponse for 60 seconds and after that, it switches to sync-io mode. Not only that the driver might use invalid data (since it didn't wait for the query to complete), falling back to sync-io mode introduces other errors. (2) 994175 - spice server sometimes doesn't recognize that the client has disconnected. (3) There might be cache inconsistency between the client and the server, and then the display channel waits indefinitely for a cache item (e.g., bug 977998) This patch changes the timeout to 30 seconds. I tested it under wifi +emulating 2.5Mbps network, together with playing video on the guest and changing resolutions in a loop. The timeout didn't expired during my tests. This bug is related to rhbz#964136 (but from rhbz#964136 info it is still not clear why the client wasn't responsive).
* log: improve debug information related to client disconnectionYonit Halperin2013-07-292-6/+10
|
* snd_worker/snd_disconnect_channel: don't call snd_channel_put if the channel ↵Yonit Halperin2013-07-291-10/+10
| | | | | | | | | | | has already been disconnected The snd channels has one reference as long as their socket is active. The playback channel has an additional reference for each frame that is currently filled by the sound device. Once the channel is disconnected (the socket has been freed and the first reference is released) snd_disconnect_channel shouldn't release a reference again.
* snd_worker: fix memory leak of PlaybackChannelYonit Halperin2013-07-291-5/+4
| | | | | | | | | | When the sequence of calls bellow occurs, the PlaybackChannel is not released (snd_channel_put is not called for the samples that refer to the channel). spice_server_playback_get_buffer snd_channel_disconnect spice_server_playback_put_samples
* reds: s/red_client_disconnect/red_channel_client_shutdown inside callbacksYonit Halperin2013-07-291-3/+4
| | | | | | | | | | | | | | When we want to disconnect the main channel from a callback, it is safer to use red_channel_client_shutdown, instead of directly destroying the client. It is also more consistent with how other channels treat errors. red_channel_client_shutdown will trigger socket error in the main channel. Then, main_channel_client_on_disconnect will be called, and eventually, main_dispatcher_client_disconnect. I didn't replace calls to reds_disconnect/reds_client_disconnect in places where those calls were safe && that might need immediate client disconnection.
* decouple disconnection of the main channel from client destructionYonit Halperin2013-07-295-4/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes rhbz#918169 Some channels make direct calls to reds/main_channel routines. If these routines try to read/write to the socket, and they get socket error, main_channel_client_on_disconnect is called, and triggers red_client_destroy. In order to prevent accessing expired references to RedClient, RedChannelClient, or other objects (inside the original call, after red_client_destroy has been called) I made the call to red_client_destroy asynchronous with respect to main_channel_client_on_disconnect. I added MAIN_DISPATCHER_CLIENT_DISCONNECT to main_dispatcher. main_channel_client_on_disconnect pushes this msg to the dispatcher, instead of calling directly to reds_client_disconnect. The patch uses RedClient ref-count in order to handle a case where reds_client_disconnect is called directly (e.g., when a new client connects while another one is connected), while there is already CLIENT_DISCONNECT msg pending in the main_dispatcher. Examples: (1) snd_worker.c snd_disconnect_channel() channel->cleanup() //snd_playback_cleanup reds_enable_mm_timer() . . main_channel_push_multi_media_time()...socket_error . . red_client_destory() . . snd_disconnect_channel() channel->cleanup() celt051_encoder_destroy() celt051_encoder_destory() // double release Note that this bug could have been solved by changing the order of calls: e.g., channel->stream = NULL before calling cleanup, and some other changes + reference counting. However, I found other places in the code with similar problems, and I looked for a general solution, at least till we redesign red_channel to handle reference counting more consistently. (2) inputs_channel.c inputs_connect() main_channel_client_push_notify()...socket_error . . red_client_destory() . . red_channel_client_create() // refers to client which is already destroyed (3) reds.c reds_handle_main_link() main_channel_push_init() ...socket error . . red_client_destory() . . main_channel_client_start_net_test(mcc) // refers to mcc which is already destroyed This can explain the assert in rhbz#964136, comment #1 (but not the hang that occurred before).
* main_dispatcher: add ref count protection to RedClient instancesYonit Halperin2013-07-291-2/+4
|
* red_channel: add ref count to RedClientYonit Halperin2013-07-292-5/+35
|
* red_channel: prevent adding and pushing pipe items after a channel_client ↵Yonit Halperin2013-07-291-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | has diconnected Fixes: leaks of pipe items & "red_client_destroy: assertion `rcc->send_data.size == 0'" red_channel_disconnect clears the pipe. It is called only once. After, it was called, not items should be added to the pipe. An example of when this assert can occur: on_new_cursor_channel (red_worker.c), pushes 2 pipe items. When it pushes the first pipe item, if the client has disconnected, it can hit a socket error, and then, red_channel_client_disconnect is called. The second call to adding a pipe item, will add the item to the pipe. red_channel_client_pipe_add_type also calls red_channel_client_push, which will update the send_data.size. Then, the push will also hit a socket error, but red_channel_client_disconnect won't clear the pending pipe item again, since it was already called. When red_client_destory is called, we hit assertion `rcc->send_data.size == 0'. Note that if a pipe item is added to the pipe after red_channel_client_disconnect was called, but without pushing it, we should hit "spice_assert(rcc->pipe_size == 0)".
* server/red_channel: fix unused variableAlon Levy2013-07-281-10/+13
| | | | unused variable 'so_unsent_size' [-Werror=unused-variable]
* server/red_worker.c: remove unused pipe_item_removeAlon Levy2013-07-241-5/+0
|
* TIOCOUTQ -> SIOCOUTQ and portability ifdefsNahum Shalman2013-07-222-2/+12
| | | | | | | | The ioctl on sockets is actually named SIOCOUTQ though its value is identical to TIOCOUTQ which is for terminals. SIOCOUTQ is linux specific so we add a header check and ifdef based on the presence of the header This prevents bogus ioctls on non-Linux platforms
* configure.ac comment typo nitNahum Shalman2013-07-221-1/+1
|
* Release 0.12.4v0.12.4Uri Lublin2013-07-172-2/+15
|
* Update spice-common submodule (get spice-protocol 0.12.6)Uri Lublin2013-07-171-0/+0
|
* syntax-check: trailing whitespaces -- ignore binary filesUri Lublin2013-07-171-0/+2
|
* syntax-check: remove trailing whitespacesUri Lublin2013-07-163-8/+7
| | | | Only whitespace changes in this commit.
* syntax-check: make sure config.h is the first included .h fileUri Lublin2013-07-163-1/+3
|
* syntax-check: use test A && test B instead of test A -a BUri Lublin2013-07-161-1/+1
|
* syntax-check: fix no-newline or empty line at EOFUri Lublin2013-07-162-2/+1
|
* syntax-check: s/the the/the/ in a commentUri Lublin2013-07-162-2/+2
|
* syntax-check: update AUTHORSUri Lublin2013-07-161-0/+6
|
* syntax-check: fix cast_of_argument_to_freeUri Lublin2013-07-161-1/+2
| | | | | | | | In this case, make syntax-check is wrong, and we actually do need the cast. A cast is needed when types are uint64_t <--> pointer Using a local "ptr" variable makes both gcc and syntax-check happy.
* syntax-check: fix avoid_if_before_freeUri Lublin2013-07-161-6/+2
|
* server/tests: fix timer for test_empty_successUri Lublin2013-07-161-1/+9
|
* server/tests: test_display_width_stride: add destroy commandUri Lublin2013-07-161-0/+9
| | | | | Otherwise, the test exits after the first iteration over all tests, on the second attempt to create an already created surface.
* server/tests: remove option from usage if AUTOMATED_TESTS is not configuredUri Lublin2013-07-161-6/+19
|
* server/tests: invalid-option: print the bad argumentUri Lublin2013-07-161-1/+1
| | | | optind points to the next argument to parse.
* server/tests: fix produce_command for create surfaceUri Lublin2013-07-161-2/+4
| | | | | | | | | | | Earlier in this function, test->target_surface is set to 1, which is the only allowed non-primary surface currently. If surface parameters are given (and specifically data is checked) they are being used, otherwise a default surface is used. Earlier in this function, "command" is set to a non-NULL value. Thus, the else part was unreachable code, which is fixed now.