From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T60oI-00064D-9b for qemu-devel@nongnu.org; Mon, 27 Aug 2012 11:01:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T60o6-0005eL-5U for qemu-devel@nongnu.org; Mon, 27 Aug 2012 11:01:02 -0400 Received: from mail-ey0-f173.google.com ([209.85.215.173]:39158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T60o5-0005bG-Up for qemu-devel@nongnu.org; Mon, 27 Aug 2012 11:00:50 -0400 Received: by mail-ey0-f173.google.com with SMTP id c13so1273715eaa.4 for ; Mon, 27 Aug 2012 08:00:49 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 27 Aug 2012 17:00:21 +0200 Message-Id: <1346079626-16386-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1346079626-16386-1-git-send-email-pbonzini@redhat.com> References: <1346079626-16386-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [RFC PATCH 08/13] qemu-sockets: publish dummy_opts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@gmail.com This is needed so that we can set up a QemuOpts instance from QMP parameters. The way to go here is to and move qemu-sockets.c away from QemuOpts and use Laszlo's QemuOptsVisitor whenever *_opts functions are called now. This can be done later, however. Signed-off-by: Paolo Bonzini --- qemu-sockets.c | 14 +++++++------- qemu_socket.h | 2 ++ 2 file modificati, 9 inserzioni(+), 7 rimozioni(-) diff --git a/qemu-sockets.c b/qemu-sockets.c index 361d890..b292311 100644 --- a/qemu-sockets.c +++ b/qemu-sockets.c @@ -32,9 +32,9 @@ static const int on=1, off=0; /* used temporarely until all users are converted to QemuOpts */ -static QemuOptsList dummy_opts = { - .name = "dummy", - .head = QTAILQ_HEAD_INITIALIZER(dummy_opts.head), +QemuOptsList socket_opts = { + .name = "socket", + .head = QTAILQ_HEAD_INITIALIZER(socket_opts.head), .desc = { { .name = "path", @@ -469,7 +469,7 @@ int inet_listen(const char *str, char *ostr, int olen, char *optstr; int sock = -1; - opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL); + opts = qemu_opts_create(&socket_opts, NULL, 0, NULL); if (inet_parse(opts, str) == 0) { sock = inet_listen_opts(opts, port_offset, errp); if (sock != -1 && ostr) { @@ -498,7 +498,7 @@ int inet_connect(const char *str, bool block, bool *in_progress, Error **errp) QemuOpts *opts; int sock = -1; - opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL); + opts = qemu_opts_create(&socket_opts, NULL, 0, NULL); if (inet_parse(opts, str) == 0) { if (block) { qemu_opt_set(opts, "block", "on"); @@ -597,7 +597,7 @@ int unix_listen(const char *str, char *ostr, int olen) char *path, *optstr; int sock, len; - opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL); + opts = qemu_opts_create(&socket_opts, NULL, 0, NULL); optstr = strchr(str, ','); if (optstr) { @@ -625,7 +625,7 @@ int unix_connect(const char *path) QemuOpts *opts; int sock; - opts = qemu_opts_create(&dummy_opts, NULL, 0, NULL); + opts = qemu_opts_create(&socket_opts, NULL, 0, NULL); qemu_opt_set(opts, "path", path); sock = unix_connect_opts(opts); qemu_opts_del(opts); diff --git a/qemu_socket.h b/qemu_socket.h index 30ae6af..c87ee57 100644 --- a/qemu_socket.h +++ b/qemu_socket.h @@ -30,6 +30,8 @@ int inet_aton(const char *cp, struct in_addr *ia); #include "error.h" #include "qerror.h" +extern QemuOptsList socket_opts; + /* misc helpers */ int qemu_socket(int domain, int type, int protocol); int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -- 1.7.11.2