]> git.proxmox.com Git - mirror_qemu.git/blobdiff - bootdevice.c
block/export: Move writable to BlockExportOptions
[mirror_qemu.git] / bootdevice.c
index 03aaffcc8de92230e2b17363575eabf4b1c64789..add4e3d2d1297f0f27c32643f364c1c6dd7ea7e7 100644 (file)
@@ -297,22 +297,19 @@ static void device_set_bootindex(Object *obj, Visitor *v, const char *name,
     int32_t boot_index;
     Error *local_err = NULL;
 
-    visit_type_int32(v, name, &boot_index, &local_err);
-    if (local_err) {
-        goto out;
+    if (!visit_type_int32(v, name, &boot_index, errp)) {
+        return;
     }
     /* check whether bootindex is present in fw_boot_order list  */
     check_boot_index(boot_index, &local_err);
     if (local_err) {
-        goto out;
+        error_propagate(errp, local_err);
+        return;
     }
     /* change bootindex to a new one */
     *prop->bootindex = boot_index;
 
     add_boot_device_path(*prop->bootindex, prop->dev, prop->suffix);
-
-out:
-    error_propagate(errp, local_err);
 }
 
 static void property_release_bootindex(Object *obj, const char *name,
@@ -327,9 +324,8 @@ static void property_release_bootindex(Object *obj, const char *name,
 
 void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                                    const char *name, const char *suffix,
-                                   DeviceState *dev, Error **errp)
+                                   DeviceState *dev)
 {
-    Error *local_err = NULL;
     BootIndexProperty *prop = g_malloc0(sizeof(*prop));
 
     prop->bootindex = bootindex;
@@ -340,15 +336,10 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                         device_get_bootindex,
                         device_set_bootindex,
                         property_release_bootindex,
-                        prop, &local_err);
+                        prop);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
-        g_free(prop);
-        return;
-    }
     /* initialize devices' bootindex property to -1 */
-    object_property_set_int(obj, -1, name, NULL);
+    object_property_set_int(obj, name, -1, NULL);
 }
 
 typedef struct FWLCHSEntry FWLCHSEntry;