@@ -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 {
@@ -66,7 +66,9 @@ typedef struct {
uint32_t int_enable;
uint32_t id;
uint32_t host_features;
- virtio_net_conf net;
+ union {
+ virtio_net_conf net;
+ };
} SyborgVirtIOProxy;
static uint32_t syborg_virtio_readl(void *opaque, target_phys_addr_t offset)
@@ -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_LINUX
- 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;
The devices should not need to share any space from the conf fields Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- hw/s390-virtio-bus.h | 8 +++++--- hw/syborg_virtio.c | 4 +++- hw/virtio-pci.h | 10 ++++++---- 3 files changed, 14 insertions(+), 8 deletions(-)