Received: from eggs.gnu.org ([2001:4830:134:3::10]:42004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNdPk-0002VQ-Gm for qemu-devel@nongnu.org; Tue, 17 Feb 2015 03:21:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNdPg-0004GF-G7 for qemu-devel@nongnu.org; Tue, 17 Feb 2015 03:21:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNdPg-0004G5-8W for qemu-devel@nongnu.org; Tue, 17 Feb 2015 03:21:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1H8LkxV019013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Feb 2015 03:21:47 -0500 From: Markus Armbruster References: <1424097865-3973-1-git-send-email-armbru@redhat.com> <1424097865-3973-7-git-send-email-armbru@redhat.com> <54E274FC.9080908@redhat.com> Date: Tue, 17 Feb 2015 09:21:44 +0100 In-Reply-To: <54E274FC.9080908@redhat.com> (Eric Blake's message of "Mon, 16 Feb 2015 15:53:48 -0700") Message-ID: <878ufxne1z.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 06/13] QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, kraxel@redhat.com Eric Blake writes: > On 02/16/2015 07:44 AM, Markus Armbruster wrote: >> qemu_opt_set() is a wrapper around qemu_opt_set() that reports the >> error with qerror_report_err(). >> >> Most of its users assume the function can't fail. Make them use >> qemu_opt_set_err() with &error_abort, so that should the assumption >> ever break, it'll break noisily. >> >> Just two users remain, in util/qemu-config.c. Switch them to >> qemu_opt_set_err() as well, then rename qemu_opt_set_err() to >> qemu_opt_set(). > > Might be better to split this into fixing the two users in one patch, > then doing the rename in another (since the rename touches more than two > callers). On the other hand, it would represent more churn with > changing existing qemu_opt_set() to qemu_opt_set_err(,&error_abort) just > to change back to qemu_opt_set later. Yeah, that's why I chose to do it in one go. >> Signed-off-by: Markus Armbruster >> --- >> block.c | 5 ++-- >> block/qcow2.c | 3 +- >> block/vvfat.c | 2 +- >> blockdev.c | 17 +++++------ >> hw/pci/pci-hotplug-old.c | 2 +- >> hw/usb/dev-network.c | 4 +-- >> hw/usb/dev-storage.c | 6 ++-- >> hw/watchdog/watchdog.c | 2 +- >> include/qemu/option.h | 5 ++-- >> net/net.c | 2 +- >> qdev-monitor.c | 6 ++-- >> qemu-char.c | 58 +++++++++++++++++++------------------- >> qemu-img.c | 6 ++-- >> tests/test-qemu-opts.c | 6 ++-- >> util/qemu-config.c | 9 ++++-- >> util/qemu-option.c | 22 +++------------ >> util/qemu-sockets.c | 34 +++++++++++----------- >> vl.c | 73 ++++++++++++++++++++++++++---------------------- >> 18 files changed, 131 insertions(+), 131 deletions(-) > > Also, the patch is fairly obvious that it is mechanical, so even if you > don't split, I could live with: > > Reviewed-by: Eric Blake > >> +++ b/util/qemu-config.c >> @@ -219,6 +219,7 @@ void qemu_add_opts(QemuOptsList *list) >> >> int qemu_set_option(const char *str) >> { >> + Error *local_err = NULL; >> char group[64], id[64], arg[64]; >> QemuOptsList *list; >> QemuOpts *opts; >> @@ -242,7 +243,9 @@ int qemu_set_option(const char *str) >> return -1; >> } >> >> - if (qemu_opt_set(opts, arg, str+offset+1) == -1) { >> + qemu_opt_set(opts, arg, str+offset+1, &local_err); > > Worth adding whitespace around the 2 '+' operators while touching this? Yes, if I need to respin or send a pull request. Thanks!