|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2 33/35] blockdev: Convert drive_new() to Error |
Date: | Mon, 15 Oct 2018 13:54:34 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 10/15/18 9:48 AM, 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:
@@ -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, though, so: Reviewed-by: Max Reitz <address@hidden>
I _do_ care. Printing help isn't an error, so it shouldn't result in a non-zero exit status.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |