On 02.08.2025 17:21, Michael Tokarev wrote:
This field is a fixed-size buffer (number of elements is MAX_VLAN,
known at build time).  There's no need to allocate it dynamically,
it can be made an integral part of VirtIONet structure.

This field is the only user of VMSTATE_BUFFER_POINTER_UNSAFE() macro.

Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
---
  hw/net/virtio-net.c            | 8 +++-----
  include/hw/virtio/virtio-net.h | 2 +-
  2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
@@ -3524,7 +3524,7 @@ static const VMStateDescription vmstate_virtio_net_device 
= {
           * buffer; hold onto your endiannesses; it's actually used as a bitmap
           * but based on the uint.
           */
-        VMSTATE_BUFFER_POINTER_UNSAFE(vlans, VirtIONet, 0, MAX_VLAN >> 3),
+        VMSTATE_BUFFER(vlans, VirtIONet),

This doesn't compile.  And I can't figure out, so far, what's needed
here :)

/mjt

Reply via email to