diff mbox

[3/9] vl: Fail right after first bad -object

Message ID 1432815695-31687-4-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster May 28, 2015, 12:21 p.m. UTC
Failure to create a -object is a fatal error.  However, we delay the
actual exit until all -object are processed.  On the one hand, this
permits detection of genuine additional errors.  On the other hand, it
can muddy the waters with uninteresting additional errors, e.g. when a
later -object tries to reference a prior one that failed.

We generally stop right on the first bad option, so do that for
-object as well.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 vl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Blake May 28, 2015, 2:52 p.m. UTC | #1
On 05/28/2015 06:21 AM, Markus Armbruster wrote:
> Failure to create a -object is a fatal error.  However, we delay the

s/a -object/an -object/ ? (depends on whether you pronounce '-object' as
"object" or "dash-object")

> actual exit until all -object are processed.  On the one hand, this
> permits detection of genuine additional errors.  On the other hand, it
> can muddy the waters with uninteresting additional errors, e.g. when a
> later -object tries to reference a prior one that failed.
> 
> We generally stop right on the first bad option, so do that for
> -object as well.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  vl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
Markus Armbruster June 2, 2015, 8:41 a.m. UTC | #2
Eric Blake <eblake@redhat.com> writes:

> On 05/28/2015 06:21 AM, Markus Armbruster wrote:
>> Failure to create a -object is a fatal error.  However, we delay the
>
> s/a -object/an -object/ ? (depends on whether you pronounce '-object' as
> "object" or "dash-object")

I'll use "to create an object with -object".

>> actual exit until all -object are processed.  On the one hand, this
>> permits detection of genuine additional errors.  On the other hand, it
>> can muddy the waters with uninteresting additional errors, e.g. when a
>> later -object tries to reference a prior one that failed.
>> 
>> We generally stop right on the first bad option, so do that for
>> -object as well.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  vl.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!
diff mbox

Patch

diff --git a/vl.c b/vl.c
index a31e7a5..1553c9e 100644
--- a/vl.c
+++ b/vl.c
@@ -4050,7 +4050,7 @@  int main(int argc, char **argv, char **envp)
     }
 
     if (qemu_opts_foreach(qemu_find_opts("object"),
-                          object_create, NULL, 0) != 0) {
+                          object_create, NULL, 1) != 0) {
         exit(1);
     }