qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size
Date: Mon, 26 Aug 2013 16:12:34 +0800	[thread overview]
Message-ID: <521B0DF2.6030701@linux.vnet.ibm.com> (raw)
In-Reply-To: <1377302436-25193-1-git-send-email-afaerber@suse.de>

   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 <xiawenc@linux.vnet.ibm.com>

> 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 <peter.maydell@linaro.org>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
>
> 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

  parent reply	other threads:[~2013-08-26  8:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-24  0:00 [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 01/16] qom: Fix object_initialize_with_type() argument name in documentation Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 02/16] intel-hda: Pass size to hda_codec_bus_init() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 03/16] ipack: Pass size to ipack_bus_new_inplace() Andreas Färber
2013-08-26  7:23   ` Wenchao Xia
2013-08-24  0:00 ` [Qemu-devel] [PATCH 04/16] ide: Pass size to ide_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 05/16] pci: Pass size to pci_bus_new_inplace() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 06/16] scsi: Pass size to scsi_bus_new() Andreas Färber
2013-08-26  8:01   ` Paolo Bonzini
2013-08-24  0:00 ` [Qemu-devel] [PATCH 07/16] usb: Pass size to usb_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 08/16] virtio-pci: Pass size to virtio_pci_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 09/16] s390-virtio-bus: Pass size to virtio_s390_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 10/16] virtio-ccw: Pass size to virtio_ccw_bus_new() Andreas Färber
2013-08-26  8:00   ` Cornelia Huck
2013-08-24  0:00 ` [Qemu-devel] [PATCH 11/16] virtio-mmio: Pass size to virtio_mmio_bus_new() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 12/16] qdev: Pass size to qbus_create_inplace() Andreas Färber
2013-08-26  7:44   ` Wenchao Xia
2013-08-30 17:12     ` Andreas Färber
2013-08-26  8:03   ` Cornelia Huck
2013-08-30 17:05     ` Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 13/16] qom: Pass available size to object_initialize() Andreas Färber
2013-08-26  8:09   ` Cornelia Huck
2013-08-26  8:11   ` Wenchao Xia
2013-08-30 17:14     ` Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 14/16] qom: Introduce type_get_instance_size() Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 15/16] qdev-monitor: Clean up qdev_device_add() variable naming Andreas Färber
2013-08-26  7:52   ` Wenchao Xia
2013-08-30 17:19     ` Andreas Färber
2013-09-12 14:40       ` Andreas Färber
2013-08-24  0:00 ` [Qemu-devel] [PATCH 16/16] qdev-monitor: Avoid aborting on out-of-memory in qdev_device_add() Andreas Färber
2013-08-26  8:12 ` Wenchao Xia [this message]
2013-08-30 19:37 ` [Qemu-devel] [PATCH 00/16] qom: Assert sufficient object instance size Andreas Färber

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=521B0DF2.6030701@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=peter.maydell@linaro.org \
    --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).