From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxdby-0002wi-Jt for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:46:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxdbt-0004YD-Hc for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:46:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxdbt-0004Xy-8p for qemu-devel@nongnu.org; Thu, 19 Jun 2014 10:46:41 -0400 Date: Thu, 19 Jun 2014 17:47:07 +0300 From: "Michael S. Tsirkin" Message-ID: <20140619144707.GD10359@redhat.com> References: <20140618204530.16806.54996.stgit@3820> <20140619142446.GD4544@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikolay Nikolaev Cc: VirtualOpenSystems Technical Team , qemu-devel On Thu, Jun 19, 2014 at 05:33:02PM +0300, Nikolay Nikolaev wrote: > Hello, >=20 >=20 > On Thu, Jun 19, 2014 at 5:24 PM, Michael S. Tsirkin wr= ote: >=20 > On Thu, Jun 19, 2014 at 05:16:44PM +0300, Nikolay Nikolaev wrote: > > Hello, > > > > > > On Wed, Jun 18, 2014 at 11:45 PM, Nikolay Nikolaev < > > n.nikolaev@virtualopensystems.com> wrote: > > > > =A0 =A0 Make net.o linkage expect net_init_vhost_user only when > > =A0 =A0 CONFIG_VHOST_NET is defined. > > > > =A0 =A0 Signed-off-by: Nikolay Nikolaev > > =A0 =A0 --- > > =A0 =A0 =A0net/net.c | =A0 =A04 ++++ > > =A0 =A0 =A01 file changed, 4 insertions(+) > > > > =A0 =A0 diff --git a/net/net.c b/net/net.c > > =A0 =A0 index de76e30..0c30414 100644 > > =A0 =A0 --- a/net/net.c > > =A0 =A0 +++ b/net/net.c > > =A0 =A0 @@ -803,7 +803,9 @@ static int (* const net_client_init_f= un > > =A0 =A0 [NET_CLIENT_OPTIONS_KIND_MAX])( > > =A0 =A0 =A0 =A0 =A0 =A0 =A0[NET_CLIENT_OPTIONS_KIND_BRIDGE] =A0 =A0= =3D net_init_bridge, > > =A0 =A0 =A0#endif > > =A0 =A0 =A0 =A0 =A0 =A0 =A0[NET_CLIENT_OPTIONS_KIND_HUBPORT] =A0 = =3D net_init_hubport, > > =A0 =A0 +#ifdef CONFIG_VHOST_NET > > =A0 =A0 =A0 =A0 =A0 =A0 =A0[NET_CLIENT_OPTIONS_KIND_VHOST_USER] =3D= net_init_vhost_user, > > =A0 =A0 +#endif > > =A0 =A0 =A0}; > > > > > > =A0 =A0 @@ -837,7 +839,9 @@ static int net_client_init1(const voi= d *object, > int > > =A0 =A0 is_netdev, Error **errp) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0case NET_CLIENT_OPTIONS_KIND_BRIDGE: > > =A0 =A0 =A0#endif > > =A0 =A0 =A0 =A0 =A0 =A0 =A0case NET_CLIENT_OPTIONS_KIND_HUBPORT: > > =A0 =A0 +#ifdef CONFIG_VHOST_NET > > =A0 =A0 =A0 =A0 =A0 =A0 =A0case NET_CLIENT_OPTIONS_KIND_VHOST_USE= R: > > =A0 =A0 +#endif > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > > > > =A0 =A0 =A0 =A0 =A0 =A0 =A0default: > > > > > > > > It turns out that configure puts CONFIG_VHOST_NET in the "wrong" = place - > > config-target.h > > > > echo "CONFIG_VHOST_NET=3Dy" >> $config_target_mak > > > > while for example: > > > > echo "CONFIG_VHOST_SCSI=3Dy" >> $config_host_mak > > > > And net.c includes config-host.h, so we end up with vhost-user ne= ver > enabled in > > net.c. >=20 > Not good. >=20 > > Will it be a problem if CONFIG_VHOST_NET is added to config_host_= mak > instead? > > > > > > regards, > > Nikolay Nikolaev >=20 > Try it :) > It likely won't work for linux-user, right? > =20 > -- > MST >=20 >=20 > You're right - its not working. >=20 > I ended up with this: > =A0=A0=A0=A0=A0=A0 if test "$vhost_net" =3D "yes" ; then > =A0=A0=A0=A0=A0=A0=A0 echo "CONFIG_VHOST_NET=3Dy" >> $config_target_mak > =A0=A0=A0=A0=A0=A0=A0 echo "CONFIG_VHOST_NET_USER=3Dy" >> $config_host_= mak > =A0=A0=A0=A0=A0=A0 fi >=20 > and then in net.c depend on CONFIG_VHOST_NET_USER. Is this acceptable? OK but 1. pls rename CONFIG_VHOST_NET_USED 2. you will make it appear many times in .mak, that's ugly, pls set a variable and output once. >=20 > I'm preparing a patchseries including the vhost-user qtest fixes, and c= an > include this solution there if OK. >=20 > regards, > Nikolay Nikolaev