static int parse_drive(DeviceState *dev, const char *str, void **ptr)

{

    BlockDriverState *bs;



    bs = bdrv_find(str);

    if (bs == NULL) {

        return -ENOENT;

    }

    if (bdrv_attach_dev(bs, dev) < 0) {

        return -EEXIST;

    }

    *ptr = bs;

    return 0;

}

static int parse_drive(DeviceState *dev, const char *str, void **ptr)

{

    BlockDriverState *bs;



    bs = bdrv_find(str);

    if (bs == NULL) {

        return -ENOENT;

    }

    if (bdrv_attach_dev(bs, dev) < 0) {

        return -EEXIST;

    }

    *ptr = bs;

    return 0;

}

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

{

    BlockDriverState *bs;



    bs = bdrv_find(VAR_1);

    if (bs == NULL) {

        return -ENOENT;

    }

    if (bdrv_attach_dev(bs, VAR_0) < 0) {

        return -EEXIST;

    }

    *VAR_2 = bs;

    return 0;

}

static int FUNC_0(DeviceState *VAR_0, const char *VAR_1, void **VAR_2)
{ BlockDriverState *bs; bs = bdrv_find(VAR_1); if (bs == NULL) { return -ENOENT; } if (bdrv_attach_dev(bs, VAR_0) < 0) { return -EEXIST; } *VAR_2 = bs; return 0; }