static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,

                    Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Error *local_err = NULL;

    Property *prop = opaque;

    CharBackend *be = qdev_get_prop_ptr(dev, prop);

    CharDriverState *s;

    char *str;



    if (dev->realized) {

        qdev_prop_set_after_realize(dev, name, errp);

        return;

    }



    visit_type_str(v, name, &str, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }



    if (!*str) {

        g_free(str);

        be->chr = NULL;

        return;

    }



    s = qemu_chr_find(str);

    g_free(str);

    if (s == NULL) {

        error_setg(errp, "Property '%s.%s' can't find value '%s'",

                   object_get_typename(obj), prop->name, str);

        return;

    }



    if (!qemu_chr_fe_init(be, s, errp)) {

        error_prepend(errp, "Property '%s.%s' can't take value '%s': ",

                      object_get_typename(obj), prop->name, str);

        return;

    }

}

static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,

                    Error **errp)

{

    DeviceState *dev = DEVICE(obj);

    Error *local_err = NULL;

    Property *prop = opaque;

    CharBackend *be = qdev_get_prop_ptr(dev, prop);

    CharDriverState *s;

    char *str;



    if (dev->realized) {

        qdev_prop_set_after_realize(dev, name, errp);

        return;

    }



    visit_type_str(v, name, &str, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }



    if (!*str) {

        g_free(str);

        be->chr = NULL;

        return;

    }



    s = qemu_chr_find(str);

    g_free(str);

    if (s == NULL) {

        error_setg(errp, "Property '%s.%s' can't find value '%s'",

                   object_get_typename(obj), prop->name, str);

        return;

    }



    if (!qemu_chr_fe_init(be, s, errp)) {

        error_prepend(errp, "Property '%s.%s' can't take value '%s': ",

                      object_get_typename(obj), prop->name, str);

        return;

    }

}

    g_free(str);     if (!qemu_chr_fe_init(be, s, errp)) {
static void FUNC_0(Object *VAR_0, Visitor *VAR_1, const char *VAR_2, void *VAR_3,

                    Error **VAR_4)

{

    DeviceState *dev = DEVICE(VAR_0);

    Error *local_err = NULL;

    Property *prop = VAR_3;

    CharBackend *be = qdev_get_prop_ptr(dev, prop);

    CharDriverState *s;

    char *VAR_5;



    if (dev->realized) {

        qdev_prop_set_after_realize(dev, VAR_2, VAR_4);

        return;

    }



    visit_type_str(VAR_1, VAR_2, &VAR_5, &local_err);

    if (local_err) {

        error_propagate(VAR_4, local_err);

        return;

    }



    if (!*VAR_5) {

        g_free(VAR_5);

        be->chr = NULL;

        return;

    }



    s = qemu_chr_find(VAR_5);

    g_free(VAR_5);

    if (s == NULL) {

        error_setg(VAR_4, "Property '%s.%s' can't find value '%s'",

                   object_get_typename(VAR_0), prop->VAR_2, VAR_5);

        return;

    }



    if (!qemu_chr_fe_init(be, s, VAR_4)) {

        error_prepend(VAR_4, "Property '%s.%s' can't take value '%s': ",

                      object_get_typename(VAR_0), prop->VAR_2, VAR_5);

        return;

    }

}

static void FUNC_0(Object *VAR_0, Visitor *VAR_1, const char *VAR_2, void *VAR_3,
Error **VAR_4)
{ DeviceState *dev = DEVICE(VAR_0); Error *local_err = NULL; Property *prop = VAR_3; CharBackend *be = qdev_get_prop_ptr(dev, prop); CharDriverState *s; char *VAR_5; if (dev->realized) { qdev_prop_set_after_realize(dev, VAR_2, VAR_4); return; } visit_type_str(VAR_1, VAR_2, &VAR_5, &local_err); if (local_err) { error_propagate(VAR_4, local_err); return; } if (!*VAR_5) { g_free(VAR_5); be->chr = NULL; return; } s = qemu_chr_find(VAR_5); g_free(VAR_5); if (s == NULL) { error_setg(VAR_4, "Property '%s.%s' can't find value '%s'",
object_get_typename(VAR_0), prop->VAR_2, VAR_5); return; } if (!qemu_chr_fe_init(be, s, VAR_4)) { error_prepend(VAR_4, "Property '%s.%s' can't take value '%s': ",
object_get_typename(VAR_0), prop->VAR_2, VAR_5); return; } }