qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Guest-sync-delimited and sentinel issue
@ 2012-03-16 12:47 Michal Privoznik
  2012-03-16 14:49 ` Michael Roth
  2012-03-16 15:07 ` Eric Blake
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Privoznik @ 2012-03-16 12:47 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Michael Roth

Hi guys,

I was just implementing support for guest-sync-delimited into libvirt. My intent is to issue this command prior any other command to determine if GA is available or not. The big advantage is - it doesn't change the state of the guest so from libvirt POV it's harmless. The other big advantage is this sentinel byte 0xFF which is supposed to flush all unprocessed (and possibly stale) data from previous unsuccessful tries.

As written in documentation, this command will output sentinel byte to the guest agent socket. This works perfectly. However, it is advised in the very same documentation to prepend this command with the sentinel as well allowing GA parser flush. But this doesn't work for me completely. All I can get is:

$ echo -e "\xFF{\"execute\":\"guest-sync-delimited\", \"arguments\":{\"id\":1234}}" | nc -U /tmp/ga.sock | hexdump -C
nc: using stream socket
00000000  7b 22 65 72 72 6f 72 22  3a 20 7b 22 63 6c 61 73  |{"error": {"clas|
00000010  73 22 3a 20 22 4a 53 4f  4e 50 61 72 73 69 6e 67  |s": "JSONParsing|
00000020  22 2c 20 22 64 61 74 61  22 3a 20 7b 7d 7d 7d 0a  |", "data": {}}}.|
00000030  ff 7b 22 72 65 74 75 72  6e 22 3a 20 31 32 33 34  |.{"return": 1234|
00000040  7d 0a                                             |}.|
00000042

The problem is - GA has difficulties with parsing sentinel, although the reply is correct, indeed.
Therefore my question is - should I just drop passing sentinel to GA? And even if this is fixed, How should I deal with older releases which have this bug?

Regards,
Michal

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-16 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 12:47 [Qemu-devel] Guest-sync-delimited and sentinel issue Michal Privoznik
2012-03-16 14:49 ` Michael Roth
2012-03-16 16:04   ` Michal Privoznik
2012-03-16 17:26     ` Michael Roth
2012-03-16 15:07 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).