All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 15/16] qapi: Change data type of the FOO_lookup generated for enum FOO
Date: Thu, 24 Aug 2017 11:55:59 +0200	[thread overview]
Message-ID: <878ti9nvbk.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <1503564371-26090-16-git-send-email-armbru@redhat.com> (Markus Armbruster's message of "Thu, 24 Aug 2017 10:46:10 +0200")

Markus Armbruster <armbru@redhat.com> writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Currently, a FOO_lookup is an array of strings terminated by a NULL
> sentinel.
>
> A future patch will generate enums with "holes".  NULL-termination
> will cease to work then.
>
> To prepare for that, store the length in the FOO_lookup by wrapping it
> in a struct and adding a member for the length.
>
> The sentinel will be dropped next.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-Id: <20170822132255.23945-13-marcandre.lureau@redhat.com>
> [Basically redone]
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Fixup for Windows (thanks, Patchew!)


>From 594a6c8eb29e728e9fb960d321ca2d17f9bd9cd1 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Thu, 24 Aug 2017 11:48:46 +0200
Subject: [PATCH] fixup! qapi: Change data type of the FOO_lookup generated for
 enum FOO

---
 block/file-win32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/file-win32.c b/block/file-win32.c
index f2a1830..639221b 100644
--- a/block/file-win32.c
+++ b/block/file-win32.c
@@ -302,7 +302,8 @@ static bool get_aio_option(QemuOpts *opts, int flags, Error **errp)
 
     aio_default = (flags & BDRV_O_NATIVE_AIO) ? BLOCKDEV_AIO_OPTIONS_NATIVE
                                               : BLOCKDEV_AIO_OPTIONS_THREADS;
-    aio = qapi_enum_parse(BlockdevAioOptions_lookup, qemu_opt_get(opts, "aio"),
+    aio = qapi_enum_parse(&BlockdevAioOptions_lookup,
+                          qemu_opt_get(opts, "aio"),
                           aio_default, errp);
 
     switch (aio) {
-- 
2.7.5

  reply	other threads:[~2017-08-24  9:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  8:45 [Qemu-devel] [PATCH 00/16] qapi: Rework mapping of enum value to string Markus Armbruster
2017-08-24  8:45 ` [Qemu-devel] [PATCH 01/16] qapi: Update qapi-code-gen.txt examples to match current code Markus Armbruster
2017-08-24 10:43   ` Marc-André Lureau
2017-08-24 16:32   ` Eric Blake
2017-08-24 18:29     ` Markus Armbruster
2017-08-24  8:45 ` [Qemu-devel] [PATCH 02/16] qapi: Drop superfluous qapi_enum_parse() parameter max Markus Armbruster
2017-08-24 10:45   ` Marc-André Lureau
2017-08-24 16:38   ` Eric Blake
2017-08-24 18:35     ` Markus Armbruster
2017-08-24 18:56       ` Eric Blake
2017-08-24 19:24         ` Markus Armbruster
2017-08-24  8:45 ` [Qemu-devel] [PATCH 03/16] tpm: Clean up driver registration & lookup Markus Armbruster
2017-08-24  8:45 ` [Qemu-devel] [PATCH 04/16] tpm: Clean up model " Markus Armbruster
2017-08-24 10:50   ` Marc-André Lureau
2017-08-24 18:35     ` Markus Armbruster
2017-08-24  8:46 ` [Qemu-devel] [PATCH 05/16] hmp: Use qapi_enum_parse() in hmp_migrate_set_capability() Markus Armbruster
2017-08-24  8:46 ` [Qemu-devel] [PATCH 06/16] hmp: Use qapi_enum_parse() in hmp_migrate_set_parameter() Markus Armbruster
2017-08-24  8:46 ` [Qemu-devel] [PATCH 07/16] block: Use qemu_enum_parse() in blkdebug_debug_breakpoint() Markus Armbruster
2017-08-24  8:46 ` [Qemu-devel] [PATCH 08/16] quorum: Use qapi_enum_parse() in quorum_open() Markus Armbruster
2017-08-24  8:46 ` [Qemu-devel] [PATCH 09/16] crypto: Use qapi_enum_parse() in qcrypto_block_luks_name_lookup() Markus Armbruster
2017-08-24 10:53   ` Marc-André Lureau
2017-08-29 11:10   ` Daniel P. Berrange
2017-08-24  8:46 ` [Qemu-devel] [PATCH 10/16] qapi: Use qapi_enum_parse() in input_type_enum() Markus Armbruster
2017-08-24 11:30   ` Marc-André Lureau
2017-08-24  8:46 ` [Qemu-devel] [PATCH 11/16] qapi: Avoid unnecessary use of enum lookup table's sentinel Markus Armbruster
2017-08-24 11:34   ` Marc-André Lureau
2017-08-24  8:46 ` [Qemu-devel] [PATCH 12/16] qapi: Generate FOO_str() macro for QAPI enum FOO Markus Armbruster
2017-08-30 13:42   ` Marc-André Lureau
2017-08-24  8:46 ` [Qemu-devel] [PATCH 13/16] qapi: Mechanically convert FOO_lookup[...] to FOO_str(...) Markus Armbruster
2017-08-24 11:52   ` Marc-André Lureau
2017-08-24  8:46 ` [Qemu-devel] [PATCH 14/16] qapi: Convert indirect uses of FOO_lookup[...] to qapi_enum_lookup() Markus Armbruster
2017-08-24 12:02   ` Marc-André Lureau
2017-08-24  8:46 ` [Qemu-devel] [PATCH 15/16] qapi: Change data type of the FOO_lookup generated for enum FOO Markus Armbruster
2017-08-24  9:55   ` Markus Armbruster [this message]
2017-08-24  8:46 ` [Qemu-devel] [PATCH 16/16] qapi: drop the sentinel in enum array Markus Armbruster
2017-08-24  9:22 ` [Qemu-devel] [PATCH 00/16] qapi: Rework mapping of enum value to string no-reply
2017-09-01 12:43 ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878ti9nvbk.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.