Statistics
| Branch: | Revision:

root / qapi @ e2d87bff

# Date Author Comment
f22d85e9 04/30/2012 04:42 pm Michael Roth

qemu-ga: add a whitelist for fsfreeze-safe commands

Currently we rely on fsfreeze/thaw commands disabling/enabling logging
then having other commands check whether logging is disabled to avoid
executing if they aren't safe for running while a filesystem is frozen....

57a33d89 04/23/2012 07:03 pm NODA, Kai

qapi: g_hash_table_find() instead of GHashTableIter.

GHashTableIter was first introduced in glib 2.16.
This patch removes it in favor of older g_hash_table_find()
for better compatibility with RHEL5.

Signed-off-by: NODA, Kai <>
Signed-off-by: Luiz Capitulino <>

e38ac962 03/27/2012 03:15 pm Paolo Bonzini

qapi: add strict mode to input visitor

While QMP in general is designed so that it is possible to ignore
unknown arguments, in the case of the QMP server it is better to
reject them to detect bad clients. In fact, we're already doing
this at the top level in the argument checker. To extend this to...

4faaec6a 03/27/2012 03:15 pm Paolo Bonzini

qapi: place outermost object on qiv stack

This is a slight change in the implementation of QMPInputVisitor
that helps when adding strict mode.

Const QObjects cannot be inc/decref-ed, and that's why QMPInputVisitor
relies heavily on weak references to inner objects. I'm not removing...

3a86a0fa 03/27/2012 03:14 pm Paolo Bonzini

qapi: untangle next_list

Right now, the semantics of next_list are complicated. The caller must:

  • call start_list
  • call next_list for each element including the first
  • on the first call to next_list, the second argument should point to
    NULL and the result is the head of the list. On subsequent calls,...
8b714d37 03/27/2012 03:13 pm Paolo Bonzini

qapi: fix memory leak on error

QmpInputVisitor would leak the malloced struct if the stack was
overflowed. This can be easily fixed using error_propagate.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>...

2c7ff933 03/27/2012 03:13 pm Paolo Bonzini

qapi: fail hard on stack imbalance

QmpOutputVisitor will segfault if an imbalanced end function is
called. So we can abort in QmpInputVisitor too.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Anthony Liguori <>
Signed-off-by: Luiz Capitulino <>

f24582d6 03/27/2012 03:11 pm Laszlo Ersek

qapi: fix double free in qmp_output_visitor_cleanup()

Stack entries in QmpOutputVisitor are navigation links (weak references),
except the bottom (ie. least recently added) entry, which owns the root
QObject [1]. Make qmp_output_visitor_cleanup() drop the stack entries,...

0f71a1e0 02/21/2012 11:21 am Paolo Bonzini

qapi: allow sharing enum implementation across visitors

Most visitors will use the same code for enum parsing. Move it to
the core.

Signed-off-by: Paolo Bonzini <>

9f9ab465 02/21/2012 11:21 am Paolo Bonzini

qapi: drop qmp_input_end_optional

This method is optional, do not implement it if it is empty.

Signed-off-by: Paolo Bonzini <>

a020f980 02/21/2012 11:21 am Paolo Bonzini

qapi: add string-based visitors

String based visitors provide a consistent interface for parsing
strings to C values, as well as consuming C values as strings.
They will be used to parse command-line options.

Signed-off-by: Paolo Bonzini <>

47c6d3ec 12/19/2011 06:27 pm Paolo Bonzini

qapi: protect against NULL QObject in qmp_input_get_object

A NULL qobj can occur when a parameter is fetched via qdict_get, but
the parameter is not in the command. By returning NULL, the caller can
choose whether to raise a missing parameter error, an invalid parameter...

abd6cf6d 12/13/2011 01:06 am Michael Roth

guest agent: add RPC blacklist command-line option

This adds a command-line option, -b/--blacklist, that accepts a
comma-seperated list of RPCs to disable, or prints a list of
available RPCs if passed "?".

In consequence this also adds general blacklisting and RPC listing...

bf95c0d5 12/13/2011 01:06 am Michael Roth

guest agent: add supported command list to guest-info RPC

Not that there is blacklisting functionality we can no longer infer
the agent's capabilities via version. This patch extends the current
guest-info RPC to also return a list of dictionaries containing the name...

54d50be6 11/17/2011 07:15 pm Luiz Capitulino

qapi: Check for negative enum values

We don't currently check for negative enum values in qmp_output_type_enum(),
this will very likely generate a segfault when triggered.

However, it seems that no code in tree can trigger this today.

Acked-by: Michael Roth <>...

776574d6 10/04/2011 05:00 pm Anthony Liguori

qapi: add code generation support for middle mode

To get the ball rolling merging QAPI, this patch introduces a "middle mode" to
the code generator. In middle mode, the code generator generates marshalling
functions that are compatible with the current QMP server. We absolutely need...

5666dd19 10/04/2011 05:00 pm Michael Roth

qapi: dealloc visitor, fix premature free and iteration logic

Currently we do 3 things wrong:

1) The list iterator, in practice, is used in a manner where the pointer
we pass in is the same as the pointer we assign the output to from
visit_next_list(). This causes an infinite loop where we keep freeing...

0b9d8542 10/04/2011 05:00 pm Michael Roth

qapi: dealloc visitor, support freeing of nested lists

Previously our logic for keeping track of when we're visiting the head
of a list was done via a global bool. This can be overwritten if dealing
with nested lists, so use stack entries to track this instead....

e1bc2f7b 10/04/2011 05:00 pm Michael Roth

qapi: modify visitor code generation for list iteration

Modify logic such that we never assign values to the list head argument
to progress through the list on subsequent iterations, instead rely only
on having our return value passed back in as an argument on the next...

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

43c20a43 07/21/2011 10:48 pm Michael Roth

qapi: add QMP command registration/lookup functions

Registration/lookup functions for that provide a lookup table for
dispatching QMP commands.

Signed-off-by: Michael Roth <>
Signed-off-by: Luiz Capitulino <>

ab02ab2a 07/21/2011 10:48 pm Michael Roth

qapi: add QMP dispatch functions

Given an object recieved via QMP, this code uses the dispatch table
provided by qmp_registry.c to call the corresponding marshalling/dispatch
function and format return values/errors for delivery to the QMP.
Currently only synchronous QMP functions are supported, but this will...

2345c77c 07/21/2011 10:48 pm Michael Roth

qapi: add QAPI visitor core

Base definitions/includes for Visiter interface used by generated
visiter/marshalling code.

Includes a GenericList type. Our lists require an embedded element.
Since these types are generated, if you want to use them in a different...

c40cc0a0 07/21/2011 10:48 pm Michael Roth

qapi: add QMP input visitor

A type of Visiter class that is used to walk a qobject's
structure and assign each entry to the corresponding native C type.
Command marshaling function will use this to pull out QMP command
parameters recieved over the wire and pass them as native arguments...

e4e6aa14 07/21/2011 10:48 pm Michael Roth

qapi: add QMP output visitor

Type of Visiter class that serves as the inverse of the input visitor:
it takes a series of native C types and uses their values to construct a
corresponding QObject. The command marshaling/dispatcher functions will
use this to convert the output of QMP functions into a QObject that can...

d5f3c29c 07/21/2011 10:48 pm Michael Roth

qapi: add QAPI dealloc visitor

Type of Visitor class that can be passed into a qapi-generated C
type's visitor function to free() any heap-allocated data types.

Signed-off-by: Michael Roth <>
Signed-off-by: Luiz Capitulino <>