From patchwork Wed Jan 18 17:41:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 136671 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 8DD28B6F62 for ; Thu, 19 Jan 2012 05:06:02 +1100 (EST) Received: from localhost ([::1]:59417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnZX4-0000Qq-Ug for incoming@patchwork.ozlabs.org; Wed, 18 Jan 2012 12:42:46 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnZWb-0007XB-HU for qemu-devel@nongnu.org; Wed, 18 Jan 2012 12:42:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnZWZ-0000Pt-TM for qemu-devel@nongnu.org; Wed, 18 Jan 2012 12:42:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnZWZ-0000Pm-Mn for qemu-devel@nongnu.org; Wed, 18 Jan 2012 12:42:15 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0IHgEoU021227 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 18 Jan 2012 12:42:15 -0500 Received: from localhost (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0IHgCGu025184; Wed, 18 Jan 2012 12:42:14 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 18 Jan 2012 15:41:18 -0200 Message-Id: <1326908484-13389-9-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1326908484-13389-1-git-send-email-lcapitulino@redhat.com> References: <1326908484-13389-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 08/14] 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 f218485..9c9ea62 100644 --- a/qmp.c +++ b/qmp.c @@ -135,7 +135,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)); } }