qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/10] qerror: Extend QERR_DEVICE_ENCRYPTED


From: Luiz Capitulino
Subject: [Qemu-devel] [PATCH 08/10] qerror: Extend QERR_DEVICE_ENCRYPTED
Date: Mon, 9 Jan 2012 09:24:15 -0200

Include the name of the encrypted file.

Signed-off-by: Luiz Capitulino <address@hidden>
---
 monitor.c |    3 ++-
 qerror.h  |    2 +-
 qmp.c     |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/monitor.c b/monitor.c
index bd4bc4f..f85a9d2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4682,7 +4682,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 efda232..27800fe 100644
--- a/qerror.h
+++ b/qerror.h
@@ -70,7 +70,7 @@ QError *qobject_to_qerror(const QObject *obj);
     "{ 'class': 'CommandDisabled', '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 } }"
diff --git a/qmp.c b/qmp.c
index fb94f0f..00ae7ec 100644
--- a/qmp.c
+++ b/qmp.c
@@ -133,7 +133,8 @@ static void encrypted_bdrv_it(void *opaque, 
BlockDriverState *bs)
     Error **err = opaque;
 
     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));
     }
 }
 
-- 
1.7.8.2.325.g247f9.dirty




reply via email to

[Prev in Thread] Current Thread [Next in Thread]