qdev: Make functions taking Error ** return bool, not void
authorMarkus Armbruster <armbru@redhat.com>
Tue, 7 Jul 2020 16:05:59 +0000 (18:05 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 10 Jul 2020 13:18:08 +0000 (15:18 +0200)
See recent commit "error: Document Error API usage rules" for
rationale.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200707160613.848843-32-armbru@redhat.com>

hw/core/qdev-properties-system.c
include/hw/qdev-properties.h

index 810831b1df17c8f76147429fab7d72c8eb127666..7d2387f22cda983e8868b4bf8ae978232cd8e83f 100644 (file)
@@ -421,7 +421,7 @@ const PropertyInfo qdev_prop_audiodev = {
     .set = set_audiodev,
 };
 
-void qdev_prop_set_drive_err(DeviceState *dev, const char *name,
+bool qdev_prop_set_drive_err(DeviceState *dev, const char *name,
                              BlockBackend *value, Error **errp)
 {
     const char *ref = "";
@@ -436,7 +436,7 @@ void qdev_prop_set_drive_err(DeviceState *dev, const char *name,
         }
     }
 
-    object_property_set_str(OBJECT(dev), name, ref, errp);
+    return object_property_set_str(OBJECT(dev), name, ref, errp);
 }
 
 void qdev_prop_set_drive(DeviceState *dev, const char *name,
index 944e3f2e0cd3872dcd10bce402d01d616227d61e..587e5b7d317befc51d1883e4149d9b3eda01b213 100644 (file)
@@ -239,8 +239,8 @@ extern const PropertyInfo qdev_prop_pcie_link_width;
 /*
  * Set properties between creation and realization.
  */
-void qdev_prop_set_drive_err(DeviceState *dev, const char *name,
-                         BlockBackend *value, Error **errp);
+bool qdev_prop_set_drive_err(DeviceState *dev, const char *name,
+                             BlockBackend *value, Error **errp);
 
 /*
  * Set properties between creation and realization.