qemu-ga: add a whitelist for fsfreeze-safe commands
Currently we rely on fsfreeze/thaw commands disabling/enabling loggingthen having other commands check whether logging is disabled to avoidexecuting if they aren't safe for running while a filesystem is frozen....
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 <nodakai@gmail.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: add strict mode to input visitor
While QMP in general is designed so that it is possible to ignoreunknown arguments, in the case of the QMP server it is better toreject them to detect bad clients. In fact, we're already doingthis at the top level in the argument checker. To extend this to...
qapi: place outermost object on qiv stack
This is a slight change in the implementation of QMPInputVisitorthat helps when adding strict mode.
Const QObjects cannot be inc/decref-ed, and that's why QMPInputVisitorrelies heavily on weak references to inner objects. I'm not removing...
qapi: untangle next_list
Right now, the semantics of next_list are complicated. The caller must:
qapi: fix memory leak on error
QmpInputVisitor would leak the malloced struct if the stack wasoverflowed. This can be easily fixed using error_propagate.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qapi: fail hard on stack imbalance
QmpOutputVisitor will segfault if an imbalanced end function iscalled. So we can abort in QmpInputVisitor too.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
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 rootQObject [1]. Make qmp_output_visitor_cleanup() drop the stack entries,...
qapi: allow sharing enum implementation across visitors
Most visitors will use the same code for enum parsing. Move it tothe core.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi: drop qmp_input_end_optional
This method is optional, do not implement it if it is empty.
qapi: add string-based visitors
String based visitors provide a consistent interface for parsingstrings to C values, as well as consuming C values as strings.They will be used to parse command-line options.
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.