From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NsCIY-0005KU-RQ for qemu-devel@nongnu.org; Thu, 18 Mar 2010 05:45:50 -0400 Received: from [199.232.76.173] (port=59688 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsCIY-0005K4-D6 for qemu-devel@nongnu.org; Thu, 18 Mar 2010 05:45:50 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NsCIX-00035x-8A for qemu-devel@nongnu.org; Thu, 18 Mar 2010 05:45:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50762) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NsCIW-00035t-Sf for qemu-devel@nongnu.org; Thu, 18 Mar 2010 05:45:49 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2I9jlRq014918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 18 Mar 2010 05:45:48 -0400 Date: Thu, 18 Mar 2010 11:42:22 +0200 From: "Michael S. Tsirkin" Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCHv2 0/5] virtio: cleanup layout assumptions List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com, qemu-devel@nongnu.org This patchset helps remove the assumption that vdev must be the 1st member in any virtio device implementation. Other assumptions (made by qdev) can be removed in a similar way separately, this patchset does not do this yet. We also make it obvious that all of device structure is zero initialized, which devices seem to rely on, by virtue of calling mallocz directly in device code. Note how code is simplified rather than made more complex. Changes from v1: Get rid of VIRTIO_COMMON_INIT macro: simple function call, no magic now. Michael S. Tsirkin (5): virtio: add type safe API virtio-net: remove layout assumptions virtio-serial: remove struct layout assumptions virtio-balloon: remove layout assumptions virtio-blk: remove layout assumption hw/virtio-balloon.c | 10 ++++------ hw/virtio-blk.c | 9 ++++----- hw/virtio-net.c | 11 +++++------ hw/virtio-serial-bus.c | 17 ++++++++--------- hw/virtio.c | 7 +++---- hw/virtio.h | 5 +++-- 6 files changed, 27 insertions(+), 32 deletions(-)