virtio-net config_size cleanups
cover virtio-net config_size cleanups
This patch set includes some minor cleanups requested by the community for the virtio-net config size solution.
[PATCH 1/2] hw/virtio-net: use existing macros to implement endof [PATCH 2/2] hw/virtio-net: fix config_size data type
PATCH 1/2 hw/virtio-net: use existing macros to implement endof
Clarify the definition of endof() by using the offsetof() and sizeof() macros to handle the pointer magic.
--- hw/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio-net.c +1 -1
@@ -81,7 +81,7 @@ typedef struct VirtIONet* 'container'. */ #define endof (container, field) \ - ((intptr_t)(&(((container *)0)->field)+1)) + (offsetof(container, field) + sizeof(((container *)0)->field)) typedef struct VirtIOFeature { uint32_t flags;
Signature · 1 line
1.7.11.7
PATCH 2/2 hw/virtio-net: fix config_size data type
In reply to Jesse LarrewSince the new config_size member of struct VirtIONet specifies a size, it should be declared as size_t.
--- hw/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio-net.c +1 -1
@@ -73,7 +73,7 @@ typedef struct VirtIONetint multiqueue;uint16_t max_queues;uint16_t curr_queues; -int config_size; +size_t config_size; } VirtIONet;/*
Signature · 1 line
1.7.11.7
Quoted 5 lines · Jesse Larrew
This patch set includes some minor cleanups requested by the community for the virtio-net config size solution.
[PATCH 1/2] hw/virtio-net: use existing macros to implement endof [PATCH 2/2] hw/virtio-net: fix
config_sizedata type
Hi Jesse,
I can't apply these patches yet because the patches they depend on haven't appeared in qemu.git/master.
Anthony: Want to merge these patches for 1.4-rc2, we can skip the trivial-patches queue?
Stefan