diff options
| author | Eric Blake | 2020-10-27 06:05:48 +0100 |
|---|---|---|
| committer | Eric Blake | 2020-10-30 21:10:14 +0100 |
| commit | 8675cbd68be7da35a61e391fbb5b95ac67bc7d72 (patch) | |
| tree | c8fc80567dd259be7c07a4b7379808fd42077f16 /docs/system | |
| parent | qapi: Add QAPI_LIST_PREPEND() macro (diff) | |
| download | qemu-8675cbd68be7da35a61e391fbb5b95ac67bc7d72.tar.gz qemu-8675cbd68be7da35a61e391fbb5b95ac67bc7d72.tar.xz qemu-8675cbd68be7da35a61e391fbb5b95ac67bc7d72.zip | |
nbd: Utilize QAPI_CLONE for type conversion
Rather than open-coding the translation from the deprecated
NbdServerAddOptions type to the preferred BlockExportOptionsNbd, it's
better to utilize QAPI_CLONE_MEMBERS. This solves a couple of issues:
first, if we do any more refactoring of the base type (which an
upcoming patch plans to do), we don't have to revisit the open-coding.
Second, our assignment to arg->name is fishy: the generated QAPI code
for qapi_free_NbdServerAddOptions does not visit arg->name if
arg->has_name is false, but if it DID visit it, we would have
introduced a double-free situation when arg is finally freed.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201027050556.269064-4-eblake@redhat.com>
Diffstat (limited to 'docs/system')
0 files changed, 0 insertions, 0 deletions
