mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Implement deprecated-output=hide for QMP event data
This policy suppresses deprecated bits in output, and thus permits "testing the future". Implement it for QMP event data: suppress deprecated members. No QMP event data is deprecated right now. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-6-armbru@redhat.com>
This commit is contained in:
parent
278fc2f7d3
commit
a291a38fa1
4 changed files with 32 additions and 3 deletions
|
@ -126,7 +126,7 @@ def gen_event_send(name: str,
|
|||
if have_args:
|
||||
assert arg_type is not None
|
||||
ret += mcgen('''
|
||||
v = qobject_output_visitor_new(&obj);
|
||||
v = qobject_output_visitor_new_qmp(&obj);
|
||||
''')
|
||||
if not arg_type.is_implicit():
|
||||
ret += mcgen('''
|
||||
|
@ -145,7 +145,11 @@ def gen_event_send(name: str,
|
|||
ret += mcgen('''
|
||||
|
||||
visit_complete(v, &obj);
|
||||
qdict_put_obj(qmp, "data", obj);
|
||||
if (qdict_size(qobject_to(QDict, obj))) {
|
||||
qdict_put_obj(qmp, "data", obj);
|
||||
} else {
|
||||
qobject_unref(obj);
|
||||
}
|
||||
''')
|
||||
|
||||
ret += mcgen('''
|
||||
|
@ -188,7 +192,6 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
|
|||
#include "qapi/compat-policy.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qmp/qdict.h"
|
||||
#include "qapi/qobject-output-visitor.h"
|
||||
#include "qapi/qmp-event.h"
|
||||
|
||||
''',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue