From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
Anand Avati <aavati@redhat.com>,
Vijay Bellur <vbellur@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Harsh Bora <harsh@linux.vnet.ibm.com>,
Amar Tumballi <amarts@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Blue Swirl <blauwirbel@gmail.com>, Avi Kivity <avi@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PATCH v8 1/6] sockets: publish dummy_opts
Date: Mon, 24 Sep 2012 14:22:25 +0530 [thread overview]
Message-ID: <20120924085225.GD18470@in.ibm.com> (raw)
In-Reply-To: <20120924085127.GC18470@in.ibm.com>
sockets: publish dummy_opts
From: Paolo Bonzini <pbonzini@redhat.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.
This would also enable block backends like gluster to make use of
inet_parse() for inet address parsing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
qemu-sockets.c | 14 +++++++-------
qemu_socket.h | 2 ++
2 files changed, 9 insertions(+), 7 deletions(-)
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);
next prev parent reply other threads:[~2012-09-24 8:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 8:51 [Qemu-devel] [PATCH v8 0/6] GlusterFS support in QEMU - v8 Bharata B Rao
2012-09-24 8:52 ` Bharata B Rao [this message]
2012-09-24 8:53 ` [Qemu-devel] [PATCH v8 2/6] sockets: Make port specification optional in inet_parse Bharata B Rao
2012-09-24 8:54 ` [Qemu-devel] [PATCH v8 3/6] sockets: Make inet_parse() non static Bharata B Rao
2012-09-24 8:54 ` [Qemu-devel] [PATCH v8 4/6] aio: Fix qemu_aio_wait() to maintain correct walking_handlers count Bharata B Rao
2012-09-24 8:55 ` [Qemu-devel] [PATCH v8 5/6] configure: Add a config option for GlusterFS as block backend Bharata B Rao
2012-09-24 8:56 ` [Qemu-devel] [PATCH v8 6/6] block: Support GlusterFS as a QEMU " Bharata B Rao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120924085225.GD18470@in.ibm.com \
--to=bharata@linux.vnet.ibm.com \
--cc=aavati@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=amarts@redhat.com \
--cc=armbru@redhat.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=harsh@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=vbellur@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).