From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTYa8-0007K8-2B for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:39:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTYa0-0003Uo-K0 for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:39:11 -0500 Received: from mail-gx0-f173.google.com ([209.85.161.173]:56311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTYa0-0003Ui-HI for qemu-devel@nongnu.org; Thu, 24 Nov 2011 07:39:04 -0500 Received: by ggnb1 with SMTP id b1so2913663ggn.4 for ; Thu, 24 Nov 2011 04:39:04 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 24 Nov 2011 13:38:28 +0100 Message-Id: <1322138308-31040-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1322138308-31040-1-git-send-email-pbonzini@redhat.com> References: <1322138308-31040-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 9/9] virtio: move conf fields into an anonymous union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com The devices should not need to share any space from the conf fields Signed-off-by: Paolo Bonzini --- 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