qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/12] virtio: fix virtio child recount in transports
@ 2014-09-30  9:49 arei.gonglei
  2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 01/12] virtio-net: use aliases instead of duplicate qdev properties arei.gonglei
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: arei.gonglei @ 2014-09-30  9:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: weidong.huang, mst, armbru, luonengjun, peter.huangpeng, agraf,
	borntraeger, Gonglei, stefanha, cornelia.huck, pbonzini, rth

From: Gonglei <arei.gonglei@huawei.com>

virtio-$device-{pci, s390, ccw} all duplicate the
qdev properties of their virtio child. This approach does
not work well with string or pointer properties since we
must be careful about leaking or double-freeing them.

Use the QOM alias property to forward property accesses to the
VirtIO$dev child.  This way no duplication is necessary.

For their child, object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.

The upshot of this is that we always have a refcount >= 1.  Upon hot
unplug the virtio-$device child is not finalized!

Drop our reference after the child property has been added to the
parent.

Changes since v2:
 - fix some typos about commit message in PATCH 12 (Cornelia/Paolo)
 - add 'Reviewed-by' tag

Thanks for review!

Changs since v1:
 - add the same handling for virtio-9p-pci device in PATCH 10 and PATCH 11.
 - add a wrapper function for better code sharing 
   in PATCH 12 (Cornelia/Michael/Paolo)


Attention please:
 As Michael's comments, the patches will introduce regresion about
 "-device FOO,help", which had been fixed by my other patch series:
  [PATCH v4 0/5] add description field in ObjectProperty and PropertyInfo struct
 http://lists.nongnu.org/archive/html/qemu-devel/2014-09/msg05740.html

Acknowledgements:
 I copied Stefan's commit c5d49db message about virtio-blk which
 summarized reasons very well, I cannot agree more with him.
 Holp Stefan do not mind, thanks!


Gonglei (12):
  virtio-net: use aliases instead of duplicate qdev properties
  virtio-net: fix virtio-net child refcount in transports
  virtio/vhost-scsi: use aliases instead of duplicate qdev properties
  virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in
    transports
  virtio-serial: use aliases instead of duplicate qdev properties
  virtio-serial: fix virtio-serial child refcount in transports
  virtio-rng: use aliases instead of duplicate qdev properties
  virtio-rng: fix virtio-rng child refcount in transports
  virtio-balloon: fix virtio-balloon child refcount in transports
  virtio-9p: use aliases instead of duplicate qdev properties
  virtio-9p: fix virtio-9p child refcount in transports
  virtio: add a wrapper for virtio-backend initialization

 hw/s390x/s390-virtio-bus.c | 38 ++++++++++++++++++--------------------
 hw/s390x/virtio-ccw.c      | 40 +++++++++++++++++++---------------------
 hw/virtio/virtio-pci.c     | 46 ++++++++++++++++++++++------------------------
 hw/virtio/virtio.c         | 11 +++++++++++
 include/hw/virtio/virtio.h |  3 +++
 5 files changed, 73 insertions(+), 65 deletions(-)

-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-09-30 11:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  9:49 [Qemu-devel] [PATCH v3 00/12] virtio: fix virtio child recount in transports arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 01/12] virtio-net: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 02/12] virtio-net: fix virtio-net child refcount in transports arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 03/12] virtio/vhost-scsi: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 04/12] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports arei.gonglei
2014-09-30 10:54   ` Cornelia Huck
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 05/12] virtio-serial: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 06/12] virtio-serial: fix virtio-serial child refcount in transports arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 07/12] virtio-rng: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 08/12] virtio-rng: fix virtio-rng child refcount in transports arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 09/12] virtio-balloon: fix virtio-balloon " arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 10/12] virtio-9p: use aliases instead of duplicate qdev properties arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 11/12] virtio-9p: fix virtio-9p child refcount in transports arei.gonglei
2014-09-30  9:49 ` [Qemu-devel] [PATCH v3 12/12] virtio: add a wrapper for virtio-backend initialization arei.gonglei
2014-09-30 10:57   ` Cornelia Huck
2014-09-30 10:45 ` [Qemu-devel] [PATCH v3 00/12] virtio: fix virtio child recount in transports Michael S. Tsirkin

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).