All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Max Reitz <mreitz@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 33/35] blockdev: Convert drive_new() to Error
Date: Tue, 16 Oct 2018 00:38:47 +0200	[thread overview]
Message-ID: <eb19a7c5-7d26-a9ea-8992-44c34a16114f@redhat.com> (raw)
In-Reply-To: <31daa4d5-96bf-ac50-7a3d-e503b13c9872@redhat.com>

On 15/10/2018 16:48, Max Reitz wrote:
> On 15.10.18 13:53, Markus Armbruster wrote:
>> Calling error_report() from within a function that takes an Error **
>> argument is suspicious.  drive_new() calls error_report() even though
>> it can run within drive_init_func(), which takes an Error ** argument.
>> drive_init_func()'s caller main(), via qemu_opts_foreach(), is fine
>> with it, but clean it up anyway:
>>
>> * Convert drive_new() to Error
>>
>> * Update add_init_drive() to report the error received from
>>   drive_new()
>>
>> * Make main() pass &error_fatal through qemu_opts_foreach(),
>>   drive_init_func() to drive_new()
>>
>> * Make default_drive() pass &error_abort through qemu_opts_foreach(),
>>   drive_init_func() to drive_new()
>>
>> Cc: Kevin Wolf <kwolf@redhat.com>
>> Cc: Max Reitz <mreitz@redhat.com>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  blockdev.c                | 27 ++++++++++++++-------------
>>  device-hotplug.c          |  5 ++++-
>>  include/sysemu/blockdev.h |  3 ++-
>>  vl.c                      |  8 ++++----
>>  4 files changed, 24 insertions(+), 19 deletions(-)
> 
> [...]
> 
>> diff --git a/vl.c b/vl.c
>> index 65366b961e..22beca29d1 100644
>> --- a/vl.c
>> +++ b/vl.c
> 
> [...]
>> @@ -4396,7 +4395,8 @@ int main(int argc, char **argv, char **envp)
>>                            NULL, NULL);
>>      }
>>      if (qemu_opts_foreach(qemu_find_opts("drive"), drive_init_func,
>> -                          &machine_class->block_default_type, NULL)) {
>> +                          &machine_class->block_default_type, &error_fatal)) {
>> +        /* We printed help */
>>          exit(1);
>>      }
> 
> I thought you wanted it to become an exit(0)?  I don't care either way,

Markus did it in the next patch ;)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> though, so:
> 
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> 

  parent reply	other threads:[~2018-10-15 22:38 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 11:52 [Qemu-devel] [PATCH v2 00/35] Replace some unwise uses of error_report() & friends Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 01/35] error: Fix use of error_prepend() with &error_fatal, &error_abort Markus Armbruster
2018-10-15 18:49   ` Eric Blake
2018-10-15 22:52   ` Philippe Mathieu-Daudé
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 02/35] Use error_fatal to simplify obvious fatal errors (again) Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 03/35] block: Use warn_report() & friends to report warnings Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 04/35] cpus hw target: " Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 05/35] vfio: " Markus Armbruster
2018-10-15 18:53   ` Eric Blake
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 06/35] vfio: Clean up error reporting after previous commit Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 07/35] char: Use error_printf() to print help and such Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 08/35] 9pfs: Fix CLI parsing crash on error Markus Armbruster
2018-10-15 19:00   ` Eric Blake
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 09/35] pc: Fix machine property nvdimm-persistence error handling Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 10/35] ioapic: Fix error handling in realize() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 11/35] smbios: Clean up error handling in smbios_add() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 12/35] migration: Fix !replay_can_snapshot() error handling Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 13/35] l2tpv3: Improve -netdev/netdev_add/-net/... error reporting Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 14/35] net/socket: Fix invalid socket type error handling Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 15/35] numa: Fix QMP command set-numa-node " Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 16/35] xen/pt: Fix incomplete conversion to realize() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 17/35] seccomp: Clean up error reporting in parse_sandbox() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 18/35] vl: Clean up error reporting in parse_add_fd() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 19/35] qom: Clean up error reporting in user_creatable_add_opts_foreach() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 20/35] vl: Clean up error reporting in chardev_init_func() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 21/35] vl: Clean up error reporting in machine_set_property() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 22/35] vl: Clean up error reporting in mon_init_func() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 23/35] vl: Clean up error reporting in parse_fw_cfg() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 24/35] vl: Clean up error reporting in device_init_func() Markus Armbruster
2018-10-15 11:52 ` [Qemu-devel] [PATCH v2 25/35] ui/keymaps: Fix handling of erroneous include files Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 26/35] ui: Convert vnc_display_init(), init_keyboard_layout() to Error Markus Armbruster
2018-10-15 22:42   ` Philippe Mathieu-Daudé
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 27/35] vnc: Clean up error reporting in vnc_init_func() Markus Armbruster
2018-10-15 12:51   ` Fei Li
2018-10-16  4:08     ` Markus Armbruster
2018-10-16  6:52       ` Gerd Hoffmann
2018-10-16 11:21         ` Markus Armbruster
2018-10-15 22:41   ` Philippe Mathieu-Daudé
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 28/35] numa: Clean up error reporting in parse_numa() Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 29/35] tpm: Clean up error reporting in tpm_init_tpmdev() Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 30/35] spice: Clean up error reporting in add_channel() Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 31/35] fsdev: Clean up error reporting in qemu_fsdev_add() Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 32/35] vl: Assert drive_new() does not fail in default_drive() Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 33/35] blockdev: Convert drive_new() to Error Markus Armbruster
2018-10-15 14:48   ` Max Reitz
2018-10-15 18:54     ` Eric Blake
2018-10-15 22:38     ` Philippe Mathieu-Daudé [this message]
2018-10-16  4:09       ` Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 34/35] vl: Fix exit status for -drive format=help Markus Armbruster
2018-10-15 11:53 ` [Qemu-devel] [PATCH v2 35/35] vl: Simplify call of parse_name() 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=eb19a7c5-7d26-a9ea-8992-44c34a16114f@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.