[PATCH] tap-bsd: Remove special casing for older OpenBSD releases

Brad Smith posted 1 patch 3 years, 1 month ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/YF5y+MDiK2QInFA2@humpty.home.comstyle.com
Maintainers: Brad Smith <brad@comstyle.com>, Jason Wang <jasowang@redhat.com>
[PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Brad Smith 3 years, 1 month ago
OpenBSD added support for tap(4) 10 releases ago.

Remove the special casing for older releases.


Signed-off-by: Brad Smith <brad@comstyle.com>

diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index 77aaf674b1..59dfcdfae0 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -35,10 +35,6 @@
 #include <net/if_tap.h>
 #endif
 
-#if defined(__OpenBSD__)
-#include <sys/param.h>
-#endif
-
 #ifndef __FreeBSD__
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
              int vnet_hdr_required, int mq_required, Error **errp)
@@ -59,11 +55,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
         if (*ifname) {
             snprintf(dname, sizeof dname, "/dev/%s", ifname);
         } else {
-#if defined(__OpenBSD__) && OpenBSD < 201605
-            snprintf(dname, sizeof dname, "/dev/tun%d", i);
-#else
             snprintf(dname, sizeof dname, "/dev/tap%d", i);
-#endif
         }
         TFR(fd = open(dname, O_RDWR));
         if (fd >= 0) {

Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Jason Wang 3 years ago
在 2021/3/27 上午7:49, Brad Smith 写道:
> OpenBSD added support for tap(4) 10 releases ago.
>
> Remove the special casing for older releases.
>
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
>
> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
> index 77aaf674b1..59dfcdfae0 100644
> --- a/net/tap-bsd.c
> +++ b/net/tap-bsd.c
> @@ -35,10 +35,6 @@
>   #include <net/if_tap.h>
>   #endif
>   
> -#if defined(__OpenBSD__)
> -#include <sys/param.h>
> -#endif
> -
>   #ifndef __FreeBSD__
>   int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
>                int vnet_hdr_required, int mq_required, Error **errp)
> @@ -59,11 +55,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
>           if (*ifname) {
>               snprintf(dname, sizeof dname, "/dev/%s", ifname);
>           } else {
> -#if defined(__OpenBSD__) && OpenBSD < 201605


I am not sure this sis correct. My understanding is that we still need 
to use tun for old OpenBSD release.

Thanks


> -            snprintf(dname, sizeof dname, "/dev/tun%d", i);
> -#else
>               snprintf(dname, sizeof dname, "/dev/tap%d", i);
> -#endif
>           }
>           TFR(fd = open(dname, O_RDWR));
>           if (fd >= 0) {
>


Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Brad Smith 3 years ago
It very much is correct. We don't care about such releases anymore.

On March 28, 2021 10:24:51 p.m. Jason Wang <jasowang@redhat.com> wrote:

> 在 2021/3/27 上午7:49, Brad Smith 写道:
>> OpenBSD added support for tap(4) 10 releases ago.
>>
>> Remove the special casing for older releases.
>>
>>
>> Signed-off-by: Brad Smith <brad@comstyle.com>
>>
>> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
>> index 77aaf674b1..59dfcdfae0 100644
>> --- a/net/tap-bsd.c
>> +++ b/net/tap-bsd.c
>> @@ -35,10 +35,6 @@
>> #include <net/if_tap.h>
>> #endif
>>
>> -#if defined(__OpenBSD__)
>> -#include <sys/param.h>
>> -#endif
>> -
>> #ifndef __FreeBSD__
>> int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
>>       int vnet_hdr_required, int mq_required, Error **errp)
>> @@ -59,11 +55,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
>>  if (*ifname) {
>>      snprintf(dname, sizeof dname, "/dev/%s", ifname);
>>  } else {
>> -#if defined(__OpenBSD__) && OpenBSD < 201605
>
>
> I am not sure this sis correct. My understanding is that we still need
> to use tun for old OpenBSD release.
>
> Thanks
>
>
>> -            snprintf(dname, sizeof dname, "/dev/tun%d", i);
>> -#else
>>      snprintf(dname, sizeof dname, "/dev/tap%d", i);
>> -#endif
>>  }
>>  TFR(fd = open(dname, O_RDWR));
>>  if (fd >= 0) {


Sent with Aqua Mail for Android
https://www.mobisystems.com/aqua-mail
Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Jason Wang 3 years ago
在 2021/3/29 上午11:03, Brad Smith 写道:
> It very much is correct. We don't care about such releases anymore.


So is there a doc/wiki to say Qemu doesn't support those OpenBSD release?

Thanks


>
> On March 28, 2021 10:24:51 p.m. Jason Wang <jasowang@redhat.com> wrote:
>
>> 在 2021/3/27 上午7:49, Brad Smith 写道:
>>> OpenBSD added support for tap(4) 10 releases ago.
>>>
>>> Remove the special casing for older releases.
>>>
>>>
>>> Signed-off-by: Brad Smith <brad@comstyle.com>
>>>
>>> diff --git a/net/tap-bsd.c b/net/tap-bsd.c
>>> index 77aaf674b1..59dfcdfae0 100644
>>> --- a/net/tap-bsd.c
>>> +++ b/net/tap-bsd.c
>>> @@ -35,10 +35,6 @@
>>> #include <net/if_tap.h>
>>> #endif
>>>
>>> -#if defined(__OpenBSD__)
>>> -#include <sys/param.h>
>>> -#endif
>>> -
>>> #ifndef __FreeBSD__
>>> int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
>>>        int vnet_hdr_required, int mq_required, Error **errp)
>>> @@ -59,11 +55,7 @@ int tap_open(char *ifname, int ifname_size, int 
>>> *vnet_hdr,
>>>   if (*ifname) {
>>>       snprintf(dname, sizeof dname, "/dev/%s", ifname);
>>>   } else {
>>> -#if defined(__OpenBSD__) && OpenBSD < 201605
>>
>>
>> I am not sure this sis correct. My understanding is that we still need
>> to use tun for old OpenBSD release.
>>
>> Thanks
>>
>>
>>> -            snprintf(dname, sizeof dname, "/dev/tun%d", i);
>>> -#else
>>>       snprintf(dname, sizeof dname, "/dev/tap%d", i);
>>> -#endif
>>>   }
>>>   TFR(fd = open(dname, O_RDWR));
>>>   if (fd >= 0) {
>>>
>
> Sent with Aqua Mail for Android 
> <https://play.google.com/store/apps/details?id=org.kman.AquaMail>
> https://www.mobisystems.com/aqua-mail 
> <https://www.mobisystems.com/aqua-mail>
>


Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Brad Smith 3 years ago
On 3/28/2021 11:58 PM, Jason Wang wrote:

>
> 在 2021/3/29 上午11:03, Brad Smith 写道:
>> It very much is correct. We don't care about such releases anymore.
>
>
> So is there a doc/wiki to say Qemu doesn't support those OpenBSD release?

The (OpenBSD itself and QEMU) project only makes a concerted effort to 
support
two previous releases. I can't remember where in the QEMU Wiki it is 
mentioned.

Just looking at the Meson requirement alone limits us to the previous 
two releases
never mind older. Even if that wasn't a consideration there would be 
issues with
a few other dependencies like Gtk before going back this far to support 
such old
OpenBSD releases.


Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Jason Wang 3 years ago
在 2021/3/30 上午4:38, Brad Smith 写道:
> On 3/28/2021 11:58 PM, Jason Wang wrote:
>
>>
>> 在 2021/3/29 上午11:03, Brad Smith 写道:
>>> It very much is correct. We don't care about such releases anymore.
>>
>>
>> So is there a doc/wiki to say Qemu doesn't support those OpenBSD 
>> release?
>
> The (OpenBSD itself and QEMU) project only makes a concerted effort to 
> support
> two previous releases. I can't remember where in the QEMU Wiki it is 
> mentioned.
>
> Just looking at the Meson requirement alone limits us to the previous 
> two releases
> never mind older. Even if that wasn't a consideration there would be 
> issues with
> a few other dependencies like Gtk before going back this far to 
> support such old
> OpenBSD releases.
>
>

Ok. So I've applied this patch.

Thanks


Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Brad Smith 2 years, 12 months ago
On 4/1/2021 3:24 AM, Jason Wang wrote:
>
> 在 2021/3/30 上午4:38, Brad Smith 写道:
>> On 3/28/2021 11:58 PM, Jason Wang wrote:
>>
>>>
>>> 在 2021/3/29 上午11:03, Brad Smith 写道:
>>>> It very much is correct. We don't care about such releases anymore.
>>>
>>>
>>> So is there a doc/wiki to say Qemu doesn't support those OpenBSD 
>>> release?
>>
>> The (OpenBSD itself and QEMU) project only makes a concerted effort 
>> to support
>> two previous releases. I can't remember where in the QEMU Wiki it is 
>> mentioned.
>>
>> Just looking at the Meson requirement alone limits us to the previous 
>> two releases
>> never mind older. Even if that wasn't a consideration there would be 
>> issues with
>> a few other dependencies like Gtk before going back this far to 
>> support such old
>> OpenBSD releases.
>>
>>
>
> Ok. So I've applied this patch.
>
> Thanks


I do not see where.


Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Jason Wang 2 years, 11 months ago
在 2021/5/2 下午12:10, Brad Smith 写道:
> On 4/1/2021 3:24 AM, Jason Wang wrote:
>>
>> 在 2021/3/30 上午4:38, Brad Smith 写道:
>>> On 3/28/2021 11:58 PM, Jason Wang wrote:
>>>
>>>>
>>>> 在 2021/3/29 上午11:03, Brad Smith 写道:
>>>>> It very much is correct. We don't care about such releases anymore.
>>>>
>>>>
>>>> So is there a doc/wiki to say Qemu doesn't support those OpenBSD 
>>>> release?
>>>
>>> The (OpenBSD itself and QEMU) project only makes a concerted effort 
>>> to support
>>> two previous releases. I can't remember where in the QEMU Wiki it is 
>>> mentioned.
>>>
>>> Just looking at the Meson requirement alone limits us to the 
>>> previous two releases
>>> never mind older. Even if that wasn't a consideration there would be 
>>> issues with
>>> a few other dependencies like Gtk before going back this far to 
>>> support such old
>>> OpenBSD releases.
>>>
>>>
>>
>> Ok. So I've applied this patch.
>>
>> Thanks
>
>
> I do not see where.


I don't queue it for 6.0 so it will be in the next pull request.

Thanks



Re: [PATCH] tap-bsd: Remove special casing for older OpenBSD releases
Posted by Brad Smith 2 years, 11 months ago
On 5/5/2021 10:19 PM, Jason Wang wrote:
>
> 在 2021/5/2 下午12:10, Brad Smith 写道:
>> On 4/1/2021 3:24 AM, Jason Wang wrote:
>>>
>>> 在 2021/3/30 上午4:38, Brad Smith 写道:
>>>> On 3/28/2021 11:58 PM, Jason Wang wrote:
>>>>
>>>>>
>>>>> 在 2021/3/29 上午11:03, Brad Smith 写道:
>>>>>> It very much is correct. We don't care about such releases anymore.
>>>>>
>>>>>
>>>>> So is there a doc/wiki to say Qemu doesn't support those OpenBSD 
>>>>> release?
>>>>
>>>> The (OpenBSD itself and QEMU) project only makes a concerted effort 
>>>> to support
>>>> two previous releases. I can't remember where in the QEMU Wiki it 
>>>> is mentioned.
>>>>
>>>> Just looking at the Meson requirement alone limits us to the 
>>>> previous two releases
>>>> never mind older. Even if that wasn't a consideration there would 
>>>> be issues with
>>>> a few other dependencies like Gtk before going back this far to 
>>>> support such old
>>>> OpenBSD releases.
>>>>
>>>>
>>>
>>> Ok. So I've applied this patch.
>>>
>>> Thanks
>>
>>
>> I do not see where.
>
>
> I don't queue it for 6.0 so it will be in the next pull request.
>
> Thanks


Ah, I didn't think it would be 6.0 but thought I would be able to find it
in your git repo. Anyway, thank you.