From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rumgj-0003xP-25 for qemu-devel@nongnu.org; Tue, 07 Feb 2012 10:10:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rumgb-0004K4-4E for qemu-devel@nongnu.org; Tue, 07 Feb 2012 10:10:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rumga-0004Jp-QE for qemu-devel@nongnu.org; Tue, 07 Feb 2012 10:10:25 -0500 Date: Tue, 7 Feb 2012 15:09:18 +0000 From: "Daniel P. Berrange" Message-ID: <20120207150918.GO3785@redhat.com> References: <1328573255-13410-1-git-send-email-mdroth@linux.vnet.ibm.com> <1328573255-13410-2-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1328573255-13410-2-git-send-email-mdroth@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] qemu-ga: add guest-sync-delimited Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: libvir-list@redhat.com, mprivozn@redhat.com, qemu-devel@nongnu.org On Mon, Feb 06, 2012 at 06:07:35PM -0600, Michael Roth wrote: > 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. > > More information available on the wiki: > > http://wiki.qemu.org/Features/QAPI/GuestAgent#QEMU_Guest_Agent_Protocol > > Signed-off-by: Michael Roth This looks good from the libvirt POV. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|