Message ID | 1419231973-11648-1-git-send-email-zhang.zhangkun@huawei.com |
---|---|
State | New |
Headers | show |
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", >
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", >
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",