|
From: | Eric Blake |
Subject: | Re: [PATCH v4 4/7] nbd: Update qapi to support exporting multiple bitmaps |
Date: | Mon, 19 Oct 2020 16:45:36 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 10/14/20 7:15 AM, Vladimir Sementsov-Ogievskiy wrote:
10.10.2020 00:55, Eric Blake wrote:Since 'nbd-server-add' is deprecated, and 'block-export-add' is new to 5.2, we can still tweak the interface. Allowing 'bitmaps':['str'] is nicer than 'bitmap':'str'. This wires up the qapi and qemu-nbd changes to permit passing multiple bitmaps as distinct metadata contexts that the NBD client may request, but the actual support for more than one will require a further patch to the server. Signed-off-by: Eric Blake <eblake@redhat.com> ---[..]break; case 'B': - bitmap = optarg; + tmp = g_new(strList, 1); + tmp->value = g_strdup(optarg); + tmp->next = bitmaps; + bitmaps = tmp;If publish QAPI_LIST_ADD, defined in block.c, it would look like: QAPI_LIST_ADD(bitmaps, g_strdup(optarg));
#define QAPI_LIST_ADD(list, element) do { \ typeof(list) _tmp = g_new(typeof(*(list)), 1); \ _tmp->value = (element); \ _tmp->next = (list); \ (list) = _tmp; \ } while (0)Markus, thoughts on if we should publish this macro, and if so, which header would be best?
anyway: Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |