[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize |
Date: |
Thu, 8 Jan 2015 11:33:05 -0600 |
From: Gonglei <address@hidden>
Forcefully unrealize all children regardless of errors in earlier
iterations (if any). We should keep going with cleanup operation
rather than report an error immediately. Therefore store the first
child unrealization failure and propagate it at the end. We also
forcefully unregister vmsd and unrealize actual object, too.
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Cc: address@hidden
Signed-off-by: Andreas Färber <address@hidden>
(cherry picked from commit cd4520adcab70dbac8db3fe4d41836dca63715a4)
Signed-off-by: Michael Roth <address@hidden>
---
hw/core/qdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index da1ba48..1a88865 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -871,18 +871,18 @@ static void device_set_realized(Object *obj, bool value,
Error **errp)
}
dev->pending_deleted_event = false;
} else if (!value && dev->realized) {
+ Error **local_errp = NULL;
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
+ local_errp = local_err ? NULL : &local_err;
object_property_set_bool(OBJECT(bus), false, "realized",
- &local_err);
- if (local_err != NULL) {
- break;
- }
+ local_errp);
}
- if (qdev_get_vmsd(dev) && local_err == NULL) {
+ if (qdev_get_vmsd(dev)) {
vmstate_unregister(dev, qdev_get_vmsd(dev), dev);
}
- if (dc->unrealize && local_err == NULL) {
- dc->unrealize(dev, &local_err);
+ if (dc->unrealize) {
+ local_errp = local_err ? NULL : &local_err;
+ dc->unrealize(dev, local_errp);
}
dev->pending_deleted_event = true;
}
--
1.9.1
- [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 02/88] qdev: Add cleanup logic in device_set_realized() to avoid resource leak, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 04/88] xhci PCIe endpoint migration compatibility fix, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize,
Michael Roth <=
- [Qemu-devel] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 10/88] virtio-pci: enable bus master for old guests, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 05/88] Introduce cpu_clean_all_dirty, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 08/88] kvmclock: Add comment explaining why we need cpu_clean_all_dirty(), Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 09/88] pci: Use bus master address space for delivering MSI/MSI-X messages, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 07/88] kvmclock: Ensure time in migration never goes backward, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 06/88] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 12/88] hw/arm/virt: fix pl011 and pl031 irq flags, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 13/88] gdbstub: init mon_chr through qemu_chr_alloc, Michael Roth, 2015/01/08
- [Qemu-devel] [PATCH 14/88] qapi: add visit_start_union and visit_end_union, Michael Roth, 2015/01/08