summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* use Xkb to get keyboard modifier maskChristophe Fergeau2011-08-171-23/+2
| | | | | | | | | | | | | | To be able to enable/disable keyboard leds on X11, we need to query the X server for which mask correspond to which led (NumLock, CapsLock). So far this was done using XKeysymToKeycode and iterating over X modifier mapping. Xkb provides XkbKeysymToModifiers for this purpose, and since we're using Xkb anyway, it makes more sense to use it. At some point, on my Fedora 15 box, XKeysymToKeycode was returning NoSymbol for CapsLock and NumLock leading to spicec not being able to change the keyboard leds when qemu tells it to. However, I couldn't reproduce this when I tried again :-/
* fix harmless typo in InputsChannel::handle_modifiersChristophe Fergeau2011-08-171-1/+1
| | | | | | | | | | | | | | InputsChannel::handle_modifiers converts _modifiers which is a bitflag of SPICE_KEYBOARD_MODIFIER_FLAGS_* to a Platform::*_MODIFIER bitflag, which is what Platform::set_keyboard_lock_modifiers expects. However, it's called with _modifiers, and the bitflag that this function computes is never used. Pass the computed bitflag to ::set_keyboard_lock_modifiers since _modifiers format is meaningless for ::set_keyboard_lock_modifiers. This bug was harmless because the two different set of modifier flags actually use the same values, so _modifiers and modifiers could be used interchangeably. However it's more future-proof to use the right format here.
* fix 2 X11 related leaksChristophe Fergeau2011-08-152-4/+8
|
* channel: fix EVP_PKEY leakChristophe Fergeau2011-08-151-3/+7
|
* always set VDAgentDisplayConfig::depthChristophe Fergeau2011-08-151-0/+1
| | | | | | Even if VDAgentDisplayConfig::depth will be unused if the VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH isn't set, it's better to initialize it anyway to avoid warnings from valgrind.
* server: Add a usbredir channelHans de Goede2011-08-105-1/+295
|
* client/red_client: fix broken switch host migration (RHBZ 727969)Alon Levy2011-08-031-0/+1
| | | | | | 3f8d7e59dbd94b1837503f37b5065698df3ffbc7 introduced a regression, after sending one attach_channels message we never send another one. Fix by resetting on disconnect.
* mjpeg: add missing SPICE_BITMAP_FMT_RGBAChristophe Fergeau2011-08-021-0/+1
| | | | | I forgot to handle SPICE_BITMAP_FMT_RGBA when mapping from spice image formats to libjpeg-turbo colorspaces.
* Fix typo: treshold -> thresholdLiang Guo2011-08-021-1/+1
|
* Fix typo: seperator -> separatorLiang Guo2011-08-023-24/+24
|
* mjpeg: fix libjpeg assertionChristophe Fergeau2011-08-011-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 :)
* server/red_dispatcher: fix wrong resolution set for tabletAlon Levy2011-07-311-4/+4
| | | | | | | | | | | 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.
* client: fix 30s timeout regressionChristophe Fergeau2011-07-311-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Changelog from Arnon Gilboa, patch from me: Commit eb6f55409412 caused the following regression: When client runs without the auto-conf or disable-effects options (either from CLI or controller), which is the case when using Spice from Admin Portal, the client will unecessarily wait for 30sec before connecting to a Windows guest with an agent running (this won't happen with linux guests or without an agent running). The mentioned patch assumed that on_agent_reply() of VD_AGENT_DISPLAY_CONFIG will call send_main_attach_channels() and connect. However, when auto-conf or disable-effects are not used, on_agent_reply() will ignore the reply and not call send_main_attach_channels(). Therefore, send_main_attach_channels() will only be called on agent timeout. The solution is to activate agent timer only if auto-conf or disable-effects. Otherwise, simply call send_main_attach_channels(). Fixes rhbz #726441
* common/backtrace.h: disable for WIN32Alon Levy2011-07-311-0/+4
| | | | | This also catches mingw32 which is probably fine, but at least it fixes the build on visual studio.
* fix integer marshalling helpers on big endianChristophe Fergeau2011-07-281-6/+6
| | | | | | They were trying to convert the destination pointer to an integer before trying to dereference it. The initial conversion was meant to be a cast to a pointer of the right size, not to an integer.
* fix typo in big endian code pathChristophe Fergeau2011-07-281-2/+2
| | | | uint63_t should be uint64_t
* Bump version in server/spice,h to 0.9.1Hans de Goede2011-07-261-1/+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.
* server: Don't call vdagent chardev state callback on client (dis)connectHans de Goede2011-07-251-45/+20
| | | | | See this long mail for the rationale for this: http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html
* Release 0.9.00.9.0Alon Levy2011-07-231-0/+62
|
* server/smartcard: fix smartcard_channel_send_errorAlon Levy2011-07-221-25/+8
| | | | | | | | 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.
* mjpeg: rename jpeg_mem_destChristophe Fergeau2011-07-221-3/+3
| | | | | 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.
* mjpeg_encoder: allocate "row" on demandChristophe Fergeau2011-07-221-8/+9
| | | | | | 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.
* mjpeg_encoder: remove unused functionsChristophe Fergeau2011-07-222-50/+0
| | | | | | 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.
* mjpeg_encoder: use libjpeg-turbo extra colorspacesChristophe Fergeau2011-07-221-5/+16
| | | | | | 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
* red_worker: use new mjpeg_encoder_encode_scanline APIChristophe Fergeau2011-07-221-72/+13
| | | | | | 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.
* mjpeg_encoder: add mjpeg_encoder_get_bytes_per_pixelChristophe Fergeau2011-07-222-0/+6
| | | | | Returns the number of bytes per pixel corresponding to the input data format.
* mjpeg_encoder: add mjpeg_encoder_encode_scanlineChristophe Fergeau2011-07-222-0/+107
| | | | | | 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.
* red_worker: simplify red_rgb_to_24bpp prototypeChristophe Fergeau2011-07-221-10/+6
| | | | | | 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.
* mjpeg_encoder: rework output buffer allocationChristophe Fergeau2011-07-223-26/+112
| | | | | | | | | | 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.
* red_worker: factor pixel conversion codeChristophe Fergeau2011-07-221-121/+50
| | | | | | 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.
* set version number to 0.9.0Christophe Fergeau2011-07-221-2/+2
|
* fix make distcheckChristophe Fergeau2011-07-223-6/+7
|
* configure.ac: fix pyparsing checkChristophe Fergeau2011-07-221-1/+1
| | | | | 2>&1 was typo'ed 2&>1 which caused an empty '1' file to be created when running this test.
* add SASL and smartcard to distcheck flagsChristophe Fergeau2011-07-221-1/+1
|
* client: don't die if initial agent timeout triggersChristophe Fergeau2011-07-222-2/+10
| | | | | | | | | | When the client connects to a spice VM, if an agent is detected, there will be a few messages exchanged to exchange capabilities, display resolutions, ... This exchange has a timeout in case something goes wrong. However, when it fires, the client dies. This commit changes this and lets the client connects to the guest when the timeout happens. rhbz #673973
* client: only send one SPICE_MSGC_MAIN_ATTACH_CHANNELS messagesChristophe Fergeau2011-07-222-8/+16
| | | | | | | | | | | | | | 492f7a9b fixed unwanted timeouts during initial client startup, but it also caused a bad regression when connecting to RHEL6+agent guests: the SPICE_MSGS_MAIN_ATTACH_CHANNELS message was sent multiple times, once in RedClient::handle_init, then once again in RedClient::on_agent_announce_capabilities (which can even be triggered multiple times). Sending this message multiple times is a big NO and causes the server to close the client connection, and the client to die. Add a _msg_attach_message_sent boolean to make sure we only send this message once. rhbz #712938
* client: split overlong option descriptionsChristophe Fergeau2011-07-221-2/+5
|
* server: make sure we clear vdagent and update mouse mode on agent disconnectHans de Goede2011-07-211-1/+1
| | | | | | | | | | | | 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.
* client: fix endless recursion in rearrange_monitors, RHBZ #692976Yonit Halperin2011-07-214-50/+55
| | | | | | | | | | The endless recursion happens due to Application::prepare_monitors calling RedScreen::resize calling Application::rearrange_monitors calling Application::prepare_monitors I changed RedScreen::resize not to call rearrange_monitors. Instead, the monitor should be configured correctly from Application, before calling resize. In addition, I made some cleanups to allow reusing rearrange_monitors code.
* spicec: Make loglevel configurable through the environmentHans de Goede2011-07-211-0/+7
| | | | | | | Having a loglevel variable is much more useful if we can actually change its value without a recompile. Use a SPICEC_LOG_LEVEL environment variable so we can do this from the spice xpi / activex too (by setting the environment variable before starting the browser).
* server/red_worker: send surface images to client on-demand after S3/4 wakeupYonit Halperin2011-07-201-9/+22
| | | | | When surfaces are being reloaded to the worker, we will send them to the client only if and when it needs them.
* server/spice.h: bump QXL_MINOR because of QXLWorker and QXLInterface changesAlon Levy2011-07-201-1/+1
|
* server: add QXLWorker.flush_surfaces_async for S3/S4 supportAlon Levy2011-07-205-4/+46
| | | | | | | | | | | 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.
* server: add QXLInterface::update_area_complete callbackAlon Levy2011-07-202-16/+47
| | | | | when update_area_async is called update_area_complete will be called with the surfaces dirty rectangle list.
* server/red_worker: handle_dev_input: reuse write_ready introduced for asyncAlon Levy2011-07-201-8/+4
|
* server: add async io supportAlon Levy2011-07-208-91/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* bump required spice-protocol to 0.8.1 for qxl_dev async and s3 updatesAlon Levy2011-07-201-1/+1
|
* server: api: add spice_qxl_* calls based on QXLWorker contentsAlon Levy2011-07-203-32/+226
| | | | | | | | | 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.
* server: spice-server.syms: move sasl symbols to 0.8.2Alon Levy2011-07-201-3/+7
|
* server/red_worker: remove print on handle_dev_destroy_surfacesAlon Levy2011-07-201-1/+1
|