aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmos Kong <akong@redhat.com>2012-06-30 10:02:20 +0800
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-07-13 10:38:16 +0100
commit94b204ca4eb03ae01e5c05509a40903c779ea83c (patch)
tree7069c0e375f8d9f35ef90400a6dff5627e9af29b
parentab411770440379765e492a8613c4ed6a0761e417 (diff)
downloadqemu-arm-94b204ca4eb03ae01e5c05509a40903c779ea83c.tar.gz
vnc: add a more descriptive error message
Currently qemu outputs some low-level error in qemu-sockets.c when failed to start vnc server. eg. 'getaddrinfo(127.0.0.1,5902): Name or service not known' Some libvirt users could not know what's happened with this unclear error message. This patch added a more descriptive error message. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-rw-r--r--vl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vl.c b/vl.c
index 2e140f57c7..46248b9c1c 100644
--- a/vl.c
+++ b/vl.c
@@ -3584,8 +3584,11 @@ int main(int argc, char **argv, char **envp)
/* init remote displays */
if (vnc_display) {
vnc_display_init(ds);
- if (vnc_display_open(ds, vnc_display) < 0)
+ if (vnc_display_open(ds, vnc_display) < 0) {
+ fprintf(stderr, "Failed to start VNC server on `%s'\n",
+ vnc_display);
exit(1);
+ }
if (show_vnc_port) {
printf("VNC server running on `%s'\n", vnc_display_local_addr(ds));