]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: add a comment about our fake qmp
authorEric Blake <eblake@redhat.com>
Thu, 31 Jan 2013 01:50:09 +0000 (18:50 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 31 Jan 2013 17:15:33 +0000 (10:15 -0700)
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

index d1b2ab5b05905104aa8f5077e312b35f87bb3471..7b90c385f9466d3e697b806de3bff804c8301cab 100644 (file)
@@ -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)