Commit Graph

132 Commits

Author SHA1 Message Date
Arnon Gilboa
2d03cc5c2c vdservice stops vdagent via event
Terminate agent politely instead of ugly TerminateProcess(), so now
VD_AGENT_CLIPBOARD_RELEASE is sent (if guest owned the clipboard),
followed by cleanup.

rhbz #903379
2013-01-31 11:34:14 +02:00
Christophe Fergeau
05af7a9786 Add OLDMSVCRT fallback for _ftime_s
Aliasing _ftime_s to _ftime when OLDMSVCRT is defined makes it
possible to remove the timestamp-less implementation of LOG()
while still getting a binary working on Windows XP. I've tested
this with a MinGW build, hopefully this won't break VC++ builds...
2013-01-22 12:43:51 +01:00
Christophe Fergeau
1e543873ea vdlog: Get swprinft_s definition from vdcommon.h
vdlog.cpp has an #ifdef check for OLDMSVC to choose between using
swprintf or swprintf_s. Since vdcommon.h provides a compat #define
for swprintf_s when OLDMSVC is set, it's better to use this one.
2013-01-22 12:43:44 +01:00
Arnon Gilboa
9a0b939de1 build-sys: remove *vdi_port* from Makefile.am 2012-12-09 11:40:34 +02:00
Arnon Gilboa
cd4baafb03 vdagent: git rm *vdi_port* 2012-12-09 11:33:25 +02:00
Arnon Gilboa
f79485aeee vdagent: remove vdi_port from vcproj 2012-12-09 11:33:25 +02:00
Arnon Gilboa
f1873dfa9b vdagent: remove vdi_port, use vio_serial directly 2012-12-09 11:33:25 +02:00
Arnon Gilboa
9b5954165d vdagent: when SetClipboardData fails, set clipboard control event to stop wait
Currently, a SetClipboardData failure is followed by useless wait for timeout
(VD_CLIPBOARD_TIMEOUT_MS).

In addition, we remove the clipboard open-empty-set-close retry, which became
irrelevant with the current on_clipboard_request().
2012-12-09 11:24:27 +02:00
Arnon Gilboa
c18859ff35 vdservice: set process handle for vdagent launched on session>0
The problem on XP was failing to terminate agent running on session>0,
since during agent process creation, a handle was not set, so it was NULL.
Therefore, the new agent created (at the session we switched to) was unable
to open vitio-serial which was still used by the other running agent instance.

rhbz#868254
2012-11-25 17:11:39 +02:00
Arnon Gilboa
e5c363b841 vdservice: support Windows 8 & Server 2012
vdagent was ok, but vdservice required adding these to the version check.
Both are handled as the rest of the Win7 class.
Tested on Win8x64.
2012-11-25 10:11:59 +02:00
Arnon Gilboa
7330f5132a vdagent: remove a wrong return 2012-11-18 12:13:40 +02:00
Christophe Fergeau
50d9542671 Fix mingw compilation
This got broken with the recent code moves from vdservice to vdagent.
2012-11-15 12:28:11 +01:00
Arnon Gilboa
a69af07da3 vdagent: set timeout for next clipboard chunk instead of complete reception
currently:
-handling client disconnect during clipboard data trasfer is buggy
-agent also timeouts on large paste from client (>10sec)

therfore:
-reduce VD_CLIPBOARD_TIMEOUT_MS to 3sec from previous clipboard chunk
-remove _clipboard_event and use _control_event(CONTROL_CLIPBOARD) instead
-use _clipboard_tick for clipboard timeout, updated on each clipboard chunk
-use cleanup_in_msg() to reset incoming message state

