qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com
Subject: [Qemu-devel] [PATCH 9/9] virtio: move conf fields into an anonymous union
Date: Thu, 24 Nov 2011 13:38:28 +0100	[thread overview]
Message-ID: <1322138308-31040-10-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1322138308-31040-1-git-send-email-pbonzini@redhat.com>

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(-)

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/syborg_virtio.c b/hw/syborg_virtio.c
index a1dc5ff..0971a85 100644
--- a/hw/syborg_virtio.c
+++ b/hw/syborg_virtio.c
@@ -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)
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index 63d83ae..e05af31 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_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;
-- 
1.7.7.1

  parent reply	other threads:[~2011-11-24 12:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 12:38 [Qemu-devel] [PATCH 0/9] virtio: device configuration cleanup Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 1/9] virtio-net: move property declarations to header file Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 2/9] virtio-net: move NICConf into virtio_net_conf Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 3/9] virtio-serial: move property declarations to header file Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 4/9] virtio-9p: remove PCI dependencies from hw/9pfs/ Paolo Bonzini
2011-11-28 17:18   ` Aneesh Kumar K.V
2011-11-28 18:46   ` Michael S. Tsirkin
2011-11-29  8:38     ` Paolo Bonzini
2011-11-29 13:12       ` Michael S. Tsirkin
2012-01-01 21:45         ` Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 5/9] virtio-9p: move property declarations to header file Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 6/9] virtio-blk: define VirtIOBlkConf Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 7/9] virtio-blk: move property declarations to header file Paolo Bonzini
2011-11-24 12:38 ` [Qemu-devel] [PATCH 8/9] virtio-blk: move BlockConf into VirtIOBlkConf Paolo Bonzini
2011-11-24 12:38 ` Paolo Bonzini [this message]
2011-11-28 18:51 ` [Qemu-devel] [PATCH 0/9] virtio: device configuration cleanup Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322138308-31040-10-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).