Skip to content

Commit

Permalink
char-socket: fix error reporting
Browse files Browse the repository at this point in the history
Right now the inet connect code tries all available addresses but until one
doesn't fail.  It passes local_err each time without clearing it from the
previous failure.  This can trigger an assert since the inet connect code
tries to set an error on an object != NULL.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Message-id: 16c806d60aa5e9660ed7751bb4e37dcd278f97f0.1362505276.git.amit.shah@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
Anthony Liguori committed Mar 8, 2013
1 parent 0bc472a commit baca6f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/qemu-sockets.c
Expand Up @@ -373,6 +373,10 @@ int inet_connect_opts(QemuOpts *opts, Error **errp,
}

for (e = res; e != NULL; e = e->ai_next) {
if (error_is_set(errp)) {
error_free(*errp);
*errp = NULL;
}
if (connect_state != NULL) {
connect_state->current_addr = e;
}
Expand Down

0 comments on commit baca6f1

Please sign in to comment.