rhbz#833835
2012-11-14 10:50:52 +02:00
Arnon Gilboa
f71197330c vdagent: extract event_dispatcher from input_desktop_message_loop 2012-11-14 10:50:51 +02:00
Arnon Gilboa
5f1e7630ae vdagent: remove pipe common defs 2012-11-14 10:50:51 +02:00
Arnon Gilboa
22d25256fd vdagent: use virtio-serial, remove pipe usage 2012-11-14 10:50:51 +02:00
Arnon Gilboa
3f7d4da4bc vdagent: mv vdi_port files from vdservice 2012-11-14 10:50:50 +02:00
Arnon Gilboa
9f44263959 vdservice: remove virtio-serial & pipe usage 2012-11-14 10:50:50 +02:00
Christophe Fergeau
b264830f93 rpm: Fix Buildrequires
For some reason, most of the required image decompression libraries
were missing.
2012-11-12 13:24:23 +01:00
Christophe Fergeau
075e6ddc07 rpm: Fix typo in spec file
'mingw_package_header' was spelt 'mingw_package_hedder'
2012-11-12 13:24:23 +01:00
Christophe Fergeau
4fe15524b4 rpm: Allow .spec file to be used with git snapshots
git snapshots will contain the short version of the hash
that was used to generate the snapshot in their version number,
take that into account in the spec file.
2012-10-31 10:11:52 +01:00
Christophe Fergeau
23c87a26b1 build-sys: Use git-version-gen
This gives much better version numbers when using git snapshots.
2012-10-31 10:11:47 +01:00
Christophe Fergeau
f485c77727 rpm: Add spec file for mingw build
Fedora has all the mingw dependencies for vdagent packaged but don't
want to ship mingw Windows binaries. This .spec can be used to run
local mock builds of vdagent using mingw, or scratch builds on koji, ...
2012-10-01 19:20:49 +02:00
Christophe Fergeau
57637a2009 build-sys: Set version to 0.7.0 in configure.ac
Last tagged release was 0.6.3.
2012-10-01 19:20:38 +02:00
Christophe Fergeau
301f697de0 build-sys: Add missing file to EXTRA_DIST
vdservice/resource.h was missing from generated tarballs, which
later broke the build.
2012-10-01 19:20:33 +02:00
Christophe Fergeau
5cde9acb53 build-sys: Include spice-protocol in tarballs 2012-10-01 19:20:28 +02:00
Christophe Fergeau
6c16b9d63f build-sys: Fix autogen.sh permissions
It needs to be executable to be useful
2012-10-01 19:20:22 +02:00
Arnon Gilboa
4929cb36f2 vdservice: stop service on virtio failure
read & write are async, and their completion is handled by handle_event(),
which returns status used by service execute loop.
previously an error in GetOverlappedResult caused vdservice hang.

rhbz#839564
2012-09-16 11:48:09 +03:00
Arnon Gilboa
1f56b3812f vdservice: retry virtio-serial read on ERROR_NO_SYSTEM_RESOURCES (1450)
as recommended by MS. seems like defined behavior of the driver.

rhbz#839564
2012-09-13 17:23:02 +03:00
Arnon Gilboa
18f70a3376 vdservice: restart vdagent if killed manually
win7-only issue

rhbz#845222
2012-09-10 10:59:14 +03:00
Arnon Gilboa
900ef2b4db vdagent: don't stop due to UIPI blocking
User Interface Privilege Isolation is usually used only for specific windows of
system security applications (anti-viruses etc.), so with this patch mouse will
be irresponsive for these windows but keep working for the rest. A complete
solution might be switching to server mouse mode while the agent is still active.
2012-09-10 10:17:23 +03:00
Arnon Gilboa
4e95b73ecf vdagent: add message_queue for messages written to pipe
This is only part of the message corruption solution.
The other part is fixing virtio-serial / spice-qemu-char throttling code.

-replace write_[lock/unlock/completion] calls with [new/enqueue]_message
-remove clipboard specific _out_msg_* class members
-remove ugly loop - while (a->_out_msg && a->write_clipboard());
-add _message_mutex for message queue
-fix pending_write race using _write_mutex
-TODO: enqueue large message without dividing it to chunks in advance

