Comments
Patch
@@ -75,18 +75,6 @@ typedef struct VirtIONet
uint16_t curr_queues;
} VirtIONet;
-/*
- * Calculate the number of bytes up to and including the given 'field' of
- * 'container'.
- */
-#define endof(container, field) \
- (offsetof(container, field) + sizeof(((container *)0)->field))
-
-typedef struct VirtIOFeature {
- uint32_t flags;
- size_t end;
-} VirtIOFeature;
-
static VirtIOFeature feature_sizes[] = {
{.flags = 1 << VIRTIO_NET_F_MAC,
.end = endof(struct virtio_net_config, mac)},
@@ -67,6 +67,18 @@
/* This means don't interrupt guest when buffer consumed. */
#define VRING_AVAIL_F_NO_INTERRUPT 1
+/*
+ * Calculate the number of bytes up to and including the given 'field' of
+ * 'container'.
+ */
+#define endof(container, field) \
+ (offsetof(container, field) + sizeof(((container *)0)->field))
+
+typedef struct VirtIOFeature {
+ uint32_t flags;
+ size_t end;
+} VirtIOFeature;
+
struct VirtQueue;
static inline hwaddr vring_align(hwaddr addr,
Move the definition of struct VirtIOFeature from virtio-net.c to virtio.h so other virtio devices can benefit. Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com> --- hw/virtio-net.c | 12 ------------ hw/virtio.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-)