From f7abe0ecd4973dfe36944b916c5b9cf8ec199b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 24 Aug 2017 10:46:10 +0200 Subject: qapi: Change data type of the FOO_lookup generated for enum FOO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Message-Id: <20170822132255.23945-13-marcandre.lureau@redhat.com> [Basically redone] Signed-off-by: Markus Armbruster Message-Id: <1503564371-26090-16-git-send-email-armbru@redhat.com> [Rebased] --- block/quorum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/quorum.c') diff --git a/block/quorum.c b/block/quorum.c index 8d1c9f6306..272f9a5b77 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -912,7 +912,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags, if (!pattern_str) { ret = QUORUM_READ_PATTERN_QUORUM; } else { - ret = qapi_enum_parse(QuorumReadPattern_lookup, pattern_str, + ret = qapi_enum_parse(&QuorumReadPattern_lookup, pattern_str, -EINVAL, NULL); } if (ret < 0) { -- cgit v1.2.3