qapi: protect against NULL QObject in qmp_input_get_object
A NULL qobj can occur when a parameter is fetched via qdict_get, butthe parameter is not in the command. By returning NULL, the caller canchoose whether to raise a missing parameter error, an invalid parameter...
guest agent: add RPC blacklist command-line option
This adds a command-line option, -b/--blacklist, that accepts acomma-seperated list of RPCs to disable, or prints a list ofavailable RPCs if passed "?".
In consequence this also adds general blacklisting and RPC listing...
guest agent: add supported command list to guest-info RPC
Not that there is blacklisting functionality we can no longer inferthe agent's capabilities via version. This patch extends the currentguest-info RPC to also return a list of dictionaries containing the name...
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 <mdroth@linux.vnet.ibm.com>...
qapi: add code generation support for middle mode
To get the ball rolling merging QAPI, this patch introduces a "middle mode" tothe code generator. In middle mode, the code generator generates marshallingfunctions that are compatible with the current QMP server. We absolutely need...
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 pointerwe pass in is the same as the pointer we assign the output to fromvisit_next_list(). This causes an infinite loop where we keep freeing...
qapi: dealloc visitor, support freeing of nested lists
Previously our logic for keeping track of when we're visiting the headof a list was done via a global bool. This can be overwritten if dealingwith nested lists, so use stack entries to track this instead....
qapi: modify visitor code generation for list iteration
Modify logic such that we never assign values to the list head argumentto progress through the list on subsequent iterations, instead rely onlyon having our return value passed back in as an argument on the next...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: add QMP command registration/lookup functions
Registration/lookup functions for that provide a lookup table fordispatching QMP commands.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
qapi: add QMP dispatch functions
Given an object recieved via QMP, this code uses the dispatch tableprovided by qmp_registry.c to call the corresponding marshalling/dispatchfunction and format return values/errors for delivery to the QMP.Currently only synchronous QMP functions are supported, but this will...
qapi: add QAPI visitor core
Base definitions/includes for Visiter interface used by generatedvisiter/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...
qapi: add QMP input visitor
A type of Visiter class that is used to walk a qobject'sstructure and assign each entry to the corresponding native C type.Command marshaling function will use this to pull out QMP commandparameters recieved over the wire and pass them as native arguments...
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 acorresponding QObject. The command marshaling/dispatcher functions willuse this to convert the output of QMP functions into a QObject that can...
qapi: add QAPI dealloc visitor
Type of Visitor class that can be passed into a qapi-generated Ctype's visitor function to free() any heap-allocated data types.