On Wed, Dec 4, 2013 at 2:42 PM, Stefan Hajnoczi <[email protected]> wrote:
> 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.
>
This code will be reworked for the next version of the series, so this
shouldn't be a problem then.
Antonios