From d93697c214bb37e6fc1971e94828479b911ee3f9 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> References: <707b9b97153063374d2530e72c49b1499fc21af9.1367947969.git.minovotn@redhat.com> From: Michal Novotny Date: Tue, 7 May 2013 18:38:13 +0200 Subject: [PATCH 047/114] Revert "qemu-sockets: add Error ** to all functions" This reverts commit b83c309b20138e93ffba49847a62a40171b4fead. Reverting as asked by Laszlo in message <51892739.2030807@redhat.com> because of the ordering issue (most likely) related to supersed testing. Signed-off-by: Michal Novotny --- qemu-char.c | 6 +++--- qemu-sockets.c | 22 +++++++++++----------- qemu_socket.h | 10 +++++----- qga/channel-posix.c | 2 +- vnc.c | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 1c086b3..0e42bdb 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1980,7 +1980,7 @@ static CharDriverState *qemu_chr_open_udp(QemuOpts *opts) chr = qemu_mallocz(sizeof(CharDriverState)); s = qemu_mallocz(sizeof(NetCharDriver)); - fd = inet_dgram_opts(opts, NULL); + fd = inet_dgram_opts(opts); if (fd < 0) { fprintf(stderr, "inet_dgram_opts failed\n"); goto return_err; @@ -2342,9 +2342,9 @@ static CharDriverState *qemu_chr_open_socket(QemuOpts *opts) if (is_unix) { if (is_listen) { - fd = unix_listen_opts(opts, NULL); + fd = unix_listen_opts(opts); } else { - fd = unix_connect_opts(opts, NULL); + fd = unix_connect_opts(opts); } } else { if (is_listen) { diff --git a/qemu-sockets.c b/qemu-sockets.c index 0625d75..a2a1e68 100644 --- a/qemu-sockets.c +++ b/qemu-sockets.c @@ -401,7 +401,7 @@ int inet_connect_opts(QemuOpts *opts, Error **errp, return sock; } -int inet_dgram_opts(QemuOpts *opts, Error **errp) +int inet_dgram_opts(QemuOpts *opts) { struct addrinfo ai, *peer = NULL, *local = NULL; const char *addr; @@ -651,7 +651,7 @@ int inet_nonblocking_connect(const char *str, #ifndef _WIN32 -int unix_listen_opts(QemuOpts *opts, Error **errp) +int unix_listen_opts(QemuOpts *opts) { struct sockaddr_un un; const char *path = qemu_opt_get(opts, "path"); @@ -699,7 +699,7 @@ err: return -1; } -int unix_connect_opts(QemuOpts *opts, Error **errp) +int unix_connect_opts(QemuOpts *opts) { struct sockaddr_un un; const char *path = qemu_opt_get(opts, "path"); @@ -729,7 +729,7 @@ int unix_connect_opts(QemuOpts *opts, Error **errp) } /* compatibility wrapper */ -int unix_listen(const char *str, char *ostr, int olen, Error **errp) +int unix_listen(const char *str, char *ostr, int olen) { QemuOpts *opts; char *path, *optstr; @@ -750,7 +750,7 @@ int unix_listen(const char *str, char *ostr, int olen, Error **errp) qemu_opt_set(opts, "path", str); } - sock = unix_listen_opts(opts, errp); + sock = unix_listen_opts(opts); if (sock != -1 && ostr) snprintf(ostr, olen, "%s%s", qemu_opt_get(opts, "path"), optstr ? optstr : ""); @@ -758,39 +758,39 @@ int unix_listen(const char *str, char *ostr, int olen, Error **errp) return sock; } -int unix_connect(const char *path, Error **errp) +int unix_connect(const char *path) { QemuOpts *opts; int sock; opts = qemu_opts_create(&dummy_opts, NULL, 0); qemu_opt_set(opts, "path", path); - sock = unix_connect_opts(opts, errp); + sock = unix_connect_opts(opts); qemu_opts_del(opts); return sock; } #else -int unix_listen_opts(QemuOpts *opts, Error **errp) +int unix_listen_opts(QemuOpts *opts) { fprintf(stderr, "unix sockets are not available on windows\n"); return -1; } -int unix_connect_opts(QemuOpts *opts, Error **errp) +int unix_connect_opts(QemuOpts *opts) { fprintf(stderr, "unix sockets are not available on windows\n"); return -1; } -int unix_listen(const char *path, char *ostr, int olen, Error **errp) +int unix_listen(const char *path, char *ostr, int olen) { fprintf(stderr, "unix sockets are not available on windows\n"); return -1; } -int unix_connect(const char *path, Error **errp) +int unix_connect(const char *path) { fprintf(stderr, "unix sockets are not available on windows\n"); return -1; diff --git a/qemu_socket.h b/qemu_socket.h index bb439d1..3c07fad 100644 --- a/qemu_socket.h +++ b/qemu_socket.h @@ -54,13 +54,13 @@ int inet_nonblocking_connect(const char *str, NonBlockingConnectHandler *callback, void *opaque, Error **errp); -int inet_dgram_opts(QemuOpts *opts, Error **errp); +int inet_dgram_opts(QemuOpts *opts); const char *inet_strfamily(int family); -int unix_listen_opts(QemuOpts *opts, Error **errp); -int unix_listen(const char *path, char *ostr, int olen, Error **errp); -int unix_connect_opts(QemuOpts *opts, Error **errp); -int unix_connect(const char *path, Error **errp); +int unix_listen_opts(QemuOpts *opts); +int unix_listen(const char *path, char *ostr, int olen); +int unix_connect_opts(QemuOpts *opts); +int unix_connect(const char *path); /* Old, ipv4 only bits. Don't use for new code. */ int parse_host_port(struct sockaddr_in *saddr, const char *str); diff --git a/qga/channel-posix.c b/qga/channel-posix.c index e22eee6..57eea06 100644 --- a/qga/channel-posix.c +++ b/qga/channel-posix.c @@ -181,7 +181,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod break; } case GA_CHANNEL_UNIX_LISTEN: { - int fd = unix_listen(path, NULL, strlen(path), NULL); + int fd = unix_listen(path, NULL, strlen(path)); if (fd == -1) { g_critical("error opening path: %s", strerror(errno)); return false; diff --git a/vnc.c b/vnc.c index 624fecb..61a4def 100644 --- a/vnc.c +++ b/vnc.c @@ -2852,7 +2852,7 @@ int vnc_display_open(DisplayState *ds, const char *display) if (reverse) { /* connect to viewer */ if (strncmp(display, "unix:", 5) == 0) - vs->lsock = unix_connect(display+5, NULL); + vs->lsock = unix_connect(display+5); else vs->lsock = inet_connect(display, NULL); if (-1 == vs->lsock) { @@ -2872,7 +2872,7 @@ int vnc_display_open(DisplayState *ds, const char *display) dpy = qemu_malloc(256); if (strncmp(display, "unix:", 5) == 0) { pstrcpy(dpy, 256, "unix:"); - vs->lsock = unix_listen(display+5, dpy+5, 256-5, NULL); + vs->lsock = unix_listen(display+5, dpy+5, 256-5); } else { vs->lsock = inet_listen(display, dpy, 256, SOCK_STREAM, 5900, NULL); -- 1.7.11.7