[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/29] Revert "qdev: Free QemuOpts when the QOM path
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 27/29] Revert "qdev: Free QemuOpts when the QOM path goes away" |
Date: |
Wed, 18 Oct 2017 18:12:19 +0200 |
From: Michael Roth <address@hidden>
This reverts commit abed886ec60cf239a03515cf0b30fb11fa964c44.
This patch originally addressed an issue where a DEVICE_DELETED
event could be emitted (in device_unparent()) before a Device's
QemuOpts were cleaned up (in device_finalize()), leading to a
"duplicate ID" error if management attempted to immediately add
a device with the same ID in response to the DEVICE_DELETED event.
An alternative will be implemented in a subsequent patch where we
defer the DEVICE_DELETED event until device_finalize(), which would
also prevent the race, so we revert the original fix in preparation.
Signed-off-by: Michael Roth <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Eric Auger <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/core/qdev.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 0019a49..418cdac 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -1069,6 +1069,7 @@ static void device_finalize(Object *obj)
NamedGPIOList *ngl, *next;
DeviceState *dev = DEVICE(obj);
+ qemu_opts_del(dev->opts);
QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {
QLIST_REMOVE(ngl, node);
@@ -1118,9 +1119,6 @@ static void device_unparent(Object *obj)
g_free(dev->canonical_path);
dev->canonical_path = NULL;
}
-
- qemu_opts_del(dev->opts);
- dev->opts = NULL;
}
static void device_class_init(ObjectClass *class, void *data)
--
1.8.3.1
- [Qemu-devel] [PULL 12/29] docs/devel/loads-stores.rst: Document our various load and store APIs, (continued)
- [Qemu-devel] [PULL 12/29] docs/devel/loads-stores.rst: Document our various load and store APIs, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 14/29] target/i386: introduce x86_ld*_code, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 19/29] kvm: fix error message when failing to unregister slot, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 16/29] memory: call log_start after region_add, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 18/29] kvm: tolerate non-existing slot for log_start/log_stop/log_sync, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 22/29] memory: reuse section_from_flat_range(), Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 21/29] kvm: simplify kvm_align_section(), Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 20/29] kvm: region_add and region_del is not called on updates, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 24/29] watch_mem_write: implement 8-byte accesses, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 25/29] qemu-pr-helper: use new libmultipath API, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 27/29] Revert "qdev: Free QemuOpts when the QOM path goes away",
Paolo Bonzini <=
- [Qemu-devel] [PULL 29/29] scsi: reject configurations with logical block size > physical block size, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 26/29] qdev: store DeviceState's canonical path to use when unparenting, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 23/29] notdirty_mem_write: implement 8-byte accesses, Paolo Bonzini, 2017/10/18
- [Qemu-devel] [PULL 28/29] qdev: defer DEVICE_DEL event until instance_finalize(), Paolo Bonzini, 2017/10/18
- Re: [Qemu-devel] [PULL 00/29] Misc patches for 2017-10-18, no-reply, 2017/10/18
- Re: [Qemu-devel] [PULL 00/29] Misc patches for 2017-10-18, Peter Maydell, 2017/10/19