Alex Williamson wrote:
virtio-net: Name the status bits, adding promisc and allmulti

Signed-off-by: Alex Williamson <[email protected]>
---

 hw/virtio-net.c |   36 ++++++++++++++++++++++++------------
 hw/virtio-net.h |   11 ++++++++++-
 2 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 77e3077..653cad4 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -22,7 +22,14 @@ typedef struct VirtIONet
 {
     VirtIODevice vdev;
     uint8_t mac[6];
-    uint16_t status;
+    union {
+        uint16_t raw;
+        struct {
+            uint16_t link:1;
+            uint16_t promisc:1;
+            uint16_t allmulti:1;
+        } bits;
+    } status;

I'd prefer the use of #define's like we have today. bit fields have really weird packing and ordering properties across architectures.

Regards,

Anthony Liguori

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to