diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-11 14:52:08 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2014-08-05 13:55:07 -0500 |
commit | ab139bf9d278e7ce4fe83d81a4a01b51c7d82091 (patch) | |
tree | 3e15ec4871815eb5d99732e8228da4ea0bc32979 | |
parent | d728dafe5aa16de7f0dd36f2cc18f10767e0b60c (diff) |
qdev: reorganize error reporting in bus_set_realized
No semantic change.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit b7b34d055d82abaa511b35c9fc24efbb63dca0b1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | hw/core/qdev.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 2fd5100522..f52f0ac3e3 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -520,27 +520,19 @@ static void bus_set_realized(Object *obj, bool value, Error **errp) if (value && !bus->realized) { if (bc->realize) { bc->realize(bus, &local_err); - - if (local_err != NULL) { - goto error; - } - } } else if (!value && bus->realized) { if (bc->unrealize) { bc->unrealize(bus, &local_err); - - if (local_err != NULL) { - goto error; - } } } - bus->realized = value; - return; + if (local_err != NULL) { + error_propagate(errp, local_err); + return; + } -error: - error_propagate(errp, local_err); + bus->realized = value; } void qbus_create_inplace(void *bus, size_t size, const char *typename, |