Commit b3443f43 authored by Greg Kurz's avatar Greg Kurz Committed by Eduardo Habkost
Browse files

qdev: ignore GlobalProperty.errp for hotplugged devices



This patch ensures QEMU won't terminate while hotplugging a device if the
global property cannot be set and errp points to error_fatal or error_abort.

While here, it also fixes indentation of the typename argument.

Suggested-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
Reviewed-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
parent 78a39306
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1100,7 +1100,7 @@ static void qdev_prop_set_globals_for_type(DeviceState *dev,
        if (err != NULL) {
            error_prepend(&err, "can't apply global %s.%s=%s: ",
                          prop->driver, prop->property, prop->value);
            if (prop->errp) {
            if (!dev->hotplugged && prop->errp) {
                error_propagate(prop->errp, err);
            } else {
                assert(prop->user_provided);
+3 −1
Original line number Diff line number Diff line
@@ -261,7 +261,9 @@ struct PropertyInfo {
 * @used: Set to true if property was used when initializing a device.
 * @errp: Error destination, used like first argument of error_setg()
 *        in case property setting fails later. If @errp is NULL, we
 *        print warnings instead of ignoring errors silently.
 *        print warnings instead of ignoring errors silently. For
 *        hotplugged devices, errp is always ignored and warnings are
 *        printed instead.
 */
typedef struct GlobalProperty {
    const char *driver;