From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDruz-0003Am-GJ for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDrus-0000yJ-HM for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:12:57 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:43940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDrur-0000xV-TD for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:12:50 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Aug 2013 13:32:25 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id A0FCF1258043 for ; Mon, 26 Aug 2013 13:42:31 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7Q8EGIs45678726 for ; Mon, 26 Aug 2013 13:44:17 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7Q8CeFw032538 for ; Mon, 26 Aug 2013 13:42:40 +0530 Message-ID: <521B0DF2.6030701@linux.vnet.ibm.com> Date: Mon, 26 Aug 2013 16:12:34 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1377302436-25193-1-git-send-email-afaerber@suse.de> In-Reply-To: <1377302436-25193-1-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, anthony@codemonkey.ws I have not looked deep into QOM, so only reviewed the code in this series, and have some minor comments for patch 12, 13, and 15. For other part, Reviewed-by: Wenchao Xia > Hello, > > Peter remarked that object_initialize() on a GICState struct field would not > check whether the TypeInfo::instance_size for its typename argument exceeds > the length of the field we're initializing. This series therefore updates > all callers to explicitly pass the size available for the object. > > While we don't have that many object_initialize() users yet, quite a few > devices are using qbus_create_inplace() or bus-specific functions based on it. > Still I consider this the safest solution in pushing the responsability for > supplying the length to the caller and thereby checking not only field type > lengths but also allocation lengths. > > The series goes on to showcase an object_initialize() usage where we don't > know the instance_size in advance and need a QOM API to obtain it. > > Based on Peter's OBJECT() elimination patch, which I have queued on qom-next. > This series conflicts with my *mpcore, virtio and ipack series among others. > > Regards, > Andreas > > Cc: Peter Maydell > Cc: Anthony Liguori > > Andreas Färber (16): > qom: Fix object_initialize_with_type() argument name in documentation > intel-hda: Pass size to hda_codec_bus_init() > ipack: Pass size to ipack_bus_new_inplace() > ide: Pass size to ide_bus_new() > pci: Pass size to pci_bus_new_inplace() > scsi: Pass size to scsi_bus_new() > usb: Pass size to usb_bus_new() > virtio-pci: Pass size to virtio_pci_bus_new() > s390-virtio-bus: Pass size to virtio_s390_bus_new() > virtio-ccw: Pass size to virtio_ccw_bus_new() > virtio-mmio: Pass size to virtio_mmio_bus_new() > qdev: Pass size to qbus_create_inplace() > qom: Pass available size to object_initialize() > qom: Introduce type_get_instance_size() > qdev-monitor: Clean up qdev_device_add() variable naming > qdev-monitor: Avoid aborting on out-of-memory in qdev_device_add() > > hw/audio/intel-hda.c | 6 +++--- > hw/audio/intel-hda.h | 2 +- > hw/char/ipack.c | 5 +++-- > hw/char/ipack.h | 3 ++- > hw/char/tpci200.c | 2 +- > hw/char/virtio-serial-bus.c | 4 ++-- > hw/core/qdev.c | 4 ++-- > hw/core/sysbus.c | 4 ++-- > hw/cpu/icc_bus.c | 3 ++- > hw/dma/xilinx_axidma.c | 6 ++++-- > hw/ide/ahci.c | 2 +- > hw/ide/cmd646.c | 2 +- > hw/ide/internal.h | 3 ++- > hw/ide/isa.c | 2 +- > hw/ide/macio.c | 2 +- > hw/ide/mmio.c | 2 +- > hw/ide/piix.c | 2 +- > hw/ide/qdev.c | 5 +++-- > hw/ide/via.c | 2 +- > hw/intc/xics.c | 2 +- > hw/misc/macio/cuda.c | 4 ++-- > hw/misc/macio/macio.c | 13 +++++++------ > hw/net/xilinx_axienet.c | 6 ++++-- > hw/pci-host/prep.c | 4 ++-- > hw/pci-host/q35.c | 2 +- > hw/pci-host/versatile.c | 4 ++-- > hw/pci/pci.c | 4 ++-- > hw/pci/pci_bridge.c | 3 ++- > hw/s390x/event-facility.c | 4 ++-- > hw/s390x/s390-virtio-bus.c | 24 +++++++++++++----------- > hw/s390x/virtio-ccw.c | 26 ++++++++++++++------------ > hw/scsi/esp-pci.c | 2 +- > hw/scsi/esp.c | 2 +- > hw/scsi/lsi53c895a.c | 2 +- > hw/scsi/megasas.c | 3 ++- > hw/scsi/scsi-bus.c | 6 +++--- > hw/scsi/spapr_vscsi.c | 3 ++- > hw/scsi/virtio-scsi.c | 3 ++- > hw/scsi/vmw_pvscsi.c | 3 ++- > hw/usb/bus.c | 5 +++-- > hw/usb/dev-smartcard-reader.c | 3 ++- > hw/usb/dev-storage.c | 6 ++++-- > hw/usb/dev-uas.c | 3 ++- > hw/usb/hcd-ehci.c | 2 +- > hw/usb/hcd-musb.c | 2 +- > hw/usb/hcd-ohci.c | 2 +- > hw/usb/hcd-uhci.c | 2 +- > hw/usb/hcd-xhci.c | 2 +- > hw/virtio/virtio-mmio.c | 10 ++++++---- > hw/virtio/virtio-pci.c | 26 ++++++++++++++------------ > include/hw/pci/pci.h | 2 +- > include/hw/qdev-core.h | 2 +- > include/hw/scsi/scsi.h | 4 ++-- > include/hw/usb.h | 3 ++- > include/qom/object.h | 16 +++++++++++++--- > qdev-monitor.c | 30 ++++++++++++++++++------------ > qom/object.c | 16 ++++++++++++---- > 57 files changed, 185 insertions(+), 132 deletions(-) > -- Best Regards Wenchao Xia