diff mbox

[v1,3/4] vhost-user: Enable 'nowait' and 'reconnect' option

Message ID 1432874550-10921-4-git-send-email-mukawa@igel.co.jp
State Superseded
Headers show

Commit Message

Tetsuya Mukawa May 29, 2015, 4:42 a.m. UTC
The patch enables 'nowait' option for server mode, and 'reconnect'
option for client mode.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 net/vhost-user.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefan Hajnoczi June 15, 2015, 1:41 p.m. UTC | #1
On Fri, May 29, 2015 at 01:42:29PM +0900, Tetsuya Mukawa wrote:
> The patch enables 'nowait' option for server mode, and 'reconnect'
> option for client mode.
> 
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> ---
>  net/vhost-user.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Stefan Hajnoczi June 15, 2015, 1:58 p.m. UTC | #2
On Fri, May 29, 2015 at 01:42:29PM +0900, Tetsuya Mukawa wrote:
> The patch enables 'nowait' option for server mode, and 'reconnect'
> option for client mode.
> 
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> ---
>  net/vhost-user.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/net/vhost-user.c b/net/vhost-user.c
> index 1967ff4..f823d78 100644
> --- a/net/vhost-user.c
> +++ b/net/vhost-user.c
> @@ -26,6 +26,8 @@ typedef struct VhostUserChardevProps {
>      bool is_socket;
>      bool is_unix;
>      bool is_server;
> +    bool is_nowait;
> +    bool is_reconnect;
>  } VhostUserChardevProps;
>  
>  VHostNetState *vhost_user_get_vhost_net(NetClientState *nc)
> @@ -178,6 +180,10 @@ 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, "wait") == 0) && (strcmp(value, "off")) == 0) {
> +        props->is_nowait = true;
> +    } else if (strcmp(name, "reconnect") == 0) {
> +        props->is_reconnect = true;

Where is the code that uses these new options?
Tetsuya Mukawa June 16, 2015, 5:08 a.m. UTC | #3
On 2015/06/15 22:58, Stefan Hajnoczi wrote:
> On Fri, May 29, 2015 at 01:42:29PM +0900, Tetsuya Mukawa wrote:
>> The patch enables 'nowait' option for server mode, and 'reconnect'
>> option for client mode.
>>
>> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
>> ---
>>  net/vhost-user.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/net/vhost-user.c b/net/vhost-user.c
>> index 1967ff4..f823d78 100644
>> --- a/net/vhost-user.c
>> +++ b/net/vhost-user.c
>> @@ -26,6 +26,8 @@ typedef struct VhostUserChardevProps {
>>      bool is_socket;
>>      bool is_unix;
>>      bool is_server;
>> +    bool is_nowait;
>> +    bool is_reconnect;
>>  } VhostUserChardevProps;
>>  
>>  VHostNetState *vhost_user_get_vhost_net(NetClientState *nc)
>> @@ -178,6 +180,10 @@ 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, "wait") == 0) && (strcmp(value, "off")) == 0) {
>> +        props->is_nowait = true;
>> +    } else if (strcmp(name, "reconnect") == 0) {
>> +        props->is_reconnect = true;
> Where is the code that uses these new options?

Above code is only for allowing below QEMU options.

-chardev socket,id=chr0,path=/tmp/sock,reconnect=3
-chardev socket,id=chr0,path=/tmp/sock,server,nowait

These options are needed, because we don't want to wait for vhost-user
backend connection.

Regards,
Tetsuya
diff mbox

Patch

diff --git a/net/vhost-user.c b/net/vhost-user.c
index 1967ff4..f823d78 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -26,6 +26,8 @@  typedef struct VhostUserChardevProps {
     bool is_socket;
     bool is_unix;
     bool is_server;
+    bool is_nowait;
+    bool is_reconnect;
 } VhostUserChardevProps;
 
 VHostNetState *vhost_user_get_vhost_net(NetClientState *nc)
@@ -178,6 +180,10 @@  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, "wait") == 0) && (strcmp(value, "off")) == 0) {
+        props->is_nowait = 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",