virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
       [not found]                 ` <51A26E95.5000207@redhat.com>
@ 2013-05-26 20:49                   ` Anthony Liguori
  2013-05-26 21:42                     ` Michael S. Tsirkin
  2013-05-27 11:15                     ` Rusty Russell
  0 siblings, 2 replies; 14+ messages in thread
From: Anthony Liguori @ 2013-05-26 20:49 UTC (permalink / raw)
  To: Paolo Bonzini, Michael S. Tsirkin
  Cc: Peter Maydell, qemu-devel, virtualization

Paolo Bonzini <pbonzini@redhat.com> writes:

> Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
>> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
>> 
>> Not really, __uX appear in the headers that were posted.

Which is a problem because this is a reserved namespace in C99.

>> What I'm saying is - a chance of a conflict is very remote,
>> if it happens it's a build failure so easy to debug.
>
> I'm sure that others will complain, :) but you can go ahead.

I think we should clean up the virtio headers in the kernel first.
Seems like a good thing to do given the standardization effort too.

There are lots of headers in uapi that use the C99 int types so there
doesn't seem to be a reason they couldn't be used in virtio.  fuse.h
even has a:

    #ifdef __KERNEL__
    #include <linux/types.h>
    #else
    #include <stdint.h>
    #endif

Which seems like a reasonable thing to do.

The only other kernel dependency is linux/if_ether.h to define
ETH_ALEN.  But it seems completely reasonable to define a
VIRTIO_NET_MAC_ALEN or something like that.

This would make the virtio headers completely stand alone and includable
in userspace (without violating C99).

Perhaps it's even worth moving the headers from uapi/linux to
uapi/virtio.  Rusty, what do you think?

Regards,

Anhtony Liguori

>
> Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-26 20:49                   ` [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code Anthony Liguori
@ 2013-05-26 21:42                     ` Michael S. Tsirkin
  2013-05-27  0:55                       ` Anthony Liguori
  2013-05-27 11:15                     ` Rusty Russell
  1 sibling, 1 reply; 14+ messages in thread
From: Michael S. Tsirkin @ 2013-05-26 21:42 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

On Sun, May 26, 2013 at 03:49:53PM -0500, Anthony Liguori wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
> > Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
> >> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
> >> 
> >> Not really, __uX appear in the headers that were posted.
> 
> Which is a problem because this is a reserved namespace in C99.
> 
> >> What I'm saying is - a chance of a conflict is very remote,
> >> if it happens it's a build failure so easy to debug.
> >
> > I'm sure that others will complain, :) but you can go ahead.
> 
> I think we should clean up the virtio headers in the kernel first.
> Seems like a good thing to do given the standardization effort too.
> There are lots of headers in uapi that use the C99 int types

