qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] Usb 20180618 patches
@ 2018-06-18  9:21 Gerd Hoffmann
  2018-06-18  9:21 ` [Qemu-devel] [PULL 1/3] Revert "usb-ccid: fix bus leak" Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-06-18  9:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

The following changes since commit 2ef2f16781af9dee6ba6517755e9073ba5799fa2:

  Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180615a' into staging (2018-06-15 18:13:35 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/usb-20180618-pull-request

for you to fetch changes up to 0d1e8d6f4a2ced75f673edfe4d6cb78f3b361144:

  Revert "bus: do not unref the added child bus on realize" (2018-06-18 09:15:51 +0200)

----------------------------------------------------------------
usb: revert ccid / qom patches.

----------------------------------------------------------------

Marc-André Lureau (3):
  Revert "usb-ccid: fix bus leak"
  Revert "usb: release the created buses"
  Revert "bus: do not unref the added child bus on realize"

 hw/core/bus.c                 |  1 +
 hw/usb/dev-smartcard-reader.c |  1 -
 hw/usb/dev-storage.c          | 16 ----------------
 hw/usb/dev-uas.c              |  2 --
 4 files changed, 1 insertion(+), 19 deletions(-)

-- 
2.9.3

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

* [Qemu-devel] [PULL 1/3] Revert "usb-ccid: fix bus leak"
  2018-06-18  9:21 [Qemu-devel] [PULL 0/3] Usb 20180618 patches Gerd Hoffmann
@ 2018-06-18  9:21 ` Gerd Hoffmann
  2018-06-18  9:21 ` [Qemu-devel] [PULL 2/3] Revert "usb: release the created buses" Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-06-18  9:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The bus is not owned by the device.

This reverts commit 410a096adf991ce437d4d7dabc59b6557e6d488d.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20180613172815.32738-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-smartcard-reader.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index fa546fb3ce..13d0befd9c 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -1147,7 +1147,6 @@ static void ccid_unrealize(USBDevice *dev, Error **errp)
     USBCCIDState *s = USB_CCID_DEV(dev);
 
     ccid_bulk_in_clear(s);
-    object_unref(OBJECT(&s->bus));
 }
 
 static void ccid_flush_pending_answers(USBCCIDState *s)
-- 
2.9.3

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

* [Qemu-devel] [PULL 2/3] Revert "usb: release the created buses"
  2018-06-18  9:21 [Qemu-devel] [PULL 0/3] Usb 20180618 patches Gerd Hoffmann
  2018-06-18  9:21 ` [Qemu-devel] [PULL 1/3] Revert "usb-ccid: fix bus leak" Gerd Hoffmann
