|
| From: | Eric Blake |
| Subject: | Re: [PATCH 16/46] qemu-option: Make functions taking Error ** return bool, not void |
| Date: | Wed, 24 Jun 2020 14:55:28 -0500 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 6/24/20 11:43 AM, Markus Armbruster wrote:
See recent commit "error: Document Error API usage rules" for rationale. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- include/qemu/option.h | 16 ++++---- blockdev.c | 5 ++- util/qemu-option.c | 92 +++++++++++++++++++++++++------------------ 3 files changed, 64 insertions(+), 49 deletions(-)
-static void qemu_opts_from_qdict_entry(QemuOpts *opts,
+static bool qemu_opts_from_qdict_entry(QemuOpts *opts,
const QDictEntry *entry,
Error **errp)
{
const char *key = qdict_entry_key(entry);
QObject *obj = qdict_entry_value(entry);
- char buf[32], *tmp = NULL;
+ char buf[32];
+ g_autofree char *tmp = NULL;
A bit fancier than a straight mechanical conversion here, but it works. Reviewed-by: Eric Blake <eblake@redhat.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] |