static int img_open_password(BlockBackend *blk, const char *filename,

                             int flags, bool quiet)

{

    BlockDriverState *bs;

    char password[256];



    bs = blk_bs(blk);

    if (bdrv_is_encrypted(bs) && !(flags & BDRV_O_NO_IO)) {

        qprintf(quiet, "Disk image '%s' is encrypted.\n", filename);

        if (qemu_read_password(password, sizeof(password)) < 0) {

            error_report("No password given");

            return -1;

        }

        if (bdrv_set_key(bs, password) < 0) {

            error_report("invalid password");

            return -1;

        }

    }

    return 0;

}

static int img_open_password(BlockBackend *blk, const char *filename,

                             int flags, bool quiet)

{

    BlockDriverState *bs;

    char password[256];



    bs = blk_bs(blk);

    if (bdrv_is_encrypted(bs) && !(flags & BDRV_O_NO_IO)) {

        qprintf(quiet, "Disk image '%s' is encrypted.\n", filename);

        if (qemu_read_password(password, sizeof(password)) < 0) {

            error_report("No password given");

            return -1;

        }

        if (bdrv_set_key(bs, password) < 0) {

            error_report("invalid password");

            return -1;

        }

    }

    return 0;

}

static int FUNC_0(BlockBackend *VAR_0, const char *VAR_1,

                             int VAR_2, bool VAR_3)

{

    BlockDriverState *bs;

    char VAR_4[256];



    bs = blk_bs(VAR_0);

    if (bdrv_is_encrypted(bs) && !(VAR_2 & BDRV_O_NO_IO)) {

        qprintf(VAR_3, "Disk image '%s' is encrypted.\n", VAR_1);

        if (qemu_read_password(VAR_4, sizeof(VAR_4)) < 0) {

            error_report("No VAR_4 given");

            return -1;

        }

        if (bdrv_set_key(bs, VAR_4) < 0) {

            error_report("invalid VAR_4");

            return -1;

        }

    }

    return 0;

}

static int FUNC_0(BlockBackend *VAR_0, const char *VAR_1,
int VAR_2, bool VAR_3)
{ BlockDriverState *bs; char VAR_4[256]; bs = blk_bs(VAR_0); if (bdrv_is_encrypted(bs) && !(VAR_2 & BDRV_O_NO_IO)) { qprintf(VAR_3, "Disk image '%s' is encrypted.\n", VAR_1); if (qemu_read_password(VAR_4, sizeof(VAR_4)) < 0) { error_report("No VAR_4 given"); return -1; } if (bdrv_set_key(bs, VAR_4) < 0) { error_report("invalid VAR_4"); return -1; } } return 0; }