diff mbox

[15/16] qapi: Change data type of the FOO_lookup generated for enum FOO

Message ID 878ti9nvbk.fsf@dusky.pond.sub.org
State New
Headers show

Commit Message

Markus Armbruster Aug. 24, 2017, 9:55 a.m. UTC
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 mbox

Patch

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) {