qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 15/15] qapi: Generate simpler marshalling code when no arg


From: Eric Blake
Subject: Re: [PATCH v2 15/15] qapi: Generate simpler marshalling code when no arguments
Date: Fri, 24 Apr 2020 09:02:03 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 4/24/20 3:43 AM, Markus Armbruster wrote:
When command FOO has no arguments, its generated qmp_marshal_FOO() is
a bit confusing.  Make it simpler:

      visit_start_struct(v, NULL, NULL, 0, &err);
      if (err) {
          goto out;
      }
-
-    if (!err) {
-        visit_check_struct(v, &err);
-    }
+    visit_check_struct(v, &err);
      visit_end_struct(v, NULL);
      if (err) {
          goto out;
      }

Signed-off-by: Markus Armbruster <address@hidden>
---
  scripts/qapi/commands.py | 40 ++++++++++++++++++++++++----------------
  1 file changed, 24 insertions(+), 16 deletions(-)


A bit more complex in the generator, but the generated code is indeed better.

Reviewed-by: Eric Blake <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]