[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 38/88] virtio-balloon: fix virtio-balloon child ref
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 38/88] virtio-balloon: fix virtio-balloon child refcount in transports |
Date: |
Thu, 8 Jan 2015 11:33:42 -0600 |
From: Gonglei <address@hidden>
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-balloon child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
(cherry picked from commit 91ba21208839643603e7f7fa5864723c3f371ebe)
Signed-off-by: Michael Roth <address@hidden>
---
hw/s390x/virtio-ccw.c | 2 +-
hw/virtio/virtio-pci.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index de0764d..c074f64 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -900,7 +900,7 @@ static void virtio_ccw_balloon_instance_init(Object *obj)
VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-
+ object_unref(OBJECT(&dev->vdev));
object_property_add(obj, "guest-stats", "guest statistics",
balloon_ccw_stats_get_all, NULL, NULL, dev, NULL);
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6853955..6a355e7 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1327,7 +1327,7 @@ static void virtio_balloon_pci_instance_init(Object *obj)
VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-
+ object_unref(OBJECT(&dev->vdev));
object_property_add(obj, "guest-stats", "guest statistics",
balloon_pci_stats_get_all, NULL, NULL, dev,
NULL);
--
1.9.1
- [Qemu-stable] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation, (continued)
- [Qemu-stable] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 22/88] ivshmem: validate incoming_posn value from server, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 24/88] ivshmem: Fix fd leak on error, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 26/88] tests: avoid running duplicate qom-tests, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 28/88] smbios: Fix assertion on socket count calculation, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 27/88] snapshot: fix referencing wrong variable in while loop in do_delvm, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 33/88] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 32/88] virtio/vhost-scsi: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 38/88] virtio-balloon: fix virtio-balloon child refcount in transports,
Michael Roth <=
- [Qemu-stable] [PATCH 31/88] virtio-net: fix virtio-net child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 36/88] virtio-rng: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 29/88] vhost-scsi: use virtio_ldl_p, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 35/88] virtio-serial: fix virtio-serial child refcount in transports, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 43/88] vmware-vga: add vmsvga_verify_rect, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 30/88] virtio-net: use aliases instead of duplicate qdev properties, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 41/88] pc: Fix disabling of vapic for compat PC models, Michael Roth, 2015/01/08
- [Qemu-stable] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports, Michael Roth, 2015/01/08