Commit Graph

40 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
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
9f44263959 vdservice: remove virtio-serial & pipe usage 2012-11-14 10:50:50 +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
18f70a3376 vdservice: restart vdagent if killed manually
win7-only issue

rhbz#845222
2012-09-10 10:59:14 +03:00
Marc-André Lureau
04a28a35ed Fix remaining warnings 2012-07-25 11:27:22 +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
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
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
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
Christophe Fergeau
63541ea6ac mingw: remove tMain use
mingw does not support it.
2012-03-01 12:59:05 +01:00
Christophe Fergeau
bc99951685 mingw: use unsigned int in for loops when needed
gcc complains about mixed use of signed/unsigned otherwise
2012-03-01 12:59:05 +01:00
Christophe Fergeau
df3fe9cb90 mingw: fix format string warnings
Most of them are caused by not using %lu to print a DWORD (which
is an unsigned long).
2012-02-23 19:03:25 +01:00
Christophe Fergeau
8ca8687fcc Fix = use instead of ==
When checking for ConnectNamedPipe status, the error check uses
if ( err = ERROR_IO_PENDING) instead of using == which causes this
error check to always trigger. This commit fixes this, however it
needs careful testing since the fact that it went unnoticed means
the code with the bug was working as expected. Maybe changing it
will cause unexpected regressions.
2012-02-23 18:55:24 +01:00
Arnon Gilboa
56f7f3f1d5 vdservice: fix vdagent first launch (during startup) failure handling rhbz#750037
In case of agent launch failure: if connection state is not active(*), wait for
agent launch on the next session connection. Otherwise, the service is stopped.
(*) The failure was due to system startup timings and logon settings, causing
the first agent instance lifetime (before session connect) to be too short to
connect the service.
2011-12-28 16:27:18 +02:00
Arnon Gilboa
5ffb111944 vdservice: fix vdagent connection & termination handling rhbz#750037
-extend vdagent wait timeouts
-timeout occured when connecting during windows startup, using wan emulator with
1Mbps bandwith, and only when qxl driver is installed. It might be due to spice
commands window control which in this case indirectly affects windows startup
timings (needs further investigation).
-fix wait for vdagent connect
-fix wait for vdagent termination & exit code handling
-cleanup & nicify relevant logs while debugging
2011-11-16 12:03:21 +02:00
Arnon Gilboa
5edb588d6f vdservice: extract init_vdi_port() 2011-07-24 18:08:03 +03:00
Arnon Gilboa
407acb2288 vdservice: clean agent proc handle in kill_agent()
fill_agent_events() will not add it to the events used by WaitFor(),
preventing usage of a dead process handle.
2011-07-24 18:08:02 +03:00
Arnon Gilboa
e0a75c9042 vdservice: use overlap ConnectNamedPipe() in launch_agent()
passing NULL is buggy when pipe opened with FILE_FLAG_OVERLAPPED
2011-07-24 18:07:46 +03:00
Arnon Gilboa
f1bc45e53b vdservice: add control events RHBZ #719140 #722980
-prevent race between service control manager (SCM) & the service main thread.
-use events for stop, logon, agent restart.
-thread-safe control command queue
2011-07-24 17:53:59 +03:00
Arnon Gilboa
0d43d537c6 vdservice: support w2k3 32/64/r2, w2k8 32/64/r2 (rhbz#683166) 2011-04-28 11:08:57 +03:00
Arnon Gilboa
bc74bd6e79 vdservice: don't close pipe if overlapped I/O event is not in signaled state (rhbz#667777)
which is beacuse ReadFile completed successfully without pending and the data was already consumed
2011-04-28 11:08:48 +03:00
Alon Levy
0f92cbea70 vdi_port refactor: introduce old pci_vdi_port
This patch is a little dirty due to EOL convertion to windows format.

 + add pci_vdi_port with PCIVDIPort taken from last commit before
  changing to virtio-serial (a17ccbf323)
 + move handle_error to VDIPort (identical in VIRTIOVDIPort and PCIVDIPort)
 + make VDService create first a virtio, then init, the pci, then init,
  stopping when the first init succeeds, and reporting to log which was
  created.
2011-01-11 17:18:47 +02:00
Alon Levy
935330f996 vdi_port refactor: move ring handling to VDIPort, split h file, remove some debug prints 2011-01-11 17:18:02 +02:00
Alon Levy
904b0860b3 vdi_port refactor: introduce interface
make VDIPort an abstract class.
rename old VDIPort VirtioVDIPort.
h file for virtio_vdi_port will be introduced later.
2011-01-11 17:17:47 +02:00
Alon Levy
842950d67c start refactoring vdi_port
introduce VDIPort::get_num_events and VDIPort::fill_events,
change VDService::_events to be dynamically allocated
document _events contents: STATIC events, then vdi_port, then agent.
2011-01-11 17:17:18 +02:00
Arnon Gilboa
35d1b7c835 Revert "vdservice: don't start when no qxl device present"
This reverts commit 349e6a5bf8 which breaks vsdervice on Windows 7
2010-11-09 20:50:21 +02:00
Arnon Gilboa
d3154e89a2 vdservice: replace VDAgentDataChunk with VDIChunkHeader 2010-09-21 19:03:09 +02:00
Alon Levy
349e6a5bf8 vdservice: don't start when no qxl device present 2010-08-24 14:56:28 +03:00
Yonit Halperin
5833dc9760 Controlling Windows display settings (e.g., wallpaper, UI effects and font smoothing)
The configuration is received from Spice client.
The main usage of this option is for disabling display features in order to accelerate Spice performance over limited network connections.
2010-08-24 10:36:05 +03:00
Arnon Gilboa
81cd5620d2 vdservice/vdagent: fixes leading to clipboard (aka large) message handling
-add VDAgent::dispatch_message()
-in VDAgent::read_completion() handle multi-chunk msgs
-fix chunk size bug in VDService::handle_pipe_data()
-add size to VDPipeMessage
2010-08-23 18:54:25 +03:00
Alon Levy
feab057101 vdservice: change pipe write completion to use overlapped structure instead of completion routine 2010-08-23 18:54:18 +03:00
Alon Levy
f3277bd9b7 vdservice: add debug only define for standalone executable 2010-08-23 18:54:12 +03:00
Alon Levy
a32359a4dd vdservice: use enum for events in main loop 2010-08-23 18:54:05 +03:00
Alon Levy
1724de8a43 vdservice: replace vdiport device with virtio-serial device
replaced vdiport device by virtio-serial device which is also an easy
to use stream between guest and host but is already in qemu.

 * VDIPortBuffer split off from VDIPort
 * use setupapi to get device path
  * setupapi.lib dependency added, magic GUID instead of a magic filename
 * retry several times to open device, fixes startup race between driver
   initialization and service start on boot.
 * limit writes to device, a limitation of current windows driver.
 * virtio-serial uses overlapped structure and events for async read/write
   instead of vdi_port special event.
2010-08-23 18:53:49 +03:00
Alon Levy
a17ccbf323 include path fixes because of spice-protcol updates
* mutex.h inlined into common/vdcommon.h
 * vdagent.h renamed to spice/vd_agent.h
2010-08-23 18:53:24 +03:00
Arnon Gilboa
b850d5a8c7 spice: vdagent: return error code -1 on service install/uninstall failure #576625 2010-08-23 18:52:27 +03:00
Arnon Gilboa
f915fa4a72 vdagent: add win7 support to service for launching agent 2009-12-23 15:31:01 +02:00
Arnon Gilboa
5ee7b5b270 fresh start 2009-11-05 13:02:54 +02:00