aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorCorey Minyard <cminyard@mvista.com>2014-10-08 07:11:56 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2014-10-09 15:36:15 +0200
commit5179502918d0c230afb50d8b95247de440fccdd5 (patch)
treea13f4148a4400cdbe43e8ccfbd0808393aa74385 /qemu-char.c
parent5748e4c2be4f5c24c691f91328be02a9c4cb3063 (diff)
qemu-sockets: Add error to non-blocking connect handler
An error value here would be quite handy and more consistent with the rest of the code. Signed-off-by: Corey Minyard <cminyard@mvista.com> [Make sure SO_ERROR value is passed to error_setg_errno. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 62af0efa18..c71805ad8d 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3042,11 +3042,13 @@ static void qemu_chr_finish_socket_connection(CharDriverState *chr, int fd)
}
}
-static void qemu_chr_socket_connected(int fd, void *opaque)
+static void qemu_chr_socket_connected(int fd, Error *err, void *opaque)
{
CharDriverState *chr = opaque;
if (fd < 0) {
+ error_report("Unable to connect to char device %s: %s",
+ chr->label, error_get_pretty(err));
qemu_chr_socket_restart_timer(chr);
return;
}
@@ -4079,7 +4081,8 @@ static gboolean socket_reconnect_timeout(gpointer opaque)
}
if (!qemu_chr_open_socket_fd(chr, &err)) {
- error_report("Unable to connect to char device %s\n", chr->label);
+ error_report("Unable to connect to char device %s: %s\n",
+ chr->label, error_get_pretty(err));
qemu_chr_socket_restart_timer(chr);
}