int qdev_prop_set_drive(DeviceState *dev, const char *name, BlockDriverState *value)

{

    int res;



    res = bdrv_attach(value, dev);

    if (res < 0) {

        error_report("Can't attach drive %s to %s.%s: %s",

                     bdrv_get_device_name(value),

                     dev->id ? dev->id : dev->info->name,

                     name, strerror(-res));

        return -1;

    }

    qdev_prop_set(dev, name, &value, PROP_TYPE_DRIVE);

    return 0;

}

int qdev_prop_set_drive(DeviceState *dev, const char *name, BlockDriverState *value)

{

    int res;



    res = bdrv_attach(value, dev);

    if (res < 0) {

        error_report("Can't attach drive %s to %s.%s: %s",

                     bdrv_get_device_name(value),

                     dev->id ? dev->id : dev->info->name,

                     name, strerror(-res));

        return -1;

    }

    qdev_prop_set(dev, name, &value, PROP_TYPE_DRIVE);

    return 0;

}

int FUNC_0(DeviceState *VAR_0, const char *VAR_1, BlockDriverState *VAR_2)

{

    int VAR_3;



    VAR_3 = bdrv_attach(VAR_2, VAR_0);

    if (VAR_3 < 0) {

        error_report("Can't attach drive %s to %s.%s: %s",

                     bdrv_get_device_name(VAR_2),

                     VAR_0->id ? VAR_0->id : VAR_0->info->VAR_1,

                     VAR_1, strerror(-VAR_3));

        return -1;

    }

    qdev_prop_set(VAR_0, VAR_1, &VAR_2, PROP_TYPE_DRIVE);

    return 0;

}

int FUNC_0(DeviceState *VAR_0, const char *VAR_1, BlockDriverState *VAR_2)
{ int VAR_3; VAR_3 = bdrv_attach(VAR_2, VAR_0); if (VAR_3 < 0) { error_report("Can't attach drive %s to %s.%s: %s",
bdrv_get_device_name(VAR_2),
VAR_0->id ? VAR_0->id : VAR_0->info->VAR_1,
VAR_1, strerror(-VAR_3)); return -1; } qdev_prop_set(VAR_0, VAR_1, &VAR_2, PROP_TYPE_DRIVE); return 0; }