qemu/qga
Michael Roth 3cf0bed836 qemu-ga: add guest-sync-delimited
guest-sync leaves it as an exercise to the user as to how to reliably
obtain the response to guest-sync if the client had previously read in a
partial response (due qemu-ga previously being restarted mid-"sentence"
due to reboot, forced restart, etc).

qemu-ga handles this situation on its end by having a client precede
their guest-sync request with a 0xFF byte (invalid UTF-8), which
qemu-ga/QEMU JSON parsers will treat as a flush event. Thus we can
reliably flush the qemu-ga parser state in preparation for receiving
the guest-sync request.

guest-sync-delimited provides the same functionality for a client: when
a guest-sync-delimited is issued, qemu-ga will precede it's response
with a 0xFF byte that the client can use as an indicator to flush its
buffer/parser state in preparation for reliably receiving the
guest-sync-delimited response.

It is also useful as an optimization for clients, since, after issuing a
guest-sync-delimited, clients can safely discard all stale data read
from the channel until the 0xFF is found.

More information available on the wiki:

http://wiki.qemu.org/Features/QAPI/GuestAgent#QEMU_Guest_Agent_Protocol

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-03-12 15:09:23 -05: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: add guest-sync-delimited 2012-03-12 15:09:23 -05:00
commands-win32.c qemu-ga: add guest-network-get-interfaces command 2012-03-12 15:09:18 -05:00
commands.c qemu-ga: add guest-sync-delimited 2012-03-12 15:09:23 -05: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: add guest-sync-delimited 2012-03-12 15:09:23 -05:00
service-win32.c qemu-ga: add Windows service integration 2012-02-23 15:43:50 -06:00
service-win32.h qemu-ga: add Windows service integration 2012-02-23 15:43:50 -06:00