qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] Add vhostsock option


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 3/5] Add vhostsock option
Date: Wed, 4 Dec 2013 14:42:15 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Nov 29, 2013 at 08:52:24PM +0100, Antonios Motakis wrote:
> @@ -91,15 +91,27 @@ static int vhost_net_get_fd(NetClientState *backend)
>      }
>  }
>  
> -struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
> -                                 bool force)
> +struct vhost_net *vhost_net_init(NetClientState *backend, char *vhostsock,
> +                                 int devfd, bool force)
>  {
>      int r;
>      struct vhost_net *net = g_malloc(sizeof *net);
> +    const char *backend_sock = 0;
> +    VhostBackendType backend_type = VHOST_BACKEND_TYPE_NONE;
> +
>      if (!backend) {
>          fprintf(stderr, "vhost-net requires backend to be setup\n");
>          goto fail;
>      }
> +
> +    if (vhostsock && strcmp(vhostsock, VHOST_NET_DEFAULT_SOCK) != 0) {

This is a weird hack.  Why check for VHOST_NET_DEFAULT_SOCK at all?

If the option is not present then kernel vhost is used, if the option is
present then userspace vhost is used.  I don't understand why a magic
hardcoded path is useful.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]