qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 13/18] vnc: add error propagation to vnc_display


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 13/18] vnc: add error propagation to vnc_display_open
Date: Fri, 05 Oct 2012 08:29:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

Il 05/10/2012 08:28, Paolo Bonzini ha scritto:
>>>  void vnc_display_add_client(DisplayState *ds, int csock, int skipauth)
>>> diff --git a/vl.c b/vl.c
>>> index 53917c9..45a5ba5 100644
>>> --- a/vl.c
>>> +++ b/vl.c
>>> @@ -3692,8 +3692,11 @@ int main(int argc, char **argv, char **envp)
>>>  #ifdef CONFIG_VNC
>>>      /* init remote displays */
>>>      if (vnc_display) {
>>> +        Error *local_err = NULL;
>>>          vnc_display_init(ds);
>>> -        if (vnc_display_open(ds, vnc_display) < 0) {
>>> +        if (vnc_display_open(ds, vnc_display, &local_err) < 0) {
>>> +            qerror_report_err(local_err);
>>> +            error_free(local_err);
>>>              fprintf(stderr, "Failed to start VNC server on `%s'\n",
>>>                      vnc_display);
>>>              exit(1);
>>
>> Why do you need to call qerror_report_err()? I'd just do:
>>
>> fprintf(stderr, "Failed to start VNC server on display '%s': %s\n",
>>                 vnc_display, error_get_pretty(local_err));
> 
> Ok.

Hmm, qerror_report_err is more consistent (it prints the program name).

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]