Patchwork tap-win32: stubs to fix win32 build

login
register
mail settings
Submitter Michael S. Tsirkin
Date Oct. 30, 2012, 2:04 p.m.
Message ID <20121030140450.GA27739@redhat.com>
Download mbox | patch
Permalink /patch/195498/
State New
Headers show

Comments

Michael S. Tsirkin - Oct. 30, 2012, 2:04 p.m.
Add missing stubs to win32 to fix link failure.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
---
 net/tap-win32.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
Stefan Hajnoczi - Oct. 30, 2012, 4:16 p.m.
On Tue, Oct 30, 2012 at 04:04:50PM +0200, Michael S. Tsirkin wrote:
> Add missing stubs to win32 to fix link failure.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  net/tap-win32.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/net/tap-win32.c b/net/tap-win32.c
> index 22dad3f..8d2d32b 100644
> --- a/net/tap-win32.c
> +++ b/net/tap-win32.c
> @@ -752,3 +752,13 @@ struct vhost_net *tap_get_vhost_net(NetClientState *nc)
>  {
>      return NULL;
>  }
> +
> +int tap_has_vnet_hdr_len(NetClientState *nc, int len)
> +{
> +    return 0;
> +}
> +
> +void tap_set_vnet_hdr_len(NetClientState *nc, int len)
> +{
> +    assert(0);
> +}

How do we get link failures here on win32?  The only object that needs
these functions is vhost_net.o when CONFIG_VHOST_NET is defined.

Stefan
Michael S. Tsirkin - Oct. 30, 2012, 4:22 p.m.
On Tue, Oct 30, 2012 at 05:16:45PM +0100, Stefan Hajnoczi wrote:
> On Tue, Oct 30, 2012 at 04:04:50PM +0200, Michael S. Tsirkin wrote:
> > Add missing stubs to win32 to fix link failure.
> > 
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >  net/tap-win32.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/net/tap-win32.c b/net/tap-win32.c
> > index 22dad3f..8d2d32b 100644
> > --- a/net/tap-win32.c
> > +++ b/net/tap-win32.c
> > @@ -752,3 +752,13 @@ struct vhost_net *tap_get_vhost_net(NetClientState *nc)
> >  {
> >      return NULL;
> >  }
> > +
> > +int tap_has_vnet_hdr_len(NetClientState *nc, int len)
> > +{
> > +    return 0;
> > +}
> > +
> > +void tap_set_vnet_hdr_len(NetClientState *nc, int len)
> > +{
> > +    assert(0);
> > +}
> 
> How do we get link failures here on win32?  The only object that needs
> these functions is vhost_net.o when CONFIG_VHOST_NET is defined.
> 
> Stefan

No, virtio-net uses them too.
Blue Swirl - Oct. 30, 2012, 9:10 p.m.
Thanks, applied.

On Tue, Oct 30, 2012 at 2:04 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
> Add missing stubs to win32 to fix link failure.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  net/tap-win32.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/net/tap-win32.c b/net/tap-win32.c
> index 22dad3f..8d2d32b 100644
> --- a/net/tap-win32.c
> +++ b/net/tap-win32.c
> @@ -752,3 +752,13 @@ struct vhost_net *tap_get_vhost_net(NetClientState *nc)
>  {
>      return NULL;
>  }
> +
> +int tap_has_vnet_hdr_len(NetClientState *nc, int len)
> +{
> +    return 0;
> +}
> +
> +void tap_set_vnet_hdr_len(NetClientState *nc, int len)
> +{
> +    assert(0);
> +}
> --
> MST
>
Stefan Hajnoczi - Oct. 31, 2012, 7:19 a.m.
On Tue, Oct 30, 2012 at 06:22:45PM +0200, Michael S. Tsirkin wrote:
> On Tue, Oct 30, 2012 at 05:16:45PM +0100, Stefan Hajnoczi wrote:
> > On Tue, Oct 30, 2012 at 04:04:50PM +0200, Michael S. Tsirkin wrote:
> > > Add missing stubs to win32 to fix link failure.
> > > 
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> > > ---
> > >  net/tap-win32.c | 10 ++++++++++
> > >  1 file changed, 10 insertions(+)
> > > 
> > > diff --git a/net/tap-win32.c b/net/tap-win32.c
> > > index 22dad3f..8d2d32b 100644
> > > --- a/net/tap-win32.c
> > > +++ b/net/tap-win32.c
> > > @@ -752,3 +752,13 @@ struct vhost_net *tap_get_vhost_net(NetClientState *nc)
> > >  {
> > >      return NULL;
> > >  }
> > > +
> > > +int tap_has_vnet_hdr_len(NetClientState *nc, int len)
> > > +{
> > > +    return 0;
> > > +}
> > > +
> > > +void tap_set_vnet_hdr_len(NetClientState *nc, int len)
> > > +{
> > > +    assert(0);
> > > +}
> > 
> > How do we get link failures here on win32?  The only object that needs
> > these functions is vhost_net.o when CONFIG_VHOST_NET is defined.
> > 
> > Stefan
> 
> No, virtio-net uses them too.

Weird, git-grep(1) on qemu.git/master doesn't show calls to these
functions from anywhere other than vhost_net.o.

Stefan

Patch

diff --git a/net/tap-win32.c b/net/tap-win32.c
index 22dad3f..8d2d32b 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -752,3 +752,13 @@  struct vhost_net *tap_get_vhost_net(NetClientState *nc)
 {
     return NULL;
 }
+
+int tap_has_vnet_hdr_len(NetClientState *nc, int len)
+{
+    return 0;
+}
+
+void tap_set_vnet_hdr_len(NetClientState *nc, int len)
+{
+    assert(0);
+}