mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
vnc: add error propagation to vnc_display_open
Before: $ qemu-system-x86_64 -vnc foo.bar:12345 getaddrinfo(foo.bar,18245): Name or service not known Failed to start VNC server on `foo.bar:12345' $ qemu-system-x86_64 -vnc localhost:12345,reverse=on inet_connect_opts: connect(ipv4,yakj.usersys.redhat.com,127.0.0.1,12345): Connection refused Failed to start VNC server on `localhost:12345,reverse=on' After: $ x86_64-softmmu/qemu-system-x86_64 -vnc foo.bar:12345 Failed to start VNC server on `foo.bar:12345': address resolution failed for foo.bar:18245: Name or service not known $ x86_64-softmmu/qemu-system-x86_64 -vnc localhost:12345,reverse=on Failed to start VNC server on `localhost:12345,reverse=on': Failed to connect to socket: Connection refused Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
007fcd3ee9
commit
2d55f0e817
2 changed files with 29 additions and 22 deletions
9
vl.c
9
vl.c
|
@ -3711,10 +3711,13 @@ 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) {
|
||||
fprintf(stderr, "Failed to start VNC server on `%s'\n",
|
||||
vnc_display);
|
||||
vnc_display_open(ds, vnc_display, &local_err);
|
||||
if (local_err != NULL) {
|
||||
fprintf(stderr, "Failed to start VNC server on `%s': %s\n",
|
||||
vnc_display, error_get_pretty(local_err));
|
||||
error_free(local_err);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue