Received: from eggs.gnu.org ([2001:4830:134:3::10]:47149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4iSk-0003Pn-5Z for qemu-devel@nongnu.org; Wed, 31 Jul 2013 22:18:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4iSd-0006Ga-RY for qemu-devel@nongnu.org; Wed, 31 Jul 2013 22:17:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60953 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4iSd-0006FX-J6 for qemu-devel@nongnu.org; Wed, 31 Jul 2013 22:17:51 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 1 Aug 2013 04:17:21 +0200 Message-Id: <1375323463-32747-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-next v2 00/22] QOM realize for virtio List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , "Michael S. Tsirkin" , Alexey Kardashevskiy , Hu Tao , Jesse Larrew , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Anthony Liguori , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Frederic Konrad Hello, This series converts virtio devices to QOM realize/unrealize. It is intended as base for fixing virtio-net initialization order issues, as reported by Jesse. Only partially tested though. Note that while VirtioDevice was setting a DeviceClass::exit callback for cleaning up the bus name, this was overwritten by most derived classe= s. That is fixed as part of this conversion. Similarly, virtio_scsi_common_{init,exit} can be moved to VirtIOSCSICommo= n now. This has the side-effect that the two SCSI subclasses now perform some initializations after the common SCSI implementation has invoked virtio_bus_plug_device(). Paolo, waiting on your review; deferred to last patch so we can easily dr= op it. v2 avoids adding class structs to store parent_* fields by introducing an OBJECT_GET_PARENT_CLASS() macro inspired by Peter C. It does the conversi= on in multiple steps based on an approach by Herv=C3=A9 and tries to separat= e out refactorings as requested by mst. Available from: https://github.com/afaerber/qemu-cpu/commits/realize-virtio.v2 git://github.com/afaerber/qemu-cpu.git realize-virtio.v2 Regards, Andreas v1 -> v2: * Prepended patch introducing OBJECT_GET_PARENT_CLASS() macro (Peter C.). * Prepended patch allowing empty VirtioDevice::init (Herv=C3=A9). * Split VirtioDevice QOM realize conversion per device (mst). * Split out cleanups (mst). * Split out propagating unrealization. * Split out VirtIOSCSICommon QOM conversion. * Dropped klass -> oc cleanup since no new variables are added any more. * Split off VirtConsole QOM conversion (an independent type hierarchy). Cc: Anthony Liguori Cc: Michael S. Tsirkin Cc: Peter Crosthwaite Cc: Herv=C3=A9 Poussineau Cc: Paolo Bonzini Cc: Jesse Larrew Cc: Frederic Konrad Cc: Hu Tao Cc: Alexey Kardashevskiy Andreas F=C3=A4rber (22): object: Add OBJECT_GET_PARENT_CLASS() macro virtio-console: Use exitfn for virtserialport, too virtio-9p-device: Avoid freeing uninitialized memory virtio-blk-dataplane: Improve error reporting virtio: Allow NULL VirtioDeviceClass::init hook virtio-9p: QOM realize preparations virtio-9p: Convert to QOM realize virtio-blk: QOM realize preparations virtio-blk: Convert to QOM realize virtio-serial: QOM realize preparations virtio-serial: Convert to QOM realize virtio-net: QOM realize preparations virtio-net: Convert to QOM realize virtio-balloon: QOM realize preparations virtio-balloon: Convert to QOM realize virtio-rng: QOM realize preparations virtio-rng: Convert to QOM realize virtio-scsi: QOM realize preparations virtio-scsi: Convert to QOM realize virtio: Convert VirtioDevice to QOM realize virtio: Unrealize parent virtio-scsi: Convert virtio_scsi_common_[un]realize to QOM realize hw/9pfs/virtio-9p-device.c | 49 ++++++++++++++------------- hw/9pfs/virtio-9p.h | 2 ++ hw/block/dataplane/virtio-blk.c | 30 +++++++++-------- hw/block/dataplane/virtio-blk.h | 5 +-- hw/block/virtio-blk.c | 53 +++++++++++++++++++---------- hw/char/virtio-console.c | 1 + hw/char/virtio-serial-bus.c | 39 ++++++++++++--------- hw/net/virtio-net.c | 42 ++++++++++++----------- hw/scsi/vhost-scsi.c | 49 +++++++++++++++------------ hw/scsi/virtio-scsi.c | 69 ++++++++++++++++++++++----------= ------ hw/virtio/virtio-balloon.c | 40 +++++++++++++--------- hw/virtio/virtio-rng.c | 43 +++++++++++++----------- hw/virtio/virtio.c | 20 ++++------- include/hw/virtio/vhost-scsi.h | 2 ++ include/hw/virtio/virtio-balloon.h | 2 ++ include/hw/virtio/virtio-blk.h | 2 ++ include/hw/virtio/virtio-net.h | 2 ++ include/hw/virtio/virtio-rng.h | 2 ++ include/hw/virtio/virtio-scsi.h | 7 ++-- include/hw/virtio/virtio-serial.h | 2 ++ include/hw/virtio/virtio.h | 6 ++-- include/qom/object.h | 10 ++++++ 22 files changed, 282 insertions(+), 195 deletions(-) --=20 1.8.1.4