qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 094/103] qdev: reorganize error reporting in bus_set_


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PULL 094/103] qdev: reorganize error reporting in bus_set_realized
Date: Tue, 17 Jun 2014 20:42:07 +0300

From: Paolo Bonzini <address@hidden>

No semantic change.

Cc: address@hidden
Signed-off-by: Paolo Bonzini <address@hidden>
Tested-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
---
 hw/core/qdev.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 3226a71..65aa041 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -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,
-- 
MST




reply via email to

[Prev in Thread] Current Thread [Next in Thread]