[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] support vhost-user socket to reconnect
From: |
Zhang Haoyu |
Subject: |
Re: [Qemu-devel] [PATCH] support vhost-user socket to reconnect |
Date: |
Mon, 22 Dec 2014 15:20:12 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
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 <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);
>
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",
>