Usb 20180618 patches
[Qemu-devel] [PULL 3/3] Revert "bus: do not unref the added child bus on realize"
In reply to Gerd HoffmannFrom: Marc-André Lureau <[email protected]>
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.
Message-id: [email protected]
--- hw/core/bus.c | 1 + 1 file changed, 1 insertion(+)
hw/core/bus.c +1 -0
@@ -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. */
Signature · 1 line
2.9.3
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(-)
Signature · 1 line
2.9.3
[Qemu-devel] [PULL 1/3] Revert "usb-ccid: fix bus leak"
From: Marc-André Lureau <[email protected]>
The bus is not owned by the device.
This reverts commit 410a096adf991ce437d4d7dabc59b6557e6d488d.
Message-id: [email protected]
--- hw/usb/dev-smartcard-reader.c | 1 - 1 file changed, 1 deletion(-)
hw/usb/dev-smartcard-reader.c +0 -1
@@ -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)
Signature · 1 line
2.9.3
[Qemu-devel] [PULL 2/3] Revert "usb: release the created buses"
In reply to Gerd HoffmannFrom: Marc-André Lureau <[email protected]>
The USB device don't hold the bus. There is no ASAN related reports anymore.
This reverts commit cd7bc87868d534f95e928cad98e2a52df7695771.
Message-id: [email protected]
--- hw/usb/dev-storage.c | 16 ---------------- hw/usb/dev-uas.c | 2 -- 2 files changed, 18 deletions(-)
hw/usb/dev-storage.c +0 -16
@@ -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; }
hw/usb/dev-uas.c +0 -2
@@ -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)
Signature · 1 line
2.9.3
Peter Maydell
AppliedQuoted 8 lines · 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/qemutags/usb-20180618-pull-request
Quoted 9 lines
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