int monitor_read_bdrv_key(BlockDriverState *bs)

{

    char password[256];

    int i;



    if (!bdrv_is_encrypted(bs))

        return 0;



    term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(bs),

                bdrv_get_encrypted_filename(bs));

    for(i = 0; i < 3; i++) {

        monitor_readline("Password: ", 1, password, sizeof(password));

        if (bdrv_set_key(bs, password) == 0)

            return 0;

        term_printf("invalid password\n");

    }

    return -EPERM;

}

int monitor_read_bdrv_key(BlockDriverState *bs)

{

    char password[256];

    int i;



    if (!bdrv_is_encrypted(bs))

        return 0;



    term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(bs),

                bdrv_get_encrypted_filename(bs));

    for(i = 0; i < 3; i++) {

        monitor_readline("Password: ", 1, password, sizeof(password));

        if (bdrv_set_key(bs, password) == 0)

            return 0;

        term_printf("invalid password\n");

    }

    return -EPERM;

}

int FUNC_0(BlockDriverState *VAR_0)

{

    char VAR_1[256];

    int VAR_2;



    if (!bdrv_is_encrypted(VAR_0))

        return 0;



    term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(VAR_0),

                bdrv_get_encrypted_filename(VAR_0));

    for(VAR_2 = 0; VAR_2 < 3; VAR_2++) {

        monitor_readline("Password: ", 1, VAR_1, sizeof(VAR_1));

        if (bdrv_set_key(VAR_0, VAR_1) == 0)

            return 0;

        term_printf("invalid VAR_1\n");

    }

    return -EPERM;

}

int FUNC_0(BlockDriverState *VAR_0)
{ char VAR_1[256]; int VAR_2; if (!bdrv_is_encrypted(VAR_0))
return 0; term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(VAR_0),
bdrv_get_encrypted_filename(VAR_0)); for(VAR_2 = 0; VAR_2 < 3; VAR_2++) { monitor_readline("Password: ", 1, VAR_1, sizeof(VAR_1)); if (bdrv_set_key(VAR_0, VAR_1) == 0)
return 0; term_printf("invalid VAR_1\n"); } return -EPERM; }