qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 10/15] virtio: move conf fields into an anonymous


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH v2 10/15] virtio: move conf fields into an anonymous union
Date: Mon, 2 Jan 2012 18:59:21 +0100

Signed-off-by: Paolo Bonzini <address@hidden>
---
 hw/s390-virtio-bus.h |    8 +++++---
 hw/virtio-pci.h      |   10 ++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h
index 414fd22..b9f711d 100644
--- a/hw/s390-virtio-bus.h
+++ b/hw/s390-virtio-bus.h
@@ -42,10 +42,12 @@ typedef struct VirtIOS390Device {
     ram_addr_t feat_offs;
     uint8_t feat_len;
     VirtIODevice *vdev;
-    VirtIOBlkConf blk;
     uint32_t host_features;
-    virtio_serial_conf serial;
-    virtio_net_conf net;
+    union {
+        VirtIOBlkConf blk;
+        virtio_serial_conf serial;
+        virtio_net_conf net;
+    };
 } VirtIOS390Device;
 
 typedef struct VirtIOS390Bus {
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index a10df5a..0a9034a 100644
--- a/hw/virtio-pci.h
+++ b/hw/virtio-pci.h
@@ -33,13 +33,15 @@ typedef struct {
     uint32_t flags;
     uint32_t class_code;
     uint32_t nvectors;
-    VirtIOBlkConf blk;
     uint32_t host_features;
+    union {
+        VirtIOBlkConf blk;
 #ifdef CONFIG_VIRTFS
-    V9fsConf fsconf;
+        V9fsConf fsconf;
 #endif
-    virtio_serial_conf serial;
-    virtio_net_conf net;
+        virtio_serial_conf serial;
+        virtio_net_conf net;
+    };
     bool ioeventfd_disabled;
     bool ioeventfd_started;
 } VirtIOPCIProxy;
-- 
1.7.7.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]