[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/15] qerror: add additional parameter to QERR_DEVI
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 08/15] qerror: add additional parameter to QERR_DEVICE_ENCRYPTED |
Date: |
Fri, 2 Sep 2011 12:34:51 -0500 |
Changing an encrypted block device requires a flow of:
1) change device
2) receive error from change
3) block_passwd
DeviceEncrypted receives the device name but with a block backend with multiple
backing files, any one of the backing files could be encrypted. From a UI
perspective, you have no way of knowing which file is encrypted without parsing
the qcow2 files :-/
Add the actual encrypted filename to the error message so that a UI can display
that information to the user.
Signed-off-by: Anthony Liguori <address@hidden>
---
monitor.c | 3 ++-
qerror.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/monitor.c b/monitor.c
index fa93239..c6da388 100644
--- a/monitor.c
+++ b/monitor.c
@@ -5321,7 +5321,8 @@ int monitor_read_bdrv_key_start(Monitor *mon,
BlockDriverState *bs,
}
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;
}
diff --git a/qerror.h b/qerror.h
index 4fe24aa..3bbff5c 100644
--- a/qerror.h
+++ b/qerror.h
@@ -64,7 +64,7 @@ QError *qobject_to_qerror(const QObject *obj);
"{ 'class': 'CommandNotFound', 'data': { 'name': %s } }"
#define QERR_DEVICE_ENCRYPTED \
- "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }"
+ "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s, 'filename': %s} }"
#define QERR_DEVICE_INIT_FAILED \
"{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }"
--
1.7.4.1
- [Qemu-devel] [PATCH 00/15] Convert commands to QAPI (batch 1) (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 01/15] error: let error_is_type take a NULL error, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 02/15] qerror: add qerror_report_err() (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 03/15] qapi: add code generation support for middle mode, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 04/15] qapi: use middle mode in QMP server (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 05/15] qapi: convert query-name, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 07/15] monitor: expose readline state, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 08/15] qerror: add additional parameter to QERR_DEVICE_ENCRYPTED,
Anthony Liguori <=
- [Qemu-devel] [PATCH 06/15] block: add unsafe_probe, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 09/15] qapi: convert eject (qmp and hmp) to QAPI, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 10/15] qapi: convert block_passwd and add set-blockdev-password, Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 11/15] qapi: add change-vnc-password (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 12/15] qapi: add change-vnc-listen (v2), Anthony Liguori, 2011/09/02
- [Qemu-devel] [PATCH 13/15] qapi: introduce drive-change (v2), Anthony Liguori, 2011/09/02