提交 903a8814 编写于 作者: L Luiz Capitulino

qerror: Extend QERR_DEVICE_ENCRYPTED

Include the name of the encrypted file.
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 270b243f
...@@ -4682,7 +4682,8 @@ int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, ...@@ -4682,7 +4682,8 @@ int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
} }
if (monitor_ctrl_mode(mon)) { if (monitor_ctrl_mode(mon)) {
qerror_report(QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs)); qerror_report(QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs),
bdrv_get_encrypted_filename(bs));
return -1; return -1;
} }
......
...@@ -70,7 +70,7 @@ QError *qobject_to_qerror(const QObject *obj); ...@@ -70,7 +70,7 @@ QError *qobject_to_qerror(const QObject *obj);
"{ 'class': 'CommandDisabled', 'data': { 'name': %s } }" "{ 'class': 'CommandDisabled', 'data': { 'name': %s } }"
#define QERR_DEVICE_ENCRYPTED \ #define QERR_DEVICE_ENCRYPTED \
"{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }" "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s, 'filename': %s } }"
#define QERR_DEVICE_INIT_FAILED \ #define QERR_DEVICE_INIT_FAILED \
"{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }" "{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }"
......
...@@ -135,7 +135,8 @@ static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs) ...@@ -135,7 +135,8 @@ static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs)
Error **err = opaque; Error **err = opaque;
if (!error_is_set(err) && bdrv_key_required(bs)) { if (!error_is_set(err) && bdrv_key_required(bs)) {
error_set(err, QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs)); error_set(err, QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs),
bdrv_get_encrypted_filename(bs));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册