This simplifies code compared to having
virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
include/hw/virtio/virtio-access.h | 3 +--
include/hw/virtio/virtio.h | 12 +++++++++++-
hw/net/virtio-net.c | 2 +-
hw/virtio/vhost.c | 2 +-
hw/virtio/virtio-pci.c | 2 +-
hw/virtio/virtio.c | 16 ++++++++--------
6 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-access.h
index cd17d0c87eb..324ba907e93 100644
--- a/include/hw/virtio/virtio-access.h
+++ b/include/hw/virtio/virtio-access.h
@@ -30,8 +30,7 @@ static inline bool virtio_access_is_big_endian(VirtIODevice *vdev)
#if defined(LEGACY_VIRTIO_IS_BIENDIAN)
return virtio_is_big_endian(vdev);
#elif TARGET_BIG_ENDIAN
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
- /* Devices conforming to VIRTIO 1.0 or later are always LE. */
+ if (virtio_vdev_is_modern(vdev)) {
return false;
}
return true;
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 27cd98d2fe1..8f1e4323599 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -468,9 +468,19 @@ static inline bool virtio_host_has_feature(VirtIODevice *vdev,
return virtio_has_feature(vdev->host_features, fbit);
}
+static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
+{
+ return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
+}
+
+static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
+{
+ return !virtio_vdev_is_modern(vdev);
+}
+
static inline bool virtio_is_big_endian(VirtIODevice *vdev)
{
- if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_legacy(vdev)) {
assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN);
return vdev->device_endian == VIRTIO_DEVICE_ENDIAN_BIG;
}
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 512a7c02c93..313d3b88400 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -217,7 +217,7 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
memcpy(&netcfg, config, n->config_size);
if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR) &&
- !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) &&
+ virtio_vdev_is_legacy(vdev) &&
memcmp(netcfg.mac, n->mac, ETH_ALEN)) {
memcpy(n->mac, netcfg.mac, ETH_ALEN);
qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 52801c1796b..70a112242b0 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1168,7 +1168,7 @@ static void vhost_log_stop(MemoryListener *listener,
*/
static inline bool vhost_needs_vring_endian(VirtIODevice *vdev)
{
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_modern(vdev)) {
return false;
}
#if HOST_BIG_ENDIAN
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 1e8f90df34e..6126187a164 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1449,7 +1449,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
VirtIOPCIProxy *proxy = VIRTIO_PCI(d);
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_modern(vdev)) {
return proxy->vqs[n].enabled;
}
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 77ca54e5206..b0987e66d5b 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2279,7 +2279,7 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val)
trace_virtio_set_status(vdev, val);
int ret = 0;
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_modern(vdev)) {
if (!(vdev->status & VIRTIO_CONFIG_S_FEATURES_OK) &&
val & VIRTIO_CONFIG_S_FEATURES_OK) {
ret = virtio_validate_features(vdev);
@@ -2365,7 +2365,7 @@ void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index)
* be re-enabled for new machine types only, and also after
* being converted to LOG_GUEST_ERROR.
*
- if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_legacy(vdev)) {
error_report("queue_enable is only supported in devices of virtio "
"1.0 or later.");
}
@@ -2454,7 +2454,7 @@ void virtio_queue_set_align(VirtIODevice *vdev, int n, int align)
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
/* virtio-1 compliant devices cannot change the alignment */
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_modern(vdev)) {
error_report("tried to modify queue alignment for virtio-1 device");
return;
}
@@ -2753,7 +2753,7 @@ static bool virtio_device_endian_needed(void *opaque)
VirtIODevice *vdev = opaque;
assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN);
- if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_legacy(vdev)) {
return vdev->device_endian != virtio_default_endian();
}
/* Devices conforming to VIRTIO 1.0 or later are always LE. */
@@ -3228,7 +3228,7 @@ int virtio_set_features_ex(VirtIODevice *vdev, const uint64_t *features)
}
if (!ret) {
if (!virtio_device_started(vdev, vdev->status) &&
- !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ virtio_vdev_is_legacy(vdev)) {
vdev->start_on_kick = true;
}
}
@@ -3446,7 +3446,7 @@ virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
}
if (!virtio_device_started(vdev, vdev->status) &&
- !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ virtio_vdev_is_legacy(vdev)) {
vdev->start_on_kick = true;
}
@@ -3461,7 +3461,7 @@ virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
* to calculate used and avail ring addresses based on the desc
* address.
*/
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_modern(vdev)) {
virtio_init_region_cache(vdev, i);
} else {
virtio_queue_update_rings(vdev, i);
@@ -4019,7 +4019,7 @@ void G_GNUC_PRINTF(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...)
error_vreport(fmt, ap);
va_end(ap);
- if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
+ if (virtio_vdev_is_modern(vdev)) {
vdev->status = vdev->status | VIRTIO_CONFIG_S_NEEDS_RESET;
virtio_notify_config(vdev);
}
--
2.47.3
On 13/2/26 00:46, Pierrick Bouvier wrote:
> This simplifies code compared to having
> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> include/hw/virtio/virtio-access.h | 3 +--
> include/hw/virtio/virtio.h | 12 +++++++++++-
> hw/net/virtio-net.c | 2 +-
> hw/virtio/vhost.c | 2 +-
> hw/virtio/virtio-pci.c | 2 +-
> hw/virtio/virtio.c | 16 ++++++++--------
> 6 files changed, 23 insertions(+), 14 deletions(-)
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index 27cd98d2fe1..8f1e4323599 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -468,9 +468,19 @@ static inline bool virtio_host_has_feature(VirtIODevice *vdev,
> return virtio_has_feature(vdev->host_features, fbit);
> }
>
> +static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
> +{
> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
> +}
> +
> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
> +{
> + return !virtio_vdev_is_modern(vdev);
> +}
With retrospective, mentioning 'modern' was a mistake IMHO. But I
understand it was simpler to add 'modern' code without updating the
'legacy' code base. Today I'd rather have 'legacy' explicit in function
names, everything else being the normal / current / modern version,
without having to clarify it.
Thus back to this series I'd rather not introduce virtio_vdev_is_modern
and use !virtio_vdev_is_legacy instead.
On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
> On 13/2/26 00:46, Pierrick Bouvier wrote:
>> This simplifies code compared to having
>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>> include/hw/virtio/virtio-access.h | 3 +--
>> include/hw/virtio/virtio.h | 12 +++++++++++-
>> hw/net/virtio-net.c | 2 +-
>> hw/virtio/vhost.c | 2 +-
>> hw/virtio/virtio-pci.c | 2 +-
>> hw/virtio/virtio.c | 16 ++++++++--------
>> 6 files changed, 23 insertions(+), 14 deletions(-)
>
>
>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>> index 27cd98d2fe1..8f1e4323599 100644
>> --- a/include/hw/virtio/virtio.h
>> +++ b/include/hw/virtio/virtio.h
>> @@ -468,9 +468,19 @@ static inline bool virtio_host_has_feature(VirtIODevice *vdev,
>> return virtio_has_feature(vdev->host_features, fbit);
>> }
>>
>> +static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
>> +{
>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>> +}
>> +
>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>> +{
>> + return !virtio_vdev_is_modern(vdev);
>> +}
>
> With retrospective, mentioning 'modern' was a mistake IMHO. But I
> understand it was simpler to add 'modern' code without updating the
> 'legacy' code base. Today I'd rather have 'legacy' explicit in function
> names, everything else being the normal / current / modern version,
> without having to clarify it.
>
Agree.
> Thus back to this series I'd rather not introduce virtio_vdev_is_modern
> and use !virtio_vdev_is_legacy instead.
Sounds good. I feel it's still easier and clearer to read than
"!has_feature(1.0)". But as said in my previous answer to Zoltan, I
don't mind this patch too much, only 3rd one really matter.
On 2/18/26 2:17 PM, Pierrick Bouvier wrote:
> On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
>> On 13/2/26 00:46, Pierrick Bouvier wrote:
>>> This simplifies code compared to having
>>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>>
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>> ---
>>> include/hw/virtio/virtio-access.h | 3 +--
>>> include/hw/virtio/virtio.h | 12 +++++++++++-
>>> hw/net/virtio-net.c | 2 +-
>>> hw/virtio/vhost.c | 2 +-
>>> hw/virtio/virtio-pci.c | 2 +-
>>> hw/virtio/virtio.c | 16 ++++++++--------
>>> 6 files changed, 23 insertions(+), 14 deletions(-)
>>
>>
>>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>>> index 27cd98d2fe1..8f1e4323599 100644
>>> --- a/include/hw/virtio/virtio.h
>>> +++ b/include/hw/virtio/virtio.h
>>> @@ -468,9 +468,19 @@ static inline bool virtio_host_has_feature(VirtIODevice *vdev,
>>> return virtio_has_feature(vdev->host_features, fbit);
>>> }
>>>
>>> +static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
>>> +{
>>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>>> +}
>>> +
>>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>>> +{
>>> + return !virtio_vdev_is_modern(vdev);
>>> +}
>>
>> With retrospective, mentioning 'modern' was a mistake IMHO. But I
>> understand it was simpler to add 'modern' code without updating the
>> 'legacy' code base. Today I'd rather have 'legacy' explicit in function
>> names, everything else being the normal / current / modern version,
>> without having to clarify it.
>>
>
> Agree.
>
>> Thus back to this series I'd rather not introduce virtio_vdev_is_modern
>> and use !virtio_vdev_is_legacy instead.
>
> Sounds good. I feel it's still easier and clearer to read than
> "!has_feature(1.0)". But as said in my previous answer to Zoltan, I
> don't mind this patch too much, only 3rd one really matter.
s/!has_feature(1.0)/has_feature(1.0), thus showing I've been confused
once more :).
On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
> On 2/18/26 2:17 PM, Pierrick Bouvier wrote:
>> On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
>>> On 13/2/26 00:46, Pierrick Bouvier wrote:
>>>> This simplifies code compared to having
>>>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>>>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>>>
>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>> ---
>>>> include/hw/virtio/virtio-access.h | 3 +--
>>>> include/hw/virtio/virtio.h | 12 +++++++++++-
>>>> hw/net/virtio-net.c | 2 +-
>>>> hw/virtio/vhost.c | 2 +-
>>>> hw/virtio/virtio-pci.c | 2 +-
>>>> hw/virtio/virtio.c | 16 ++++++++--------
>>>> 6 files changed, 23 insertions(+), 14 deletions(-)
>>>
>>>
>>>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>>>> index 27cd98d2fe1..8f1e4323599 100644
>>>> --- a/include/hw/virtio/virtio.h
>>>> +++ b/include/hw/virtio/virtio.h
>>>> @@ -468,9 +468,19 @@ static inline bool
>>>> virtio_host_has_feature(VirtIODevice *vdev,
>>>> return virtio_has_feature(vdev->host_features, fbit);
>>>> }
>>>> +static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
>>>> +{
>>>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>>>> +}
>>>> +
>>>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>>>> +{
>>>> + return !virtio_vdev_is_modern(vdev);
>>>> +}
>>>
>>> With retrospective, mentioning 'modern' was a mistake IMHO. But I
>>> understand it was simpler to add 'modern' code without updating the
>>> 'legacy' code base. Today I'd rather have 'legacy' explicit in function
>>> names, everything else being the normal / current / modern version,
>>> without having to clarify it.
>>>
>>
>> Agree.
>>
>>> Thus back to this series I'd rather not introduce virtio_vdev_is_modern
>>> and use !virtio_vdev_is_legacy instead.
>>
>> Sounds good. I feel it's still easier and clearer to read than
>> "!has_feature(1.0)". But as said in my previous answer to Zoltan, I
>> don't mind this patch too much, only 3rd one really matter.
>
> s/!has_feature(1.0)/has_feature(1.0), thus showing I've been confused once
> more :).
The has_feature(1.0) is more specific though. What if 1.0 becomes legacy
too? Then modern and legacy is more confusing than testing for a specific
feature. I still think not touching this would be the easiest as the
introduced legacy/modern does not seem to make it much clearer.
Regards,
BALATON Zoltan
On 2/18/26 2:28 PM, BALATON Zoltan wrote:
> On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
>> On 2/18/26 2:17 PM, Pierrick Bouvier wrote:
>>> On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
>>>> On 13/2/26 00:46, Pierrick Bouvier wrote:
>>>>> This simplifies code compared to having
>>>>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>>>>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>>>>
>>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>>> ---
>>>>> include/hw/virtio/virtio-access.h | 3 +--
>>>>> include/hw/virtio/virtio.h | 12 +++++++++++-
>>>>> hw/net/virtio-net.c | 2 +-
>>>>> hw/virtio/vhost.c | 2 +-
>>>>> hw/virtio/virtio-pci.c | 2 +-
>>>>> hw/virtio/virtio.c | 16 ++++++++--------
>>>>> 6 files changed, 23 insertions(+), 14 deletions(-)
>>>>
>>>>
>>>>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>>>>> index 27cd98d2fe1..8f1e4323599 100644
>>>>> --- a/include/hw/virtio/virtio.h
>>>>> +++ b/include/hw/virtio/virtio.h
>>>>> @@ -468,9 +468,19 @@ static inline bool
>>>>> virtio_host_has_feature(VirtIODevice *vdev,
>>>>> return virtio_has_feature(vdev->host_features, fbit);
>>>>> }
>>>>> +static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
>>>>> +{
>>>>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>>>>> +}
>>>>> +
>>>>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>>>>> +{
>>>>> + return !virtio_vdev_is_modern(vdev);
>>>>> +}
>>>>
>>>> With retrospective, mentioning 'modern' was a mistake IMHO. But I
>>>> understand it was simpler to add 'modern' code without updating the
>>>> 'legacy' code base. Today I'd rather have 'legacy' explicit in function
>>>> names, everything else being the normal / current / modern version,
>>>> without having to clarify it.
>>>>
>>>
>>> Agree.
>>>
>>>> Thus back to this series I'd rather not introduce virtio_vdev_is_modern
>>>> and use !virtio_vdev_is_legacy instead.
>>>
>>> Sounds good. I feel it's still easier and clearer to read than
>>> "!has_feature(1.0)". But as said in my previous answer to Zoltan, I
>>> don't mind this patch too much, only 3rd one really matter.
>>
>> s/!has_feature(1.0)/has_feature(1.0), thus showing I've been confused once
>> more :).
>
> The has_feature(1.0) is more specific though. What if 1.0 becomes legacy
> too? Then modern and legacy is more confusing than testing for a specific
> feature. I still think not touching this would be the easiest as the
> introduced legacy/modern does not seem to make it much clearer.
>
As you can find in official Virtio spec, "legacy" is not a random name
or something I personally chose, it's the official term for pre 1.0
devices/interfaces.
https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html#x1-60001
```
1.3.1 Legacy Interface: Terminology
Legacy Interface
is an interface specified by an earlier draft of this specification
(before 1.0)
Legacy Device
is a device implemented before this specification was released, and
implementing a legacy interface on the host side
```
So even if VirtIO 2.0 comes out one day, they will have to define or
change term accordingly.
Your comments are welcome also on patch 3 by the way.
> Regards,
> BALATON Zoltan
On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
> On 2/18/26 2:28 PM, BALATON Zoltan wrote:
>> On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
>>> On 2/18/26 2:17 PM, Pierrick Bouvier wrote:
>>>> On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
>>>>> On 13/2/26 00:46, Pierrick Bouvier wrote:
>>>>>> This simplifies code compared to having
>>>>>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>>>>>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>>>>>
>>>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>>>> ---
>>>>>> include/hw/virtio/virtio-access.h | 3 +--
>>>>>> include/hw/virtio/virtio.h | 12 +++++++++++-
>>>>>> hw/net/virtio-net.c | 2 +-
>>>>>> hw/virtio/vhost.c | 2 +-
>>>>>> hw/virtio/virtio-pci.c | 2 +-
>>>>>> hw/virtio/virtio.c | 16 ++++++++--------
>>>>>> 6 files changed, 23 insertions(+), 14 deletions(-)
>>>>>
>>>>>
>>>>>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>>>>>> index 27cd98d2fe1..8f1e4323599 100644
>>>>>> --- a/include/hw/virtio/virtio.h
>>>>>> +++ b/include/hw/virtio/virtio.h
>>>>>> @@ -468,9 +468,19 @@ static inline bool
>>>>>> virtio_host_has_feature(VirtIODevice *vdev,
>>>>>> return virtio_has_feature(vdev->host_features, fbit);
>>>>>> }
>>>>>> +static inline bool virtio_vdev_is_modern(const VirtIODevice
>>>>>> *vdev)
>>>>>> +{
>>>>>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>>>>>> +}
>>>>>> +
>>>>>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>>>>>> +{
>>>>>> + return !virtio_vdev_is_modern(vdev);
>>>>>> +}
>>>>>
>>>>> With retrospective, mentioning 'modern' was a mistake IMHO. But I
>>>>> understand it was simpler to add 'modern' code without updating the
>>>>> 'legacy' code base. Today I'd rather have 'legacy' explicit in function
>>>>> names, everything else being the normal / current / modern version,
>>>>> without having to clarify it.
>>>>>
>>>>
>>>> Agree.
>>>>
>>>>> Thus back to this series I'd rather not introduce virtio_vdev_is_modern
>>>>> and use !virtio_vdev_is_legacy instead.
>>>>
>>>> Sounds good. I feel it's still easier and clearer to read than
>>>> "!has_feature(1.0)". But as said in my previous answer to Zoltan, I
>>>> don't mind this patch too much, only 3rd one really matter.
>>>
>>> s/!has_feature(1.0)/has_feature(1.0), thus showing I've been confused once
>>> more :).
>>
>> The has_feature(1.0) is more specific though. What if 1.0 becomes legacy
>> too? Then modern and legacy is more confusing than testing for a specific
>> feature. I still think not touching this would be the easiest as the
>> introduced legacy/modern does not seem to make it much clearer.
>>
>
> As you can find in official Virtio spec, "legacy" is not a random name or
> something I personally chose, it's the official term for pre 1.0
> devices/interfaces.
>
> https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html#x1-60001
>
> ```
> 1.3.1 Legacy Interface: Terminology
>
> Legacy Interface
> is an interface specified by an earlier draft of this specification (before
> 1.0)
>
> Legacy Device
> is a device implemented before this specification was released, and
> implementing a legacy interface on the host side
> ```
>
> So even if VirtIO 2.0 comes out one day, they will have to define or change
> term accordingly.
OK in that case it's better but modern would still be ambiguous. But as I
said I think current test for feature is OK in my opinion. That's all I
can add to this.
> Your comments are welcome also on patch 3 by the way.
Sorry I can't comment on that as I don't know this code. I also don't use
virtio with PPC machines but I know some people use it so they'll probably
complain if this broke something.
But maybe everybody uses current virtio now and the old one is only there
for compatibility. Is this maybe referenced from hw/core/machine.c in a
compatibility property that could be removed or is it user settable and
still supported? There was another thread on these compatibility
properties and adding a way to mark and deprecate compatibility properties
for easier removal but that did not end yet. You'd probably just want to
make this series do the least changes needed and then move on.
Regards,
BALATON Zoltan
On 2/18/26 3:46 PM, BALATON Zoltan wrote:
> On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
>> On 2/18/26 2:28 PM, BALATON Zoltan wrote:
>>> On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
>>>> On 2/18/26 2:17 PM, Pierrick Bouvier wrote:
>>>>> On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
>>>>>> On 13/2/26 00:46, Pierrick Bouvier wrote:
>>>>>>> This simplifies code compared to having
>>>>>>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>>>>>>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>>>>>>
>>>>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>>>>> ---
>>>>>>> include/hw/virtio/virtio-access.h | 3 +--
>>>>>>> include/hw/virtio/virtio.h | 12 +++++++++++-
>>>>>>> hw/net/virtio-net.c | 2 +-
>>>>>>> hw/virtio/vhost.c | 2 +-
>>>>>>> hw/virtio/virtio-pci.c | 2 +-
>>>>>>> hw/virtio/virtio.c | 16 ++++++++--------
>>>>>>> 6 files changed, 23 insertions(+), 14 deletions(-)
>>>>>>
>>>>>>
>>>>>>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>>>>>>> index 27cd98d2fe1..8f1e4323599 100644
>>>>>>> --- a/include/hw/virtio/virtio.h
>>>>>>> +++ b/include/hw/virtio/virtio.h
>>>>>>> @@ -468,9 +468,19 @@ static inline bool
>>>>>>> virtio_host_has_feature(VirtIODevice *vdev,
>>>>>>> return virtio_has_feature(vdev->host_features, fbit);
>>>>>>> }
>>>>>>> +static inline bool virtio_vdev_is_modern(const VirtIODevice
>>>>>>> *vdev)
>>>>>>> +{
>>>>>>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>>>>>>> +}
>>>>>>> +
>>>>>>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>>>>>>> +{
>>>>>>> + return !virtio_vdev_is_modern(vdev);
>>>>>>> +}
>>>>>>
>>>>>> With retrospective, mentioning 'modern' was a mistake IMHO. But I
>>>>>> understand it was simpler to add 'modern' code without updating the
>>>>>> 'legacy' code base. Today I'd rather have 'legacy' explicit in function
>>>>>> names, everything else being the normal / current / modern version,
>>>>>> without having to clarify it.
>>>>>>
>>>>>
>>>>> Agree.
>>>>>
>>>>>> Thus back to this series I'd rather not introduce virtio_vdev_is_modern
>>>>>> and use !virtio_vdev_is_legacy instead.
>>>>>
>>>>> Sounds good. I feel it's still easier and clearer to read than
>>>>> "!has_feature(1.0)". But as said in my previous answer to Zoltan, I
>>>>> don't mind this patch too much, only 3rd one really matter.
>>>>
>>>> s/!has_feature(1.0)/has_feature(1.0), thus showing I've been confused once
>>>> more :).
>>>
>>> The has_feature(1.0) is more specific though. What if 1.0 becomes legacy
>>> too? Then modern and legacy is more confusing than testing for a specific
>>> feature. I still think not touching this would be the easiest as the
>>> introduced legacy/modern does not seem to make it much clearer.
>>>
>>
>> As you can find in official Virtio spec, "legacy" is not a random name or
>> something I personally chose, it's the official term for pre 1.0
>> devices/interfaces.
>>
>> https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html#x1-60001
>>
>> ```
>> 1.3.1 Legacy Interface: Terminology
>>
>> Legacy Interface
>> is an interface specified by an earlier draft of this specification (before
>> 1.0)
>>
>> Legacy Device
>> is a device implemented before this specification was released, and
>> implementing a legacy interface on the host side
>> ```
>>
>> So even if VirtIO 2.0 comes out one day, they will have to define or change
>> term accordingly.
>
> OK in that case it's better but modern would still be ambiguous. But as I
> said I think current test for feature is OK in my opinion. That's all I
> can add to this.
>
>> Your comments are welcome also on patch 3 by the way.
>
> Sorry I can't comment on that as I don't know this code. I also don't use
> virtio with PPC machines but I know some people use it so they'll probably
> complain if this broke something.
>
I did my fair share of tests, including reproducing a ppc64el
environment to make sure migration was not broken. I hope someone
comfortable with this can give a reviewed-by and that Michael will
happily pick the patch.
> But maybe everybody uses current virtio now and the old one is only there
> for compatibility. Is this maybe referenced from hw/core/machine.c in a
> compatibility property that could be removed or is it user settable and
> still supported? There was another thread on these compatibility
> properties and adding a way to mark and deprecate compatibility properties
> for easier removal but that did not end yet. You'd probably just want to
> make this series do the least changes needed and then move on.
>
Philippe went down this way, trying to remove legacy support completely,
but the community answered it had to stay and could not be
deprecated/removed. This position might change in the future, but we
need to find a solution now to remove target specifics, thus the current
solution.
> Regards,
> BALATON Zoltan
Thanks,
Pierrick
On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
> On 2/18/26 3:46 PM, BALATON Zoltan wrote:
>> On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
>>> On 2/18/26 2:28 PM, BALATON Zoltan wrote:
>>>> On Wed, 18 Feb 2026, Pierrick Bouvier wrote:
>>>>> On 2/18/26 2:17 PM, Pierrick Bouvier wrote:
>>>>>> On 2/18/26 1:00 PM, Philippe Mathieu-Daudé wrote:
>>>>>>> On 13/2/26 00:46, Pierrick Bouvier wrote:
>>>>>>>> This simplifies code compared to having
>>>>>>>> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
>>>>>>>> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>>>>>>>>
>>>>>>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>>>>>>> ---
>>>>>>>> include/hw/virtio/virtio-access.h | 3 +--
>>>>>>>> include/hw/virtio/virtio.h | 12 +++++++++++-
>>>>>>>> hw/net/virtio-net.c | 2 +-
>>>>>>>> hw/virtio/vhost.c | 2 +-
>>>>>>>> hw/virtio/virtio-pci.c | 2 +-
>>>>>>>> hw/virtio/virtio.c | 16 ++++++++--------
>>>>>>>> 6 files changed, 23 insertions(+), 14 deletions(-)
>>>>>>>
>>>>>>>
>>>>>>>> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
>>>>>>>> index 27cd98d2fe1..8f1e4323599 100644
>>>>>>>> --- a/include/hw/virtio/virtio.h
>>>>>>>> +++ b/include/hw/virtio/virtio.h
>>>>>>>> @@ -468,9 +468,19 @@ static inline bool
>>>>>>>> virtio_host_has_feature(VirtIODevice *vdev,
>>>>>>>> return virtio_has_feature(vdev->host_features, fbit);
>>>>>>>> }
>>>>>>>> +static inline bool virtio_vdev_is_modern(const VirtIODevice
>>>>>>>> *vdev)
>>>>>>>> +{
>>>>>>>> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
>>>>>>>> +}
>>>>>>>> +
>>>>>>>> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
>>>>>>>> +{
>>>>>>>> + return !virtio_vdev_is_modern(vdev);
>>>>>>>> +}
>>>>>>>
>>>>>>> With retrospective, mentioning 'modern' was a mistake IMHO. But I
>>>>>>> understand it was simpler to add 'modern' code without updating the
>>>>>>> 'legacy' code base. Today I'd rather have 'legacy' explicit in
>>>>>>> function
>>>>>>> names, everything else being the normal / current / modern version,
>>>>>>> without having to clarify it.
>>>>>>>
>>>>>>
>>>>>> Agree.
>>>>>>
>>>>>>> Thus back to this series I'd rather not introduce
>>>>>>> virtio_vdev_is_modern
>>>>>>> and use !virtio_vdev_is_legacy instead.
>>>>>>
>>>>>> Sounds good. I feel it's still easier and clearer to read than
>>>>>> "!has_feature(1.0)". But as said in my previous answer to Zoltan, I
>>>>>> don't mind this patch too much, only 3rd one really matter.
>>>>>
>>>>> s/!has_feature(1.0)/has_feature(1.0), thus showing I've been confused
>>>>> once
>>>>> more :).
>>>>
>>>> The has_feature(1.0) is more specific though. What if 1.0 becomes legacy
>>>> too? Then modern and legacy is more confusing than testing for a specific
>>>> feature. I still think not touching this would be the easiest as the
>>>> introduced legacy/modern does not seem to make it much clearer.
>>>>
>>>
>>> As you can find in official Virtio spec, "legacy" is not a random name or
>>> something I personally chose, it's the official term for pre 1.0
>>> devices/interfaces.
>>>
>>> https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html#x1-60001
>>>
>>> ```
>>> 1.3.1 Legacy Interface: Terminology
>>>
>>> Legacy Interface
>>> is an interface specified by an earlier draft of this specification
>>> (before
>>> 1.0)
>>>
>>> Legacy Device
>>> is a device implemented before this specification was released, and
>>> implementing a legacy interface on the host side
>>> ```
>>>
>>> So even if VirtIO 2.0 comes out one day, they will have to define or
>>> change
>>> term accordingly.
>>
>> OK in that case it's better but modern would still be ambiguous. But as I
>> said I think current test for feature is OK in my opinion. That's all I
>> can add to this.
>>
>>> Your comments are welcome also on patch 3 by the way.
>>
>> Sorry I can't comment on that as I don't know this code. I also don't use
>> virtio with PPC machines but I know some people use it so they'll probably
>> complain if this broke something.
>>
>
> I did my fair share of tests, including reproducing a ppc64el environment to
> make sure migration was not broken. I hope someone comfortable with this can
> give a reviewed-by and that Michael will happily pick the patch.
>
>> But maybe everybody uses current virtio now and the old one is only there
>> for compatibility. Is this maybe referenced from hw/core/machine.c in a
>> compatibility property that could be removed or is it user settable and
>> still supported? There was another thread on these compatibility
>> properties and adding a way to mark and deprecate compatibility properties
>> for easier removal but that did not end yet. You'd probably just want to
>> make this series do the least changes needed and then move on.
>>
>
> Philippe went down this way, trying to remove legacy support completely, but
> the community answered it had to stay and could not be deprecated/removed.
> This position might change in the future, but we need to find a solution now
> to remove target specifics, thus the current solution.
I don't know if that's related but in hw/core/machine.c:
GlobalProperty hw_compat_5_0[] = {
...
{ "virtio-device", "x-disable-legacy-check", "true" },
};
And the oldest visible machine is now 5.1 with everything older than 8.0
deprecated due to auto deprecation. But we're behind with removing older
code which is now at 2.8 so maybe we're deprecating things faster than we
can remove and clean up old code so that may cause users problems before
the code can benefit from it. Maybe we could slow down with auto
deprecation until removal of old machine is catching up?
Regards,
BALATON Zoltan
On Thu, 12 Feb 2026, Pierrick Bouvier wrote:
> This simplifies code compared to having
> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or
> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1).
>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> include/hw/virtio/virtio-access.h | 3 +--
> include/hw/virtio/virtio.h | 12 +++++++++++-
> hw/net/virtio-net.c | 2 +-
> hw/virtio/vhost.c | 2 +-
> hw/virtio/virtio-pci.c | 2 +-
> hw/virtio/virtio.c | 16 ++++++++--------
> 6 files changed, 23 insertions(+), 14 deletions(-)
It's longer than before with two more functions to look up when reading
the code to understand it so I would not say it's simpler. Maybe more
readable for some but I don't think it adds much more clarity and so patch
could just be dropped. But I don't care so if others don't mind or think
it's better then I don't mind.
Regards,
BALATON Zoltan
> diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-access.h
> index cd17d0c87eb..324ba907e93 100644
> --- a/include/hw/virtio/virtio-access.h
> +++ b/include/hw/virtio/virtio-access.h
> @@ -30,8 +30,7 @@ static inline bool virtio_access_is_big_endian(VirtIODevice *vdev)
> #if defined(LEGACY_VIRTIO_IS_BIENDIAN)
> return virtio_is_big_endian(vdev);
> #elif TARGET_BIG_ENDIAN
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> - /* Devices conforming to VIRTIO 1.0 or later are always LE. */
> + if (virtio_vdev_is_modern(vdev)) {
> return false;
> }
> return true;
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index 27cd98d2fe1..8f1e4323599 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -468,9 +468,19 @@ static inline bool virtio_host_has_feature(VirtIODevice *vdev,
> return virtio_has_feature(vdev->host_features, fbit);
> }
>
> +static inline bool virtio_vdev_is_modern(const VirtIODevice *vdev)
> +{
> + return virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1);
> +}
> +
> +static inline bool virtio_vdev_is_legacy(const VirtIODevice *vdev)
> +{
> + return !virtio_vdev_is_modern(vdev);
> +}
> +
> static inline bool virtio_is_big_endian(VirtIODevice *vdev)
> {
> - if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_legacy(vdev)) {
> assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN);
> return vdev->device_endian == VIRTIO_DEVICE_ENDIAN_BIG;
> }
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 512a7c02c93..313d3b88400 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -217,7 +217,7 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
> memcpy(&netcfg, config, n->config_size);
>
> if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR) &&
> - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) &&
> + virtio_vdev_is_legacy(vdev) &&
> memcmp(netcfg.mac, n->mac, ETH_ALEN)) {
> memcpy(n->mac, netcfg.mac, ETH_ALEN);
> qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 52801c1796b..70a112242b0 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -1168,7 +1168,7 @@ static void vhost_log_stop(MemoryListener *listener,
> */
> static inline bool vhost_needs_vring_endian(VirtIODevice *vdev)
> {
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_modern(vdev)) {
> return false;
> }
> #if HOST_BIG_ENDIAN
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 1e8f90df34e..6126187a164 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1449,7 +1449,7 @@ static bool virtio_pci_queue_enabled(DeviceState *d, int n)
> VirtIOPCIProxy *proxy = VIRTIO_PCI(d);
> VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
>
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_modern(vdev)) {
> return proxy->vqs[n].enabled;
> }
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 77ca54e5206..b0987e66d5b 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -2279,7 +2279,7 @@ int virtio_set_status(VirtIODevice *vdev, uint8_t val)
> trace_virtio_set_status(vdev, val);
> int ret = 0;
>
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_modern(vdev)) {
> if (!(vdev->status & VIRTIO_CONFIG_S_FEATURES_OK) &&
> val & VIRTIO_CONFIG_S_FEATURES_OK) {
> ret = virtio_validate_features(vdev);
> @@ -2365,7 +2365,7 @@ void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index)
> * be re-enabled for new machine types only, and also after
> * being converted to LOG_GUEST_ERROR.
> *
> - if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_legacy(vdev)) {
> error_report("queue_enable is only supported in devices of virtio "
> "1.0 or later.");
> }
> @@ -2454,7 +2454,7 @@ void virtio_queue_set_align(VirtIODevice *vdev, int n, int align)
> VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
>
> /* virtio-1 compliant devices cannot change the alignment */
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_modern(vdev)) {
> error_report("tried to modify queue alignment for virtio-1 device");
> return;
> }
> @@ -2753,7 +2753,7 @@ static bool virtio_device_endian_needed(void *opaque)
> VirtIODevice *vdev = opaque;
>
> assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN);
> - if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_legacy(vdev)) {
> return vdev->device_endian != virtio_default_endian();
> }
> /* Devices conforming to VIRTIO 1.0 or later are always LE. */
> @@ -3228,7 +3228,7 @@ int virtio_set_features_ex(VirtIODevice *vdev, const uint64_t *features)
> }
> if (!ret) {
> if (!virtio_device_started(vdev, vdev->status) &&
> - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + virtio_vdev_is_legacy(vdev)) {
> vdev->start_on_kick = true;
> }
> }
> @@ -3446,7 +3446,7 @@ virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
> }
>
> if (!virtio_device_started(vdev, vdev->status) &&
> - !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + virtio_vdev_is_legacy(vdev)) {
> vdev->start_on_kick = true;
> }
>
> @@ -3461,7 +3461,7 @@ virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
> * to calculate used and avail ring addresses based on the desc
> * address.
> */
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_modern(vdev)) {
> virtio_init_region_cache(vdev, i);
> } else {
> virtio_queue_update_rings(vdev, i);
> @@ -4019,7 +4019,7 @@ void G_GNUC_PRINTF(2, 3) virtio_error(VirtIODevice *vdev, const char *fmt, ...)
> error_vreport(fmt, ap);
> va_end(ap);
>
> - if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) {
> + if (virtio_vdev_is_modern(vdev)) {
> vdev->status = vdev->status | VIRTIO_CONFIG_S_NEEDS_RESET;
> virtio_notify_config(vdev);
> }
>
Hi Zoltan, On 2/12/26 5:19 PM, BALATON Zoltan wrote: > On Thu, 12 Feb 2026, Pierrick Bouvier wrote: >> This simplifies code compared to having >> virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) or >> !virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1). >> >> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> >> --- >> include/hw/virtio/virtio-access.h | 3 +-- >> include/hw/virtio/virtio.h | 12 +++++++++++- >> hw/net/virtio-net.c | 2 +- >> hw/virtio/vhost.c | 2 +- >> hw/virtio/virtio-pci.c | 2 +- >> hw/virtio/virtio.c | 16 ++++++++-------- >> 6 files changed, 23 insertions(+), 14 deletions(-) > > It's longer than before with two more functions to look up when reading > the code to understand it so I would not say it's simpler. Maybe more > readable for some but I don't think it adds much more clarity and so patch > could just be dropped. But I don't care so if others don't mind or think > it's better then I don't mind. > patches 1-2 helped me to reach patch 3 conclusion, which is the only one that really matters in the end. Hopefully it will help reviewers to reach the same conclusion. If you and others are ok with it, we can just replace virtio_access_is_big_endian with virtio_is_big_endian and call it a day (even though I still think this is confusing regarding cpu ops having the same name). > Regards, > BALATON Zoltan > Thanks, Pierrick
© 2016 - 2026 Red Hat, Inc.