mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Wrong error message in block_passwd command
Signed-off-by: Shahar Havivi <shaharh@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
25b28f01d8
commit
fd04a2aeda
2 changed files with 11 additions and 3 deletions
|
@ -1057,6 +1057,7 @@ static int do_block_set_passwd(Monitor *mon, const QDict *qdict,
|
|||
QObject **ret_data)
|
||||
{
|
||||
BlockDriverState *bs;
|
||||
int err;
|
||||
|
||||
bs = bdrv_find(qdict_get_str(qdict, "device"));
|
||||
if (!bs) {
|
||||
|
@ -1064,7 +1065,11 @@ static int do_block_set_passwd(Monitor *mon, const QDict *qdict,
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (bdrv_set_key(bs, qdict_get_str(qdict, "password")) < 0) {
|
||||
err = bdrv_set_key(bs, qdict_get_str(qdict, "password"));
|
||||
if (err == -EINVAL) {
|
||||
qerror_report(QERR_DEVICE_NOT_ENCRYPTED, bdrv_get_device_name(bs));
|
||||
return -1;
|
||||
} else if (err < 0) {
|
||||
qerror_report(QERR_INVALID_PASSWORD);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue