On Tue, Sep 12, 2017 at 03:05:51PM +0200, Pino Toscano wrote:
On Tuesday, 12 September 2017 14:29:14 CEST Richard W.M. Jones
wrote:
> This adds two extra tests using QMP (the QEMU Monitor Protocol). This
> allows us to get extra information about the qemu binary beyond what
> is available from the version number or ‘qemu -help’.
> ---
> lib/qemu.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 175 insertions(+), 2 deletions(-)
>
> diff --git a/lib/qemu.c b/lib/qemu.c
> index bdd9947a8..34775041f 100644
> --- a/lib/qemu.c
> +++ b/lib/qemu.c
> @@ -37,6 +37,8 @@
>
> #include <libxml/uri.h>
>
> +#include <yajl/yajl_tree.h>
> +
> #include "ignore-value.h"
>
> #include "guestfs.h"
> @@ -50,9 +52,13 @@ struct qemu_data {
>
> char *qemu_help; /* Output of qemu -help. */
> char *qemu_devices; /* Output of qemu -device ? */
> + char *qmp_commands; /* Output of QMP query-commands. */
> + char *qmp_schema; /* Output of QMP query-qmp-schema. */
Considering we keep them as parsed by yajl, wouldn't it better to avoid
keeping the raw outputs too?
It's sort of necessary to keep them around given that we may need to
write them to the cache after parsing the JSON. (Given the way the
code is currently structured anyway).
At this point I was going to say it's not much memory, but actually
for qmp_schema the raw text is 99K [99 times as much memory as the
total RAM of my first computer!], although I guess the parsed JSON
qmp_schema_tree must be considerably bigger than that.
Also the result of query-commands does not seem to be used in other
patches this series. Is it going to be used in another followup
series?
qmp_commands isn't used, so we could drop it.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v