I found 4:
$ grep -l uint include/uapi/linux/*h
include/uapi/linux/dm-log-userspace.h
include/uapi/linux/fuse.h
include/uapi/linux/jffs2.h
include/uapi/linux/pps.h
include/uapi/linux/rds.h
include/uapi/linux/sctp.h

That's not really lots.

> so there
> doesn't seem to be a reason they couldn't be used in virtio.  fuse.h
> even has a:
> 
>     #ifdef __KERNEL__
>     #include <linux/types.h>
>     #else
>     #include <stdint.h>
>     #endif
> 
> Which seems like a reasonable thing to do.

In kernel, we really want to use things like endian-ness
checks (and, we really should have them in userspace too!).
So we want __le32 and other kernel goodies
like that. stdint.h won't cut it.

> The only other kernel dependency is linux/if_ether.h to define
> ETH_ALEN.  But it seems completely reasonable to define a
> VIRTIO_NET_MAC_ALEN or something like that.

Ugh. Not really reasonable IMO. We also use ETH_P_IP in code,
would like to get rid of redefining that too.
But we can have our own linux/if_ether.h for non-linux hosts,
just with a
couple of macros like that, it's not a big deal.

> This would make the virtio headers completely stand alone and includable
> in userspace (without violating C99).
> 
> Perhaps it's even worth moving the headers from uapi/linux to
> uapi/virtio.  Rusty, what do you think?
> 
> Regards,
> 
> Anhtony Liguori
> 
> >
> > Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-26 21:42                     ` Michael S. Tsirkin
@ 2013-05-27  0:55                       ` Anthony Liguori
  2013-05-27 15:02                         ` Michael S. Tsirkin
  0 siblings, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2013-05-27  0:55 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Sun, May 26, 2013 at 03:49:53PM -0500, Anthony Liguori wrote:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>> 
>> > Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
>> >> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
>> >> 
>> >> Not really, __uX appear in the headers that were posted.
>> 
>> Which is a problem because this is a reserved namespace in C99.
>> 
>> >> What I'm saying is - a chance of a conflict is very remote,
>> >> if it happens it's a build failure so easy to debug.
>> >
>> > I'm sure that others will complain, :) but you can go ahead.
>> 
>> I think we should clean up the virtio headers in the kernel first.
>> Seems like a good thing to do given the standardization effort too.
>> There are lots of headers in uapi that use the C99 int types
>
> I found 4:
> $ grep -l uint include/uapi/linux/*h
> include/uapi/linux/dm-log-userspace.h
> include/uapi/linux/fuse.h
> include/uapi/linux/jffs2.h
> include/uapi/linux/pps.h
> include/uapi/linux/rds.h
> include/uapi/linux/sctp.h
>
> That's not really lots.
>
>> so there
>> doesn't seem to be a reason they couldn't be used in virtio.  fuse.h
>> even has a:
>> 
>>     #ifdef __KERNEL__
>>     #include <linux/types.h>
>>     #else
>>     #include <stdint.h>
>>     #endif
>> 
>> Which seems like a reasonable thing to do.
>
> In kernel, we really want to use things like endian-ness
> checks (and, we really should have them in userspace too!).
> So we want __le32 and other kernel goodies
> like that. stdint.h won't cut it.

With the spec being standardized, I think having a stand alone set of
headers is a good thing.  Licensing is problematic here too.

If virtio headers depend on other Linux headers, then it really doesn't
matter if they are BSD licensed if you need a GPL header (like
linux/if_ether.h).

Now, we can certainly debate the copyrightability of these defines and
what have you but if the headers are meant to be 1) consumed outside the
kernel 2) licensed under a different license than the general kernel
then depending on kernel goodies is the wrong strategy.

>> The only other kernel dependency is linux/if_ether.h to define
>> ETH_ALEN.  But it seems completely reasonable to define a
>> VIRTIO_NET_MAC_ALEN or something like that.
>
> Ugh. Not really reasonable IMO. We also use ETH_P_IP in code,
> would like to get rid of redefining that too.
> But we can have our own linux/if_ether.h for non-linux hosts,
> just with a
> couple of macros like that, it's not a big deal.

See above.

Regards,

Anthony Liguori

>
>> This would make the virtio headers completely stand alone and includable
>> in userspace (without violating C99).
>> 
>> Perhaps it's even worth moving the headers from uapi/linux to
>> uapi/virtio.  Rusty, what do you think?
>> 
>> Regards,
>> 
>> Anhtony Liguori
>> 
>> >
>> > Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-26 20:49                   ` [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code Anthony Liguori
  2013-05-26 21:42                     ` Michael S. Tsirkin
@ 2013-05-27 11:15                     ` Rusty Russell
  2013-05-28  2:55                       ` Anthony Liguori
  2013-05-29  5:17                       ` Bryan Venteicher
  1 sibling, 2 replies; 14+ messages in thread
From: Rusty Russell @ 2013-05-27 11:15 UTC (permalink / raw)
  To: Anthony Liguori, Paolo Bonzini, Michael S. Tsirkin
  Cc: Peter Maydell, qemu-devel, Bryan Venteicher, virtualization

Anthony Liguori <anthony@codemonkey.ws> writes:
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
>> Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
>>> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
>>> 
>>> Not really, __uX appear in the headers that were posted.
>
> Which is a problem because this is a reserved namespace in C99.

Personally, I find it hard to care.  What matters is not what the
standard has carved out, but whether we have clashes, reserved namespace
or no.  And that won't happen for these.

If someone wants to convert all the kernel headers, I won't NAK it
though.

> Perhaps it's even worth moving the headers from uapi/linux to
> uapi/virtio.  Rusty, what do you think?

Hmm, #include <virtio/virtio_net.h> etc would be worthwhile if that also
worked on FreeBSD.  Bryan CC'd...

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-27  0:55                       ` Anthony Liguori
@ 2013-05-27 15:02                         ` Michael S. Tsirkin
  2013-05-27 16:14                           ` Anthony Liguori
  0 siblings, 1 reply; 14+ messages in thread
From: Michael S. Tsirkin @ 2013-05-27 15:02 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

On Sun, May 26, 2013 at 07:55:25PM -0500, Anthony Liguori wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
> 
> > On Sun, May 26, 2013 at 03:49:53PM -0500, Anthony Liguori wrote:
> >> Paolo Bonzini <pbonzini@redhat.com> writes:
> >> 
> >> > Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
> >> >> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
> >> >> 
> >> >> Not really, __uX appear in the headers that were posted.
> >> 
> >> Which is a problem because this is a reserved namespace in C99.
> >> 
> >> >> What I'm saying is - a chance of a conflict is very remote,
> >> >> if it happens it's a build failure so easy to debug.
> >> >
> >> > I'm sure that others will complain, :) but you can go ahead.
> >> 
> >> I think we should clean up the virtio headers in the kernel first.
> >> Seems like a good thing to do given the standardization effort too.
> >> There are lots of headers in uapi that use the C99 int types
> >
> > I found 4:
> > $ grep -l uint include/uapi/linux/*h
> > include/uapi/linux/dm-log-userspace.h
> > include/uapi/linux/fuse.h
> > include/uapi/linux/jffs2.h
> > include/uapi/linux/pps.h
> > include/uapi/linux/rds.h
> > include/uapi/linux/sctp.h
> >
> > That's not really lots.
> >
> >> so there
> >> doesn't seem to be a reason they couldn't be used in virtio.  fuse.h
> >> even has a:
> >> 
> >>     #ifdef __KERNEL__
> >>     #include <linux/types.h>
> >>     #else
> >>     #include <stdint.h>
> >>     #endif
> >> 
> >> Which seems like a reasonable thing to do.
> >
> > In kernel, we really want to use things like endian-ness
> > checks (and, we really should have them in userspace too!).
> > So we want __le32 and other kernel goodies
> > like that. stdint.h won't cut it.
> 
> With the spec being standardized, I think having a stand alone set of
> headers is a good thing.

Sure, that's possible. We'll have to find some way to
preserve the endian-ness annotations, I think.
And then import them into kernel/qemu with some script, converting
to kernel/qemu style and annotations?

>  Licensing is problematic here too.
> 
> If virtio headers depend on other Linux headers, then it really doesn't
> matter if they are BSD licensed if you need a GPL header (like
> linux/if_ether.h).
> 
> Now, we can certainly debate the copyrightability of these defines and
> what have you but if the headers are meant to be 1) consumed outside the
> kernel 2) licensed under a different license than the general kernel
> then depending on kernel goodies is the wrong strategy.

Well specifically if_ether.h says GPLv2+ so it's OK for QEMU.
Do you mean for some other non GPL app?

> >> The only other kernel dependency is linux/if_ether.h to define
> >> ETH_ALEN.  But it seems completely reasonable to define a
> >> VIRTIO_NET_MAC_ALEN or something like that.
> >
> > Ugh. Not really reasonable IMO. We also use ETH_P_IP in code,
> > would like to get rid of redefining that too.
> > But we can have our own linux/if_ether.h for non-linux hosts,
> > just with a
> > couple of macros like that, it's not a big deal.
> 
> See above.
> 
> Regards,
> 
> Anthony Liguori
> 
> >
> >> This would make the virtio headers completely stand alone and includable
> >> in userspace (without violating C99).
> >> 
> >> Perhaps it's even worth moving the headers from uapi/linux to
> >> uapi/virtio.  Rusty, what do you think?
> >> 
> >> Regards,
> >> 
> >> Anhtony Liguori
> >> 
> >> >
> >> > Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-27 15:02                         ` Michael S. Tsirkin
@ 2013-05-27 16:14                           ` Anthony Liguori
  2013-05-28  6:23                             ` Michael S. Tsirkin
  2013-05-29  0:14                             ` Rusty Russell
  0 siblings, 2 replies; 14+ messages in thread
From: Anthony Liguori @ 2013-05-27 16:14 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Sun, May 26, 2013 at 07:55:25PM -0500, Anthony Liguori wrote:
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>> 
>> > On Sun, May 26, 2013 at 03:49:53PM -0500, Anthony Liguori wrote:
>> >> Paolo Bonzini <pbonzini@redhat.com> writes:
>> >> 
>> >> > Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
>> >> >> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
>> >> >> 
>> >> >> Not really, __uX appear in the headers that were posted.
>> >> 
>> >> Which is a problem because this is a reserved namespace in C99.
>> >> 
>> >> >> What I'm saying is - a chance of a conflict is very remote,
>> >> >> if it happens it's a build failure so easy to debug.
>> >> >
>> >> > I'm sure that others will complain, :) but you can go ahead.
>> >> 
>> >> I think we should clean up the virtio headers in the kernel first.
>> >> Seems like a good thing to do given the standardization effort too.
>> >> There are lots of headers in uapi that use the C99 int types
>> >
>> > I found 4:
>> > $ grep -l uint include/uapi/linux/*h
>> > include/uapi/linux/dm-log-userspace.h
>> > include/uapi/linux/fuse.h
>> > include/uapi/linux/jffs2.h
>> > include/uapi/linux/pps.h
>> > include/uapi/linux/rds.h
>> > include/uapi/linux/sctp.h
>> >
>> > That's not really lots.
>> >
>> >> so there
>> >> doesn't seem to be a reason they couldn't be used in virtio.  fuse.h
>> >> even has a:
>> >> 
>> >>     #ifdef __KERNEL__
>> >>     #include <linux/types.h>
>> >>     #else
>> >>     #include <stdint.h>
>> >>     #endif
>> >> 
>> >> Which seems like a reasonable thing to do.
>> >
>> > In kernel, we really want to use things like endian-ness
>> > checks (and, we really should have them in userspace too!).
>> > So we want __le32 and other kernel goodies
>> > like that. stdint.h won't cut it.
>> 
>> With the spec being standardized, I think having a stand alone set of
>> headers is a good thing.
>
> Sure, that's possible. We'll have to find some way to
> preserve the endian-ness annotations, I think.
> And then import them into kernel/qemu with some script, converting
> to kernel/qemu style and annotations?

See below.

>>  Licensing is problematic here too.
>> 
>> If virtio headers depend on other Linux headers, then it really doesn't
>> matter if they are BSD licensed if you need a GPL header (like
>> linux/if_ether.h).
>> 
>> Now, we can certainly debate the copyrightability of these defines and
>> what have you but if the headers are meant to be 1) consumed outside the
>> kernel 2) licensed under a different license than the general kernel
>> then depending on kernel goodies is the wrong strategy.
>
> Well specifically if_ether.h says GPLv2+ so it's OK for QEMU.
> Do you mean for some other non GPL app?

Ignore QEMU for the moment.

The headers say they are BSD licensed... but they include a GPLv2+
header.  Doesn't make a lot of sense, does it?

Again, I think it's something pretty basic here.  Either (1) these are
kernel/userspace headers that are meant to be consumed through libc or
whatever (2) these are kernel-private headers not to be consumed outside
of the kernel (3) these are headers meant to be copied widely and used
as a reference implementation of virtio.

If (1) or (2), copying them into QEMU via a magic sanitizing script is
wrong.  We should just keep doing what we're doing.

If (3), then we should clean up the virtio headers to be license clean
and usable outside of the kernel.  We shouldn't try to solve this
problem in QEMU (via scripts) if we can just solve it in the kernel.

Regards,

Anthony Liguori

>
>> >> The only other kernel dependency is linux/if_ether.h to define
>> >> ETH_ALEN.  But it seems completely reasonable to define a
>> >> VIRTIO_NET_MAC_ALEN or something like that.
>> >
>> > Ugh. Not really reasonable IMO. We also use ETH_P_IP in code,
>> > would like to get rid of redefining that too.
>> > But we can have our own linux/if_ether.h for non-linux hosts,
>> > just with a
>> > couple of macros like that, it's not a big deal.
>> 
>> See above.
>> 
>> Regards,
>> 
>> Anthony Liguori
>> 
>> >
>> >> This would make the virtio headers completely stand alone and includable
>> >> in userspace (without violating C99).
>> >> 
>> >> Perhaps it's even worth moving the headers from uapi/linux to
>> >> uapi/virtio.  Rusty, what do you think?
>> >> 
>> >> Regards,
>> >> 
>> >> Anhtony Liguori
>> >> 
>> >> >
>> >> > Paolo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-27 11:15                     ` Rusty Russell
@ 2013-05-28  2:55                       ` Anthony Liguori
  2013-05-29  0:17                         ` Rusty Russell
  2013-05-29  5:17                       ` Bryan Venteicher
  1 sibling, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2013-05-28  2:55 UTC (permalink / raw)
  To: Rusty Russell, Paolo Bonzini, Michael S. Tsirkin
  Cc: Peter Maydell, qemu-devel, Bryan Venteicher, virtualization

Rusty Russell <rusty@rustcorp.com.au> writes:

> Anthony Liguori <anthony@codemonkey.ws> writes:
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>
>>> Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
>>>> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
>>>> 
>>>> Not really, __uX appear in the headers that were posted.
>>
>> Which is a problem because this is a reserved namespace in C99.
>
> Personally, I find it hard to care.  What matters is not what the
> standard has carved out, but whether we have clashes, reserved namespace
> or no.  And that won't happen for these.
>
> If someone wants to convert all the kernel headers, I won't NAK it
> though.

virtio headers are special.  Linux headers are normally only consumed in
the kernel or in a userspace application running on Linux.

virtio headers may be used either in a userspace application running on
!Linux (we need to support QEMU on Windows) or even in a foreign kernel.

linux/types.h is unusable outside of Linux because it pulls in a bunch
of other headers.  If you look at Michael's patch, he adds his own
version of types.h.  It's unfortunate for every user of the headers to
do this.

Regards,

Anthony Liguori

>> Perhaps it's even worth moving the headers from uapi/linux to
>> uapi/virtio.  Rusty, what do you think?
>
> Hmm, #include <virtio/virtio_net.h> etc would be worthwhile if that also
> worked on FreeBSD.  Bryan CC'd...
>
> Cheers,
> Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-27 16:14                           ` Anthony Liguori
@ 2013-05-28  6:23                             ` Michael S. Tsirkin
  2013-05-29  0:14                             ` Rusty Russell
  1 sibling, 0 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2013-05-28  6:23 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

On Mon, May 27, 2013 at 11:14:47AM -0500, Anthony Liguori wrote:
> > Well specifically if_ether.h says GPLv2+ so it's OK for QEMU.
> > Do you mean for some other non GPL app?
> 
> Ignore QEMU for the moment.
> 
> The headers say they are BSD licensed... but they include a GPLv2+
> header.

Above is a bit misleading.  To be precise, they don't include a GPLv2+
header. One header merely includes this line:
#include <linux/if_ether.h>

-- 
MST

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-27 16:14                           ` Anthony Liguori
  2013-05-28  6:23                             ` Michael S. Tsirkin
@ 2013-05-29  0:14                             ` Rusty Russell
  2013-05-29 13:05                               ` Anthony Liguori
  1 sibling, 1 reply; 14+ messages in thread
From: Rusty Russell @ 2013-05-29  0:14 UTC (permalink / raw)
  To: Anthony Liguori, Michael S. Tsirkin
  Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

Anthony Liguori <anthony@codemonkey.ws> writes:
> The headers say they are BSD licensed... but they include a GPLv2+
> header.  Doesn't make a lot of sense, does it?

It makes perfect sense: you're overthinking it.  It just means that
copying the BSD headers outside Linux is encouraged.

And it's clearly nonsensical to claim the GPL on kernel headers means
that userspace needs to be GPL.  So please ignore this licensing
red-herring.

And we'll bikeshed the headers in the standard when we have to :)  They
certainly don't need to be cut&paste into the kernel sources.

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-28  2:55                       ` Anthony Liguori
@ 2013-05-29  0:17                         ` Rusty Russell
  0 siblings, 0 replies; 14+ messages in thread
From: Rusty Russell @ 2013-05-29  0:17 UTC (permalink / raw)
  To: Anthony Liguori, Paolo Bonzini, Michael S. Tsirkin
  Cc: Peter Maydell, qemu-devel, Bryan Venteicher, virtualization

Anthony Liguori <anthony@codemonkey.ws> writes:
> Rusty Russell <rusty@rustcorp.com.au> writes:
>
>> Anthony Liguori <anthony@codemonkey.ws> writes:
>>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>>
>>>> Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
>>>>> > My fault.  I should have looked at linux/types.h (actually asm-generic/).
>>>>> 
>>>>> Not really, __uX appear in the headers that were posted.
>>>
>>> Which is a problem because this is a reserved namespace in C99.
>>
>> Personally, I find it hard to care.  What matters is not what the
>> standard has carved out, but whether we have clashes, reserved namespace
>> or no.  And that won't happen for these.
>>
>> If someone wants to convert all the kernel headers, I won't NAK it
>> though.
>
> virtio headers are special.  Linux headers are normally only consumed in
> the kernel or in a userspace application running on Linux.
>
> virtio headers may be used either in a userspace application running on
> !Linux (we need to support QEMU on Windows) or even in a foreign kernel.

No.

s/virtio/SCSI/.  s/virtio/if_eth/.  s/virtio/TCPIP/.

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-27 11:15                     ` Rusty Russell
  2013-05-28  2:55                       ` Anthony Liguori
@ 2013-05-29  5:17                       ` Bryan Venteicher
  1 sibling, 0 replies; 14+ messages in thread
From: Bryan Venteicher @ 2013-05-29  5:17 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Peter Maydell, Michael S. Tsirkin, qemu-devel, virtualization,
	Anthony Liguori, Paolo Bonzini


[-- Attachment #1.1: Type: text/plain, Size: 1994 bytes --]

On Mon, May 27, 2013 at 6:15 AM, Rusty Russell <rusty@rustcorp.com.au>wrote:

> Anthony Liguori <anthony@codemonkey.ws> writes:
> > Paolo Bonzini <pbonzini@redhat.com> writes:
> >
> >> Il 26/05/2013 22:02, Michael S. Tsirkin ha scritto:
> >>> > My fault.  I should have looked at linux/types.h (actually
> asm-generic/).
> >>>
> >>> Not really, __uX appear in the headers that were posted.
> >
> > Which is a problem because this is a reserved namespace in C99.
>
> Personally, I find it hard to care.  What matters is not what the
> standard has carved out, but whether we have clashes, reserved namespace
> or no.  And that won't happen for these.
>
> If someone wants to convert all the kernel headers, I won't NAK it
> though.
>
> > Perhaps it's even worth moving the headers from uapi/linux to
> > uapi/virtio.  Rusty, what do you think?
>
> Hmm, #include <virtio/virtio_net.h> etc would be worthwhile if that also
> worked on FreeBSD.  Bryan CC'd...
>
>
I've only done minor work on the VirtIO headers when importing them to
FreeBSD - mostly converting the _XX types to the preferred C99 variants,
along with some misc nits. I'm not too concerned with keeping the
headers identical to what is in Linux; I manually merge in required changes
when supporting a new feature and this hasn't been an issue. I'm content as
long as they remain BSD licensed. Growing GPL'ed #includes is a bit
worrisome, but I have a hard time foreseeing what the VirtIO files
could possibly depend on that isn't trivial.

I don't think I have enough context to understand the  ' #include
<virtio/virtio_net.h> etc' suggestion ... In FreeBSD, the VirtIO headers
files exist only in the source tree along side the corresponding device,
ie. sys/dev/virtio/network/virtio_net.h, sys/dev/virtio/pci/virtio_pci.h,
etc. The FreeBSD hypervisor (bhyve) just duplicates the
needed definitions/defines. This will be fixed at some point, but bhyve's
VirtIO is so barebones there is bigger fish to fry.


> Cheers,
> Rusty.
>

[-- Attachment #1.2: Type: text/html, Size: 2937 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-29  0:14                             ` Rusty Russell
@ 2013-05-29 13:05                               ` Anthony Liguori
  2013-05-29 14:09                                 ` Michael S. Tsirkin
  0 siblings, 1 reply; 14+ messages in thread
From: Anthony Liguori @ 2013-05-29 13:05 UTC (permalink / raw)
  To: Rusty Russell, Michael S. Tsirkin
  Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

Rusty Russell <rusty@rustcorp.com.au> writes:

> Anthony Liguori <anthony@codemonkey.ws> writes:
>> The headers say they are BSD licensed... but they include a GPLv2+
>> header.  Doesn't make a lot of sense, does it?
>
> It makes perfect sense: you're overthinking it.  It just means that
> copying the BSD headers outside Linux is encouraged.

Copying by hand and modifying.  This patch series attempts to do it
automatically within QEMU.

> And it's clearly nonsensical to claim the GPL on kernel headers means
> that userspace needs to be GPL.  So please ignore this licensing
> red-herring.

You're missing context, I suspect.  This series is trying to
automatically copy the headers from Linux.  We currently have a manually
copied version.

The headers are not currently well suited for automatic copying because
(1) they use kernel types (2) they pull in dependencies from throughout
the kernel.

This discussion comes down to whether we want to make it easier to
automatically copy the headers or do we maintain the status quo and
require manual munging to pull in the headers.

Regards,

Anthony Liguori

>
> And we'll bikeshed the headers in the standard when we have to :)  They
> certainly don't need to be cut&paste into the kernel sources.
>
> Cheers,
> Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-29 13:05                               ` Anthony Liguori
@ 2013-05-29 14:09                                 ` Michael S. Tsirkin
  2013-05-29 14:58                                   ` Anthony Liguori
  0 siblings, 1 reply; 14+ messages in thread
From: Michael S. Tsirkin @ 2013-05-29 14:09 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

On Wed, May 29, 2013 at 08:05:29AM -0500, Anthony Liguori wrote:
> Rusty Russell <rusty@rustcorp.com.au> writes:
> 
> > Anthony Liguori <anthony@codemonkey.ws> writes:
> >> The headers say they are BSD licensed... but they include a GPLv2+
> >> header.  Doesn't make a lot of sense, does it?
> >
> > It makes perfect sense: you're overthinking it.  It just means that
> > copying the BSD headers outside Linux is encouraged.
> 
> Copying by hand and modifying.  This patch series attempts to do it
> automatically within QEMU.
> 
> > And it's clearly nonsensical to claim the GPL on kernel headers means
> > that userspace needs to be GPL.  So please ignore this licensing
> > red-herring.
> 
> You're missing context, I suspect.  This series is trying to
> automatically copy the headers from Linux.  We currently have a manually
> copied version.
> 
> The headers are not currently well suited for automatic copying because
> (1) they use kernel types (2) they pull in dependencies from throughout
> the kernel.
> 
> This discussion comes down to whether we want to make it easier to
> automatically copy the headers or do we maintain the status quo and
> require manual munging to pull in the headers.
> 
> Regards,
> 
> Anthony Liguori

Okay, what if I

1. add a stub if_ether.h with a couple of macros we want
2. replace the types during copying

Would this address all concerns?

> >
> > And we'll bikeshed the headers in the standard when we have to :)  They
> > certainly don't need to be cut&paste into the kernel sources.
> >
> > Cheers,
> > Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code
  2013-05-29 14:09                                 ` Michael S. Tsirkin
@ 2013-05-29 14:58                                   ` Anthony Liguori
  0 siblings, 0 replies; 14+ messages in thread
From: Anthony Liguori @ 2013-05-29 14:58 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: Paolo Bonzini, virtualization, qemu-devel, Peter Maydell

"Michael S. Tsirkin" <mst@redhat.com> writes:

> On Wed, May 29, 2013 at 08:05:29AM -0500, Anthony Liguori wrote:
>> Rusty Russell <rusty@rustcorp.com.au> writes:
>> 
>> > Anthony Liguori <anthony@codemonkey.ws> writes:
>> >> The headers say they are BSD licensed... but they include a GPLv2+
>> >> header.  Doesn't make a lot of sense, does it?
>> >
>> > It makes perfect sense: you're overthinking it.  It just means that
>> > copying the BSD headers outside Linux is encouraged.
>> 
>> Copying by hand and modifying.  This patch series attempts to do it
>> automatically within QEMU.
>> 
>> > And it's clearly nonsensical to claim the GPL on kernel headers means
>> > that userspace needs to be GPL.  So please ignore this licensing
>> > red-herring.
>> 
>> You're missing context, I suspect.  This series is trying to
>> automatically copy the headers from Linux.  We currently have a manually
>> copied version.
>> 
>> The headers are not currently well suited for automatic copying because
>> (1) they use kernel types (2) they pull in dependencies from throughout
>> the kernel.
>> 
>> This discussion comes down to whether we want to make it easier to
>> automatically copy the headers or do we maintain the status quo and
>> require manual munging to pull in the headers.
>> 
>> Regards,
>> 
>> Anthony Liguori
>
> Okay, what if I
>
> 1. add a stub if_ether.h with a couple of macros we want
> 2. replace the types during copying
>
> Would this address all concerns?

If Rusty doesn't like the idea of making the headers usable directly,
then I don't object to having stubs/scripts to sanitize them in QEMU.

Regards,

Anthony Liguori

>
>> >
>> > And we'll bikeshed the headers in the standard when we have to :)  They
>> > certainly don't need to be cut&paste into the kernel sources.
>> >
>> > Cheers,
>> > Rusty.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-05-29 14:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1369581694-1655-1-git-send-email-mst@redhat.com>
     [not found] ` <CAFEAcA9stW6xv3mr0ouMVTcDfVE=4=_OcUuZscguJkzGFY9WKg@mail.gmail.com>
     [not found]   ` <20130526175110.GA3115@redhat.com>
     [not found]     ` <CAFEAcA9HW6=F7QKpuof02hGTaAnLsZmoZ_-Yo98wKzeELi_zvA@mail.gmail.com>
     [not found]       ` <20130526181017.GB3115@redhat.com>
     [not found]         ` <51A253C6.7060303@redhat.com>
     [not found]           ` <20130526183747.GB3427@redhat.com>
     [not found]             ` <51A25A2D.8030700@redhat.com>
     [not found]               ` <20130526200251.GA4305@redhat.com>
     [not found]                 ` <51A26E95.5000207@redhat.com>
2013-05-26 20:49                   ` [Qemu-devel] [PATCH v2 00/11] qemu: use virtio linux headers in portable code Anthony Liguori
2013-05-26 21:42                     ` Michael S. Tsirkin
2013-05-27  0:55                       ` Anthony Liguori
2013-05-27 15:02                         ` Michael S. Tsirkin
2013-05-27 16:14                           ` Anthony Liguori
2013-05-28  6:23                             ` Michael S. Tsirkin
2013-05-29  0:14                             ` Rusty Russell
2013-05-29 13:05                               ` Anthony Liguori
2013-05-29 14:09                                 ` Michael S. Tsirkin
2013-05-29 14:58                                   ` Anthony Liguori
2013-05-27 11:15                     ` Rusty Russell
2013-05-28  2:55                       ` Anthony Liguori
2013-05-29  0:17                         ` Rusty Russell
2013-05-29  5:17                       ` Bryan Venteicher

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).