* [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation
@ 2014-06-18 20:45 Nikolay Nikolaev
2014-06-19 14:16 ` Nikolay Nikolaev
2014-06-19 14:54 ` Michael S. Tsirkin
0 siblings, 2 replies; 6+ messages in thread
From: Nikolay Nikolaev @ 2014-06-18 20:45 UTC (permalink / raw)
To: snabb-devel, qemu-devel, mst; +Cc: a.motakis, luke, tech, n.nikolaev
Make net.o linkage expect net_init_vhost_user only when
CONFIG_VHOST_NET is defined.
Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
---
net/net.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/net.c b/net/net.c
index de76e30..0c30414 100644
--- a/net/net.c
+++ b/net/net.c
@@ -803,7 +803,9 @@ static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
[NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge,
#endif
[NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport,
+#ifdef CONFIG_VHOST_NET
[NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
+#endif
};
@@ -837,7 +839,9 @@ static int net_client_init1(const void *object, int is_netdev, Error **errp)
case NET_CLIENT_OPTIONS_KIND_BRIDGE:
#endif
case NET_CLIENT_OPTIONS_KIND_HUBPORT:
+#ifdef CONFIG_VHOST_NET
case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
+#endif
break;
default:
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation
2014-06-18 20:45 [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation Nikolay Nikolaev
@ 2014-06-19 14:16 ` Nikolay Nikolaev
2014-06-19 14:24 ` Michael S. Tsirkin
2014-06-19 14:54 ` Michael S. Tsirkin
1 sibling, 1 reply; 6+ messages in thread
From: Nikolay Nikolaev @ 2014-06-19 14:16 UTC (permalink / raw)
To: mst, qemu-devel; +Cc: VirtualOpenSystems Technical Team
[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]
Hello,
On Wed, Jun 18, 2014 at 11:45 PM, Nikolay Nikolaev <
n.nikolaev@virtualopensystems.com> wrote:
> Make net.o linkage expect net_init_vhost_user only when
> CONFIG_VHOST_NET is defined.
>
> Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> ---
> net/net.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/net.c b/net/net.c
> index de76e30..0c30414 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -803,7 +803,9 @@ static int (* const
> net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
> [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge,
> #endif
> [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport,
> +#ifdef CONFIG_VHOST_NET
> [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
> +#endif
> };
>
>
> @@ -837,7 +839,9 @@ static int net_client_init1(const void *object, int
> is_netdev, Error **errp)
> case NET_CLIENT_OPTIONS_KIND_BRIDGE:
> #endif
> case NET_CLIENT_OPTIONS_KIND_HUBPORT:
> +#ifdef CONFIG_VHOST_NET
> case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
> +#endif
> break;
>
> default:
>
>
It turns out that configure puts CONFIG_VHOST_NET in the "wrong" place -
config-target.h
echo "CONFIG_VHOST_NET=y" >> $config_target_mak
while for example:
echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
And net.c includes config-host.h, so we end up with vhost-user never
enabled in net.c.
Will it be a problem if CONFIG_VHOST_NET is added to config_host_mak
instead?
regards,
Nikolay Nikolaev
[-- Attachment #2: Type: text/html, Size: 2444 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation
2014-06-19 14:16 ` Nikolay Nikolaev
@ 2014-06-19 14:24 ` Michael S. Tsirkin
2014-06-19 14:33 ` Nikolay Nikolaev
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-19 14:24 UTC (permalink / raw)
To: Nikolay Nikolaev; +Cc: VirtualOpenSystems Technical Team, qemu-devel
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:
>
> Make net.o linkage expect net_init_vhost_user only when
> CONFIG_VHOST_NET is defined.
>
> Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> ---
> net/net.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/net.c b/net/net.c
> index de76e30..0c30414 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -803,7 +803,9 @@ static int (* const net_client_init_fun
> [NET_CLIENT_OPTIONS_KIND_MAX])(
> [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge,
> #endif
> [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport,
> +#ifdef CONFIG_VHOST_NET
> [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
> +#endif
> };
>
>
> @@ -837,7 +839,9 @@ static int net_client_init1(const void *object, int
> is_netdev, Error **errp)
> case NET_CLIENT_OPTIONS_KIND_BRIDGE:
> #endif
> case NET_CLIENT_OPTIONS_KIND_HUBPORT:
> +#ifdef CONFIG_VHOST_NET
> case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
> +#endif
> break;
>
> default:
>
>
>
> It turns out that configure puts CONFIG_VHOST_NET in the "wrong" place -
> config-target.h
>
> echo "CONFIG_VHOST_NET=y" >> $config_target_mak
>
> while for example:
>
> echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
>
> And net.c includes config-host.h, so we end up with vhost-user never enabled in
> net.c.
Not good.
> Will it be a problem if CONFIG_VHOST_NET is added to config_host_mak instead?
>
>
> regards,
> Nikolay Nikolaev
Try it :)
It likely won't work for linux-user, right?
--
MST
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation
2014-06-19 14:24 ` Michael S. Tsirkin
@ 2014-06-19 14:33 ` Nikolay Nikolaev
2014-06-19 14:47 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Nikolay Nikolaev @ 2014-06-19 14:33 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: VirtualOpenSystems Technical Team, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]
Hello,
On Thu, Jun 19, 2014 at 5:24 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> 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:
> >
> > Make net.o linkage expect net_init_vhost_user only when
> > CONFIG_VHOST_NET is defined.
> >
> > Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> > ---
> > net/net.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/net/net.c b/net/net.c
> > index de76e30..0c30414 100644
> > --- a/net/net.c
> > +++ b/net/net.c
> > @@ -803,7 +803,9 @@ static int (* const net_client_init_fun
> > [NET_CLIENT_OPTIONS_KIND_MAX])(
> > [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge,
> > #endif
> > [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport,
> > +#ifdef CONFIG_VHOST_NET
> > [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
> > +#endif
> > };
> >
> >
> > @@ -837,7 +839,9 @@ static int net_client_init1(const void *object,
> int
> > is_netdev, Error **errp)
> > case NET_CLIENT_OPTIONS_KIND_BRIDGE:
> > #endif
> > case NET_CLIENT_OPTIONS_KIND_HUBPORT:
> > +#ifdef CONFIG_VHOST_NET
> > case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
> > +#endif
> > break;
> >
> > default:
> >
> >
> >
> > It turns out that configure puts CONFIG_VHOST_NET in the "wrong" place -
> > config-target.h
> >
> > echo "CONFIG_VHOST_NET=y" >> $config_target_mak
> >
> > while for example:
> >
> > echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
> >
> > And net.c includes config-host.h, so we end up with vhost-user never
> enabled in
> > net.c.
>
> Not good.
>
> > Will it be a problem if CONFIG_VHOST_NET is added to config_host_mak
> instead?
> >
> >
> > regards,
> > Nikolay Nikolaev
>
> Try it :)
> It likely won't work for linux-user, right?
>
> --
> MST
>
You're right - its not working.
I ended up with this:
if test "$vhost_net" = "yes" ; then
echo "CONFIG_VHOST_NET=y" >> $config_target_mak
echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
fi
and then in net.c depend on CONFIG_VHOST_NET_USER. Is this acceptable?
I'm preparing a patchseries including the vhost-user qtest fixes, and can
include this solution there if OK.
regards,
Nikolay Nikolaev
[-- Attachment #2: Type: text/html, Size: 3914 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation
2014-06-19 14:33 ` Nikolay Nikolaev
@ 2014-06-19 14:47 ` Michael S. Tsirkin
0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-19 14:47 UTC (permalink / raw)
To: Nikolay Nikolaev; +Cc: VirtualOpenSystems Technical Team, qemu-devel
On Thu, Jun 19, 2014 at 05:33:02PM +0300, Nikolay Nikolaev wrote:
> Hello,
>
>
> On Thu, Jun 19, 2014 at 5:24 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
>
> 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:
> >
> > Make net.o linkage expect net_init_vhost_user only when
> > CONFIG_VHOST_NET is defined.
> >
> > Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> > ---
> > net/net.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/net/net.c b/net/net.c
> > index de76e30..0c30414 100644
> > --- a/net/net.c
> > +++ b/net/net.c
> > @@ -803,7 +803,9 @@ static int (* const net_client_init_fun
> > [NET_CLIENT_OPTIONS_KIND_MAX])(
> > [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge,
> > #endif
> > [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport,
> > +#ifdef CONFIG_VHOST_NET
> > [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
> > +#endif
> > };
> >
> >
> > @@ -837,7 +839,9 @@ static int net_client_init1(const void *object,
> int
> > is_netdev, Error **errp)
> > case NET_CLIENT_OPTIONS_KIND_BRIDGE:
> > #endif
> > case NET_CLIENT_OPTIONS_KIND_HUBPORT:
> > +#ifdef CONFIG_VHOST_NET
> > case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
> > +#endif
> > break;
> >
> > default:
> >
> >
> >
> > It turns out that configure puts CONFIG_VHOST_NET in the "wrong" place -
> > config-target.h
> >
> > echo "CONFIG_VHOST_NET=y" >> $config_target_mak
> >
> > while for example:
> >
> > echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
> >
> > And net.c includes config-host.h, so we end up with vhost-user never
> enabled in
> > net.c.
>
> Not good.
>
> > Will it be a problem if CONFIG_VHOST_NET is added to config_host_mak
> instead?
> >
> >
> > regards,
> > Nikolay Nikolaev
>
> Try it :)
> It likely won't work for linux-user, right?
>
> --
> MST
>
>
> You're right - its not working.
>
> I ended up with this:
> if test "$vhost_net" = "yes" ; then
> echo "CONFIG_VHOST_NET=y" >> $config_target_mak
> echo "CONFIG_VHOST_NET_USER=y" >> $config_host_mak
> fi
>
> 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.
>
> I'm preparing a patchseries including the vhost-user qtest fixes, and can
> include this solution there if OK.
>
> regards,
> Nikolay Nikolaev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation
2014-06-18 20:45 [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation Nikolay Nikolaev
2014-06-19 14:16 ` Nikolay Nikolaev
@ 2014-06-19 14:54 ` Michael S. Tsirkin
1 sibling, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2014-06-19 14:54 UTC (permalink / raw)
To: Nikolay Nikolaev; +Cc: a.motakis, luke, snabb-devel, qemu-devel, tech
On Wed, Jun 18, 2014 at 11:45:45PM +0300, Nikolay Nikolaev wrote:
> Make net.o linkage expect net_init_vhost_user only when
> CONFIG_VHOST_NET is defined.
>
> Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Pls fix this one asap as it blocks pull request.
I'll have to push vhost user out to next request otherwise ...
> ---
> net/net.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/net.c b/net/net.c
> index de76e30..0c30414 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -803,7 +803,9 @@ static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
> [NET_CLIENT_OPTIONS_KIND_BRIDGE] = net_init_bridge,
> #endif
> [NET_CLIENT_OPTIONS_KIND_HUBPORT] = net_init_hubport,
> +#ifdef CONFIG_VHOST_NET
> [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
> +#endif
> };
>
>
> @@ -837,7 +839,9 @@ static int net_client_init1(const void *object, int is_netdev, Error **errp)
> case NET_CLIENT_OPTIONS_KIND_BRIDGE:
> #endif
> case NET_CLIENT_OPTIONS_KIND_HUBPORT:
> +#ifdef CONFIG_VHOST_NET
> case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
> +#endif
> break;
>
> default:
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-06-19 14:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 20:45 [Qemu-devel] [PATCH] net: fix vhost-user mingw compilation Nikolay Nikolaev
2014-06-19 14:16 ` Nikolay Nikolaev
2014-06-19 14:24 ` Michael S. Tsirkin
2014-06-19 14:33 ` Nikolay Nikolaev
2014-06-19 14:47 ` Michael S. Tsirkin
2014-06-19 14:54 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).