* [Qemu-devel] [PATCH] support vhost-user socket to reconnect
@ 2014-12-22 7:06 zhangkun
2014-12-22 7:20 ` Zhang Haoyu
0 siblings, 1 reply; 3+ messages in thread
From: zhangkun @ 2014-12-22 7:06 UTC (permalink / raw)
To: qemu-devel; +Cc: zhangkun
From: zhangkun <zhang.zhangkun@huawei.com>
Signed-off-by: zhangkun <zhang.zhangkun@huawei.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] support vhost-user socket to reconnect
2014-12-22 7:06 [Qemu-devel] [PATCH] support vhost-user socket to reconnect zhangkun
@ 2014-12-22 7:20 ` Zhang Haoyu
2014-12-22 7:28 ` Zhangkun (K)
0 siblings, 1 reply; 3+ messages in thread
From: Zhang Haoyu @ 2014-12-22 7:20 UTC (permalink / raw)
To: zhangkun, qemu-devel
Hi, Kun
Is this patch one of patch series?
I don't see any place to reference "is_reconnect" field.
On 2014/12/22 15:06, zhangkun wrote:
> From: zhangkun <zhang.zhangkun@huawei.com>
>
> Signed-off-by: zhangkun <zhang.zhangkun@huawei.com>
> ---
> 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);
>
Why no read handler?
> 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",
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] support vhost-user socket to reconnect
2014-12-22 7:20 ` Zhang Haoyu
@ 2014-12-22 7:28 ` Zhangkun (K)
0 siblings, 0 replies; 3+ messages in thread
From: Zhangkun (K) @ 2014-12-22 7:28 UTC (permalink / raw)
To: Zhang Haoyu, qemu-devel@nongnu.org
Yes, this patch is only reconnect socket.
The "Is_reconnect" field is used by next patch.
-----Original Message-----
From: Zhang Haoyu [mailto:zhhy.zhanghaoyu@gmail.com]
Sent: Monday, December 22, 2014 3:20 PM
To: Zhangkun (K); qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] support vhost-user socket to reconnect
Hi, Kun
Is this patch one of patch series?
I don't see any place to reference "is_reconnect" field.
On 2014/12/22 15:06, zhangkun wrote:
> From: zhangkun <zhang.zhangkun@huawei.com>
>
> Signed-off-by: zhangkun <zhang.zhangkun@huawei.com>
> ---
> 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);
>
Why no read handler?
> 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",
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-22 7:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-22 7:06 [Qemu-devel] [PATCH] support vhost-user socket to reconnect zhangkun
2014-12-22 7:20 ` Zhang Haoyu
2014-12-22 7:28 ` Zhangkun (K)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.