@ 2018-06-18  9:21 ` Gerd Hoffmann
  2018-06-18  9:21 ` [Qemu-devel] [PULL 3/3] Revert "bus: do not unref the added child bus on realize" Gerd Hoffmann
  2018-06-19 12:43 ` [Qemu-devel] [PULL 0/3] Usb 20180618 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-06-18  9:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The USB device don't hold the bus. There is no ASAN related reports
anymore.

This reverts commit cd7bc87868d534f95e928cad98e2a52df7695771.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20180613172815.32738-3-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-storage.c | 16 ----------------
 hw/usb/dev-uas.c     |  2 --
 2 files changed, 18 deletions(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 47b992f403..c99398b7f6 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -588,13 +588,6 @@ static const struct SCSIBusInfo usb_msd_scsi_info_bot = {
     .load_request = usb_msd_load_request,
 };
 
-static void usb_msd_unrealize_storage(USBDevice *dev, Error **errp)
-{
-    MSDState *s = USB_STORAGE_DEV(dev);
-
-    object_unref(OBJECT(&s->bus));
-}
-
 static void usb_msd_storage_realize(USBDevice *dev, Error **errp)
 {
     MSDState *s = USB_STORAGE_DEV(dev);
@@ -642,13 +635,6 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp)
     s->scsi_dev = scsi_dev;
 }
 
-static void usb_msd_bot_unrealize(USBDevice *dev, Error **errp)
-{
-    MSDState *s = USB_STORAGE_DEV(dev);
-
-    object_unref(OBJECT(&s->bus));
-}
-
 static void usb_msd_bot_realize(USBDevice *dev, Error **errp)
 {
     MSDState *s = USB_STORAGE_DEV(dev);
@@ -712,7 +698,6 @@ static void usb_msd_class_storage_initfn(ObjectClass *klass, void *data)
     USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
 
     uc->realize = usb_msd_storage_realize;
-    uc->unrealize = usb_msd_unrealize_storage;
     dc->props = msd_properties;
 }
 
@@ -775,7 +760,6 @@ static void usb_msd_class_bot_initfn(ObjectClass *klass, void *data)
     USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
 
     uc->realize = usb_msd_bot_realize;
-    uc->unrealize = usb_msd_bot_unrealize;
     uc->attached_settable = true;
 }
 
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index aaf5a88095..be566cad02 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -896,8 +896,6 @@ static void usb_uas_unrealize(USBDevice *dev, Error **errp)
     UASDevice *uas = USB_UAS(dev);
 
     qemu_bh_delete(uas->status_bh);
-
-    object_unref(OBJECT(&uas->bus));
 }
 
 static void usb_uas_realize(USBDevice *dev, Error **errp)
-- 
2.9.3

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

* [Qemu-devel] [PULL 3/3] Revert "bus: do not unref the added child bus on realize"
  2018-06-18  9:21 [Qemu-devel] [PULL 0/3] Usb 20180618 patches Gerd Hoffmann
  2018-06-18  9:21 ` [Qemu-devel] [PULL 1/3] Revert "usb-ccid: fix bus leak" Gerd Hoffmann
  2018-06-18  9:21 ` [Qemu-devel] [PULL 2/3] Revert "usb: release the created buses" Gerd Hoffmann
@ 2018-06-18  9:21 ` Gerd Hoffmann
  2018-06-19 12:43 ` [Qemu-devel] [PULL 0/3] Usb 20180618 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-06-18  9:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

This is wrong.  object_finalize_child_property()'s unref balances the
ref in object_property_add_child().  qbus_realize's unref balances the
ref that was initially placed by object_new/object_initialize.

This reverts commit f3d58385a6d3d82f65db602c5506e2d3d8c82394.

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20180613172815.32738-4-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/core/bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/bus.c b/hw/core/bus.c
index ad0c9df335..4651f24486 100644
--- a/hw/core/bus.c
+++ b/hw/core/bus.c
@@ -102,6 +102,7 @@ static void qbus_realize(BusState *bus, DeviceState *parent, const char *name)
         QLIST_INSERT_HEAD(&bus->parent->child_bus, bus, sibling);
         bus->parent->num_child_bus++;
         object_property_add_child(OBJECT(bus->parent), bus->name, OBJECT(bus), NULL);
+        object_unref(OBJECT(bus));
     } else if (bus != sysbus_get_default()) {
         /* TODO: once all bus devices are qdevified,
            only reset handler for main_system_bus should be registered here. */
-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 0/3] Usb 20180618 patches
  2018-06-18  9:21 [Qemu-devel] [PULL 0/3] Usb 20180618 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2018-06-18  9:21 ` [Qemu-devel] [PULL 3/3] Revert "bus: do not unref the added child bus on realize" Gerd Hoffmann
@ 2018-06-19 12:43 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2018-06-19 12:43 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 18 June 2018 at 10:21, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit 2ef2f16781af9dee6ba6517755e9073ba5799fa2:
>
>   Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20180615a' into staging (2018-06-15 18:13:35 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/usb-20180618-pull-request
>
> for you to fetch changes up to 0d1e8d6f4a2ced75f673edfe4d6cb78f3b361144:
>
>   Revert "bus: do not unref the added child bus on realize" (2018-06-18 09:15:51 +0200)
>
> ----------------------------------------------------------------
> usb: revert ccid / qom patches.
>
> ----------------------------------------------------------------
>

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2018-06-19 12:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18  9:21 [Qemu-devel] [PULL 0/3] Usb 20180618 patches Gerd Hoffmann
2018-06-18  9:21 ` [Qemu-devel] [PULL 1/3] Revert "usb-ccid: fix bus leak" Gerd Hoffmann
2018-06-18  9:21 ` [Qemu-devel] [PULL 2/3] Revert "usb: release the created buses" Gerd Hoffmann
2018-06-18  9:21 ` [Qemu-devel] [PULL 3/3] Revert "bus: do not unref the added child bus on realize" Gerd Hoffmann
2018-06-19 12:43 ` [Qemu-devel] [PULL 0/3] Usb 20180618 patches Peter Maydell

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