On Wed, Jan 30, 2013 at 07:02:04PM -0700, Eric Blake wrote: > While testing QMP, I used a simple qemu session of > 'qemu-kvm -M none -nodefaults -nographic -qmp stdio' > for some experiments. But it took me far too long to remember > the magic invocation to unlock QMP into accepting normal commands. > While I was able to grep libvirt sources and easily find where > libvirt expects the normal "QMP" greeting, I could not find the > proper reply to that greeting nearby. > > Reading the testsuite didn't help either, since there we don't > emulate the mandatory handshake. But since my grep hit the > testsuite, adding a bit of documentation will make it much easier > to jog my memory in the future. > > * tests/qemumonitortestutils.c (QEMU_JSON_GREETING): Mention that > the normal counterpart reply is skipped. > --- > tests/qemumonitortestutils.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c > index d1b2ab5..7b90c38 100644 > --- a/tests/qemumonitortestutils.c > +++ b/tests/qemumonitortestutils.c > @@ -1,5 +1,5 @@ > /* > - * Copyright (C) 2011-2012 Red Hat, Inc. > + * Copyright (C) 2011-2013 Red Hat, Inc. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Lesser General Public > @@ -439,6 +439,8 @@ static qemuMonitorCallbacks qemuCallbacks = { > }; > > #define QEMU_JSON_GREETING "{\"QMP\": {\"version\": {\"qemu\": {\"micro\": > 1, \"minor\": 0, \"major\": 1}, \"package\": \" (qemu-kvm-1.0.1)\"}, > \"capabilities\": []}}" > +/* We skip the normal handshake reply of > "{\"execute\":\"qmp_capabilities\"}" */ > + > #define QEMU_TEXT_GREETING "QEMU 1.0,1 monitor - type 'help' for more > information" > > qemuMonitorTestPtr qemuMonitorTestNew(bool json, virCapsPtr caps)
ACK 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 :| -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list