On 09/28/2012 09:43 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Start a QEMU process using
$QEMU -S -no-user-config -nodefaults \
-nographic -M none -qmp unix:/some/path,server,nowait
and talk QMP over stdio to discover what capabilities the
binary supports. This works for QEMU 1.2.0 or later and
for older QEMU automatically fallback to the old approach
of parsing -help and related command line args.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 419 +++++++++++++++++++++++++++++++++++++++----
src/qemu/qemu_capabilities.h | 5 +-
src/qemu/qemu_driver.c | 2 +-
3 files changed, 385 insertions(+), 41 deletions(-)
+ char *monarg = NULL;
+ char *monpath = NULL;
+
+ if (virAsprintf(&monpath, "%s/%s", libDir,
"capabilities.monitor.sock") < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ if (virAsprintf(&monarg, "unix:%s,server,nowait", monpath) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
I would have used virCommandAddArgFormat() instead of creating my own
temporary string here, but that's minor.
ACK; you fixed my concerns from the previous version.
Also, be sure you run 'make check'; somewhere between commit de29867 and
7022b09, you broke qemuhelptest (I'm assuming it will get fixed soon,
perhaps by this commit, so I'm not chasing which commit did the actual
breakage):
16) QEMU Help String Parsing qemu-1.2.0
... qemu-1.2.0: computed flags do not match: got
0x0000b0f2f1bffefff4cffd62fffddc6e, expected
0x0000b0f2f1bffefff4effd72fffddc6e
Missing flag 36
Missing flag 53
FAILED
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org