* [PATCH] docs/devel/qapi-code-gen: Update examples to match current code
@ 2021-07-12 15:02 Markus Armbruster
2021-07-20 16:09 ` John Snow
0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2021-07-12 15:02 UTC (permalink / raw)
To: qemu-devel; +Cc: jsnow
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
docs/devel/qapi-code-gen.txt | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index c1cb6f987d..233022184b 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -1496,8 +1496,12 @@ Example:
bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error **errp);
- bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp);
- bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp);
+
+ bool visit_type_UserDefOne(Visitor *v, const char *name,
+ UserDefOne **obj, Error **errp);
+
+ bool visit_type_UserDefOneList(Visitor *v, const char *name,
+ UserDefOneList **obj, Error **errp);
bool visit_type_q_obj_my_command_arg_members(Visitor *v, q_obj_my_command_arg *obj, Error **errp);
@@ -1518,7 +1522,8 @@ Example:
return true;
}
- bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne **obj, Error **errp)
+ bool visit_type_UserDefOne(Visitor *v, const char *name,
+ UserDefOne **obj, Error **errp)
{
bool ok = false;
@@ -1528,6 +1533,7 @@ Example:
if (!*obj) {
/* incomplete */
assert(visit_is_dealloc(v));
+ ok = true;
goto out_obj;
}
if (!visit_type_UserDefOne_members(v, *obj, errp)) {
@@ -1543,7 +1549,8 @@ Example:
return ok;
}
- bool visit_type_UserDefOneList(Visitor *v, const char *name, UserDefOneList **obj, Error **errp)
+ bool visit_type_UserDefOneList(Visitor *v, const char *name,
+ UserDefOneList **obj, Error **errp)
{
bool ok = false;
UserDefOneList *tail;
@@ -1628,11 +1635,13 @@ Example:
$ cat qapi-generated/example-qapi-commands.c
[Uninteresting stuff omitted...]
- static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in, QObject **ret_out, Error **errp)
+
+ static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in,
+ QObject **ret_out, Error **errp)
{
Visitor *v;
- v = qobject_output_visitor_new(ret_out);
+ v = qobject_output_visitor_new_qmp(ret_out);
if (visit_type_UserDefOne(v, "unused", &ret_in, errp)) {
visit_complete(v, ret_out);
}
@@ -1650,7 +1659,7 @@ Example:
UserDefOne *retval;
q_obj_my_command_arg arg = {0};
- v = qobject_input_visitor_new(QOBJECT(args));
+ v = qobject_input_visitor_new_qmp(QOBJECT(args));
if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
goto out;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] docs/devel/qapi-code-gen: Update examples to match current code
2021-07-12 15:02 [PATCH] docs/devel/qapi-code-gen: Update examples to match current code Markus Armbruster
@ 2021-07-20 16:09 ` John Snow
0 siblings, 0 replies; 2+ messages in thread
From: John Snow @ 2021-07-20 16:09 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 3278 bytes --]
On Mon, Jul 12, 2021 at 11:02 AM Markus Armbruster <armbru@redhat.com>
wrote:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
I assume this is about making the examples match the current output
exactly, so we're doing some updates for spacing and so on.
I'll trust it.
Acked-by: John Snow <jsnow@redhat.com>
> ---
> docs/devel/qapi-code-gen.txt | 23 ++++++++++++++++-------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
> index c1cb6f987d..233022184b 100644
> --- a/docs/devel/qapi-code-gen.txt
> +++ b/docs/devel/qapi-code-gen.txt
> @@ -1496,8 +1496,12 @@ Example:
>
>
> bool visit_type_UserDefOne_members(Visitor *v, UserDefOne *obj, Error
> **errp);
> - bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne
> **obj, Error **errp);
> - bool visit_type_UserDefOneList(Visitor *v, const char *name,
> UserDefOneList **obj, Error **errp);
> +
> + bool visit_type_UserDefOne(Visitor *v, const char *name,
> + UserDefOne **obj, Error **errp);
> +
> + bool visit_type_UserDefOneList(Visitor *v, const char *name,
> + UserDefOneList **obj, Error **errp);
>
> bool visit_type_q_obj_my_command_arg_members(Visitor *v,
> q_obj_my_command_arg *obj, Error **errp);
>
> @@ -1518,7 +1522,8 @@ Example:
> return true;
> }
>
> - bool visit_type_UserDefOne(Visitor *v, const char *name, UserDefOne
> **obj, Error **errp)
> + bool visit_type_UserDefOne(Visitor *v, const char *name,
> + UserDefOne **obj, Error **errp)
> {
> bool ok = false;
>
> @@ -1528,6 +1533,7 @@ Example:
> if (!*obj) {
> /* incomplete */
> assert(visit_is_dealloc(v));
> + ok = true;
> goto out_obj;
> }
> if (!visit_type_UserDefOne_members(v, *obj, errp)) {
> @@ -1543,7 +1549,8 @@ Example:
> return ok;
> }
>
> - bool visit_type_UserDefOneList(Visitor *v, const char *name,
> UserDefOneList **obj, Error **errp)
> + bool visit_type_UserDefOneList(Visitor *v, const char *name,
> + UserDefOneList **obj, Error **errp)
> {
> bool ok = false;
> UserDefOneList *tail;
> @@ -1628,11 +1635,13 @@ Example:
> $ cat qapi-generated/example-qapi-commands.c
> [Uninteresting stuff omitted...]
>
> - static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in, QObject
> **ret_out, Error **errp)
> +
> + static void qmp_marshal_output_UserDefOne(UserDefOne *ret_in,
> + QObject **ret_out, Error **errp)
> {
> Visitor *v;
>
> - v = qobject_output_visitor_new(ret_out);
> + v = qobject_output_visitor_new_qmp(ret_out);
> if (visit_type_UserDefOne(v, "unused", &ret_in, errp)) {
> visit_complete(v, ret_out);
> }
> @@ -1650,7 +1659,7 @@ Example:
> UserDefOne *retval;
> q_obj_my_command_arg arg = {0};
>
> - v = qobject_input_visitor_new(QOBJECT(args));
> + v = qobject_input_visitor_new_qmp(QOBJECT(args));
> if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
> goto out;
> }
> --
> 2.31.1
>
>
[-- Attachment #2: Type: text/html, Size: 4399 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-20 16:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-12 15:02 [PATCH] docs/devel/qapi-code-gen: Update examples to match current code Markus Armbruster
2021-07-20 16:09 ` John Snow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).