Markus Armbruster <arm...@redhat.com> writes: > From: Marc-André Lureau <marcandre.lur...@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.lur...@redhat.com> > Message-Id: <20170822132255.23945-13-marcandre.lur...@redhat.com> > [Basically redone] > Signed-off-by: Markus Armbruster <arm...@redhat.com>
Fixup for Windows (thanks, Patchew!) >From 594a6c8eb29e728e9fb960d321ca2d17f9bd9cd1 Mon Sep 17 00:00:00 2001 From: Markus Armbruster <arm...@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