rhbz #846427
2012-09-10 09:48:46 +03:00
Marc-André Lureau
04a28a35ed Fix remaining warnings 2012-07-25 11:27:22 +02:00
Marc-André Lureau
eb29cb7c61 Update spice-protocol to 0.12 2012-07-25 10:46:52 +02:00
Marc-André Lureau
0bb7ed9363 Add configure --enable-debug 2012-06-21 11:31:45 +02:00
Marc-André Lureau
a095f4806e build-sys: statically build agent
Fix build by default when using mingw (when more compiler are
supported we could do case by case)

Since we are statically building, strip resulting binary (we
also use lto, whole-program but that doesn't seem to change
much..)
2012-06-08 13:13:23 +02:00
Marc-André Lureau
0cef8ba42b vdagent: reset clipboard event
Waiting for a Windows event will not last if it is already set.

For example, the client may send clipboard_release() messages
while we are not waiting in on_clipboard_request(), and this will
SetEvent(clipboard_event)
The following clipboard request will thus not wait for the data,
resulting in an empty clipboard & paste for the guest application.

We could say there is fundamentally a race as there is no obvious
way to know if a received message is related to the current request,
but by reseting the event before waiting for new events to come, we
at least clear the past events.
2012-05-25 20:21:54 +02:00
Marc-André Lureau
7d75ac51cc build-sys: move back vdservice to console
So we can use it from command line properly..
Sigh.. I wish they wouldn't make this useless distinction..
2012-05-24 19:04:13 +02:00
Marc-André Lureau
cee350027f mingw: fix broken build
Add missing declaration left-over.
2012-05-24 19:03:48 +02:00
Marc-André Lureau
b4e9afc721 desktop_layout: fix incorrect total_width/height
When resizing desktop to best match, the agent fails to update
it's current mode width/height and then incorrectly report
different total_width/total_height than real screen dimensions,
then scaling input incorrectly results in mouse cursor offset.

https://bugzilla.redhat.com/show_bug.cgi?id=823019
2012-05-24 13:55:31 +02:00
Marc-André Lureau
3d45018086 Resize to arbitrary resolution
Use QXL_ESCAPE_SET_CUSTOM_DISPLAY to update custom mode,
and switch to it.
2012-05-24 13:55:31 +02:00
Marc-André Lureau
f2c2a136e2 Use spice-protocol submodule 2012-05-24 13:55:31 +02:00
Marc-André Lureau
2ab4fb7832 Allow running as a normal process again
The service code should be commented out if DEBUG_VDSERVICE.
Otherwise it fails to run as a standalone process.
2012-05-24 13:55:31 +02:00
Marc-André Lureau
1aa23d698a mingw: compile a non-console binary
Otherwise, a console dialog pops up
2012-05-24 13:55:31 +02:00
Marc-André Lureau
0c1658b1c2 mingw: link with RC file to provide needed version information 2012-05-24 13:55:31 +02:00
Marc-André Lureau
60e850c6e4 mingw: don't use *_s msvcrt variants
Apparently, it comes with a recent version of C library (msvcrt90?),
but I don't know if we can/should ship also a MS dll. Probably it used
to work with an inlined version with VS headers.

The build can be tweaked to use the -non-_s variant with -DOLDMSVCRT
CFLAGS.
2012-05-24 13:55:31 +02:00
Marc-André Lureau
55cf72c2a8 Revert "Revert "mingw: make sure unicode support is enabled""
This reverts commit dec8f9d049.
2012-05-24 13:55:31 +02:00
Marc-André Lureau
b4b7105c57 mingw: add standard main() entry function
Thanks Paolo for the suggestion:
http://lists.freedesktop.org/archives/spice-devel/2012-May/009291.html
2012-05-24 13:53:43 +02:00
Marc-André Lureau
1a7ad7ab1f build-sys: fix autoreconf -vfi 2012-05-10 23:43:39 +02:00
Christophe Fergeau
74af857e8e Revert "mingw: remove tMain use"
This patch wasn't sent for review, and wasn't meant to be pushed
as part of the mingw series

This reverts commit 63541ea6ac.
2012-03-01 16:58:18 +01:00