[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 1/6] sockets: publish dummy_opts
From: |
Bharata B Rao |
Subject: |
[Qemu-devel] [PATCH v8 1/6] sockets: publish dummy_opts |
Date: |
Mon, 24 Sep 2012 14:22:25 +0530 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
sockets: publish dummy_opts
From: Paolo Bonzini <address@hidden>
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 <address@hidden>
Signed-off-by: Bharata B Rao <address@hidden>
---
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);
- [Qemu-devel] [PATCH v8 0/6] GlusterFS support in QEMU - v8, Bharata B Rao, 2012/09/24
- [Qemu-devel] [PATCH v8 1/6] sockets: publish dummy_opts,
Bharata B Rao <=
- [Qemu-devel] [PATCH v8 2/6] sockets: Make port specification optional in inet_parse, Bharata B Rao, 2012/09/24
- [Qemu-devel] [PATCH v8 3/6] sockets: Make inet_parse() non static., Bharata B Rao, 2012/09/24
- [Qemu-devel] [PATCH v8 4/6] aio: Fix qemu_aio_wait() to maintain correct walking_handlers count, Bharata B Rao, 2012/09/24
- [Qemu-devel] [PATCH v8 5/6] configure: Add a config option for GlusterFS as block backend, Bharata B Rao, 2012/09/24
- [Qemu-devel] [PATCH v8 6/6] block: Support GlusterFS as a QEMU block backend., Bharata B Rao, 2012/09/24