Skip to content

Commit

Permalink
qdev: reorganize error reporting in bus_set_realized
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini authored and mstsirkin committed Jun 19, 2014
1 parent 0d15668 commit b7b34d0
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions hw/core/qdev.c
Expand Up @@ -573,27 +573,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,
Expand Down

0 comments on commit b7b34d0

Please sign in to comment.