[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] support vhost-user socket to reconnect
From: |
zhangkun |
Subject: |
[Qemu-devel] [PATCH] support vhost-user socket to reconnect |
Date: |
Mon, 22 Dec 2014 15:06:13 +0800 |
From: zhangkun <address@hidden>
Signed-off-by: zhangkun <address@hidden>
---
net/vhost-user.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 24e050c..957e78c 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -26,6 +26,7 @@ typedef struct VhostUserChardevProps {
bool is_socket;
bool is_unix;
bool is_server;
+ bool is_reconnect;
} VhostUserChardevProps;
VHostNetState *vhost_user_get_vhost_net(NetClientState *nc)
@@ -132,6 +133,11 @@ static void net_vhost_user_event(void *opaque, int event)
}
}
+static bool net_vhost_user_can_read(void *opaque)
+{
+ return true;
+}
+
static int net_vhost_user_init(NetClientState *peer, const char *device,
const char *name, CharDriverState *chr,
bool vhostforce)
@@ -151,7 +157,7 @@ static int net_vhost_user_init(NetClientState *peer, const
char *device,
s->chr = chr;
s->vhostforce = vhostforce;
- qemu_chr_add_handlers(s->chr, NULL, NULL, net_vhost_user_event, s);
+ qemu_chr_add_handlers(s->chr, net_vhost_user_can_read, NULL,
net_vhost_user_event, s);
return 0;
}
@@ -167,6 +173,8 @@ static int net_vhost_chardev_opts(const char *name, const
char *value,
props->is_unix = true;
} else if (strcmp(name, "server") == 0) {
props->is_server = true;
+ } else if (strcmp(name, "reconnect") == 0) {
+ props->is_reconnect = true;
} else {
error_report("vhost-user does not support a chardev"
" with the following option:\n %s = %s",
--
1.9.0
- [Qemu-devel] [PATCH] support vhost-user socket to reconnect,
zhangkun <=