From patchwork Mon Jan 9 11:24:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 135002 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4D17EB6F71 for ; Mon, 9 Jan 2012 22:57:59 +1100 (EST) Received: from localhost ([::1]:42526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkDMi-0004hj-PD for incoming@patchwork.ozlabs.org; Mon, 09 Jan 2012 06:26:12 -0500 Received: from eggs.gnu.org ([140.186.70.92]:52698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkDLN-0001Iz-Oa for qemu-devel@nongnu.org; Mon, 09 Jan 2012 06:24:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkDLM-0006io-Q8 for qemu-devel@nongnu.org; Mon, 09 Jan 2012 06:24:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkDLM-0006ic-46 for qemu-devel@nongnu.org; Mon, 09 Jan 2012 06:24:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q09BObUo005200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Jan 2012 06:24:37 -0500 Received: from localhost (ovpn-113-68.phx2.redhat.com [10.3.113.68]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q09BOa1b031291; Mon, 9 Jan 2012 06:24:37 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Mon, 9 Jan 2012 09:24:15 -0200 Message-Id: <1326108257-13042-9-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1326108257-13042-1-git-send-email-lcapitulino@redhat.com> References: <1326108257-13042-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 08/10] qerror: Extend QERR_DEVICE_ENCRYPTED X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Include the name of the encrypted file. Signed-off-by: Luiz Capitulino --- 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)); } }