Commit d578029e authored by Gonglei's avatar Gonglei Committed by Andreas Färber
Browse files

qdev: Use error_abort instead of using local_err



This error can not happen normally. If it happens, it indicates
something very wrong, we should abort QEMU. Moreover, the
user can only refer to /machine/peripheral or /objects, not
/machine/unattached.

While at it, remove superfluous check about local_err.

Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Reviewed-by: default avatarPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
parent 843ef73a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -820,13 +820,13 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
    }

    if (value && !dev->realized) {
        if (!obj->parent && local_err == NULL) {
        if (!obj->parent) {
            static int unattached_count;
            gchar *name = g_strdup_printf("device[%d]", unattached_count++);

            object_property_add_child(container_get(qdev_get_machine(),
                                                    "/unattached"),
                                      name, obj, &local_err);
                                      name, obj, &error_abort);
            g_free(name);
        }