qemu/qga
Michael Roth 7868e26e59 qemu-ga: add initial win32 support
This adds a win32 channel implementation that makes qemu-ga functional
on Windows using virtio-serial (unix-listen/isa-serial not currently
implemented). Unlike with the posix implementation, we do not use
GIOChannel for the following reasons:

 - glib calls stat() on an fd to check whether S_IFCHR is set, which is
   the case for virtio-serial on win32. Because of that, a one-time
   check to determine whether the channel is readable is done by making
   a call to PeekConsoleInput(), which reports the underlying handle is
   not a valid console handle, and thus we can never read from the
   channel.

 - if one goes as far as to "trick" glib into thinking it is a normal
   file descripter, the buffering is done in such a way that data
   written to the output stream will subsequently result in that same
   data being read back as if it were input, causing an error loop.
   furthermore, a forced flush of the channel only moves the data into a
   secondary buffer managed by glib, so there's no way to prevent output
   from getting read back as input.

The implementation here ties into the glib main loop by implementing a
custom GSource that continually submits asynchronous/overlapped I/O to
fill an GAChannel-managed read buffer, and tells glib to poll the
corresponding event handle for a completion whenever there is no
data/RPC in the read buffer to notify the main application about.
2012-02-23 15:43:49 -06:00
..
channel-posix.c qemu-ga: move channel/transport functionality into wrapper class 2012-02-23 15:40:16 -06:00
channel-win32.c qemu-ga: add initial win32 support 2012-02-23 15:43:49 -06:00
channel.h qemu-ga: move channel/transport functionality into wrapper class 2012-02-23 15:40:16 -06:00
commands-posix.c qemu-ga: rename guest-agent-commands.c -> commands-posix.c 2012-02-23 15:40:16 -06:00
commands-win32.c qemu-ga: fixes for win32 build of qemu-ga 2012-02-23 15:40:16 -06:00
commands.c qemu-ga: separate out common commands from posix-specific ones 2012-02-23 15:40:16 -06:00
guest-agent-command-state.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
guest-agent-core.h qemu-ga: separate out common commands from posix-specific ones 2012-02-23 15:40:16 -06:00