From: Stefan Hajnoczi <stefanha@gmail.com>
To: Pavel Hrdina <phrdina@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 3/3] blockdev: do not open block device if password is not required but user provides one
Date: Wed, 3 Jul 2013 12:31:14 +0200 [thread overview]
Message-ID: <20130703103114.GA17929@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <7b4a213d18eb103fb737286ab4e5b641317e1d8d.1372072312.git.phrdina@redhat.com>
On Mon, Jun 24, 2013 at 02:12:52PM +0200, Pavel Hrdina wrote:
> This fixes the issue that block device is openned successfully with an error
> as warning if password is provided but not required. Now the open fails with
> the error message.
>
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
> blockdev.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index 2dbd781..7fc8dcf 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1065,6 +1065,11 @@ static void qmp_bdrv_open_encrypted(BlockDriverState *bs, const char *filename,
> {
> int ret;
>
> + if (!bdrv_key_required(bs) && password) {
> + error_set(errp, QERR_DEVICE_NOT_ENCRYPTED, bdrv_get_device_name(bs));
> + return;
> + }
> +
> ret = bdrv_open(bs, filename, NULL, bdrv_flags, drv);
How can bdrv_key_required(bs) work when bs isn't opened yet?
prev parent reply other threads:[~2013-07-03 10:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 12:12 [Qemu-devel] [PATCH v4 0/3] block: fix spurious DEVICE_TRAY_MOVED events on shutdown Pavel Hrdina
2013-06-24 12:12 ` [Qemu-devel] [PATCH v4 1/3] block: make bdrv_dev_change_media_cb() public Pavel Hrdina
2013-06-24 12:12 ` [Qemu-devel] [PATCH v4 2/3] block: move the bdrv_dev_change_media_cb() Pavel Hrdina
2013-06-24 12:12 ` [Qemu-devel] [PATCH v4 3/3] blockdev: do not open block device if password is not required but user provides one Pavel Hrdina
2013-07-03 10:31 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130703103114.GA17929@stefanha-thinkpad.muc.redhat.com \
--to=stefanha@gmail.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=phrdina@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).