From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoCii-0003KL-77 for qemu-devel@nongnu.org; Wed, 04 Dec 2013 08:42:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoCiZ-0001dj-LZ for qemu-devel@nongnu.org; Wed, 04 Dec 2013 08:42:28 -0500 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:45351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoCiZ-0001da-Fl for qemu-devel@nongnu.org; Wed, 04 Dec 2013 08:42:19 -0500 Received: by mail-ea0-f172.google.com with SMTP id q10so10562950ead.17 for ; Wed, 04 Dec 2013 05:42:18 -0800 (PST) Date: Wed, 4 Dec 2013 14:42:15 +0100 From: Stefan Hajnoczi Message-ID: <20131204134215.GA27381@stefanha-thinkpad.redhat.com> References: <1385754746-21172-1-git-send-email-a.motakis@virtualopensystems.com> <1385754746-21172-4-git-send-email-a.motakis@virtualopensystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385754746-21172-4-git-send-email-a.motakis@virtualopensystems.com> Subject: Re: [Qemu-devel] [PATCH 3/5] Add vhostsock option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Antonios Motakis Cc: tech@virtualopensystems.com, Anthony Liguori , "Michael S. Tsirkin" , Michael Tokarev , Markus Armbruster , n.nikolaev@virtualopensystems.com, qemu-devel@nongnu.org, Stefan Hajnoczi , lukego@gmail.com, Paolo Bonzini , Luiz Capitulino 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.