All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com,
	kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 06/13] QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
Date: Tue, 17 Feb 2015 09:21:44 +0100	[thread overview]
Message-ID: <878ufxne1z.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <54E274FC.9080908@redhat.com> (Eric Blake's message of "Mon, 16 Feb 2015 15:53:48 -0700")

Eric Blake <eblake@redhat.com> 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 <armbru@redhat.com>
>> ---
>>  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 <eblake@redhat.com>
>
>> +++ 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!

  reply	other threads:[~2015-02-17  8:21 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 14:44 [Qemu-devel] [PATCH 00/13] QemuOpts: Convert various setters to Error Markus Armbruster
2015-02-16 14:44 ` [Qemu-devel] [PATCH 01/13] QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use Markus Armbruster
2015-02-16 20:24   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 02/13] QemuOpts: Convert qemu_opt_set_number() " Markus Armbruster
2015-02-16 20:26   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 03/13] QemuOpts: Convert qemu_opts_set() " Markus Armbruster
2015-02-16 21:06   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 04/13] qemu-img: Suppress unhelpful extra errors in convert, resize Markus Armbruster
2015-02-16 20:19   ` John Snow
2015-02-17  8:18     ` Markus Armbruster
2015-02-17 15:28   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 05/13] block: Suppress unhelpful extra errors in bdrv_img_create() Markus Armbruster
2015-02-16 22:26   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 06/13] QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use Markus Armbruster
2015-02-16 22:53   ` Eric Blake
2015-02-17  8:21     ` Markus Armbruster [this message]
2015-02-16 14:44 ` [Qemu-devel] [PATCH 07/13] QemuOpts: Propagate errors through opts_do_parse() Markus Armbruster
2015-02-16 22:54   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 08/13] QemuOpts: Propagate errors through opts_parse() Markus Armbruster
2015-02-16 23:15   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 09/13] qemu-img: Suppress unhelpful extra errors in convert, amend Markus Armbruster
2015-02-16 23:38   ` Eric Blake
2015-02-17  8:25     ` Markus Armbruster
2015-02-16 14:44 ` [Qemu-devel] [PATCH 10/13] block: Simplify setting numeric options Markus Armbruster
2015-02-17 16:42   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 11/13] qemu-sockets: Simplify setting numeric and boolean options Markus Armbruster
2015-02-17 16:45   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 12/13] pc: Use qemu_opt_set() instead of qemu_opts_parse() Markus Armbruster
2015-02-17 16:46   ` Eric Blake
2015-02-16 14:44 ` [Qemu-devel] [PATCH 13/13] qtest: " Markus Armbruster
2015-02-17 16:47   ` Eric Blake
2015-02-17  8:16 ` [Qemu-devel] [PATCH 00/13] QemuOpts: Convert various setters to Error Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878ufxne1z.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.