From: John Snow <jsnow@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, Colin Lord <clord@redhat.com>
Cc: mreitz@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org,
armbru@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] Report error when opening device with locked tray
Date: Tue, 7 Jun 2016 16:00:37 -0400 [thread overview]
Message-ID: <54e10e22-57ac-c56a-99ee-20116a08a45e@redhat.com> (raw)
In-Reply-To: <20160607102850.GD4684@noname.str.redhat.com>
On 06/07/2016 06:28 AM, Kevin Wolf wrote:
> Am 06.06.2016 um 21:40 hat Colin Lord geschrieben:
>> This commit causes qmp_blockdev_change_medium to report an error if an
>> attempt is made to open a device with a locked tray.
>
> The old behaviour is that the command seemingly succeeds, but the medium
> isn't actually changed. Correct?
>
Close. Old "change" command also fails, but with a confusing error.
> Should this be mentioned in the commit message? You just describe what
> you change, but not why.
>
Old behavior:
- Change uses qmp_blockdev_open_tray, which "succeeds."
- Change then tries to use qmp_x_blockdev_remove_medium, but receives
potentially confusing error "Tray is locked."
- Moments later, the tray is likely now open.
New behavior:
- Change uses do_open_tray, which returns -EINPROGRESS.
- Change can propagate this error upwards without attempting to remove
the medium.
- User gets "Device <foo> is locked and force was not specified, wait
for tray to open and try again" error.
Why: "The new error tries to inform the user that there is an action
pending and that the command, if run again, may succeed."
>> Signed-off-by: Colin Lord <clord@redhat.com>
>> This is based off my previous patch regarding the do_open_tray function
>> (currently at v3). Probably should have been submitted as a patch set
>> but I wasn't thinking that far ahead when I submitted the first patch.
>> ---
>> blockdev.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> Yes, would probably have made sense as a series, but as long as it's
> only two patches, it's not really a problem.
>
> Please make sure to put such comments below the "---" line, though, i.e.
> comments that make sense for the review, but not as part of the commit
> log. Then git-am automatically removes that part from the commit message
> while applying the patch. I did it manually for this one now.
>
> Kevin
>
--
—js
next prev parent reply other threads:[~2016-06-07 20:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 19:40 [Qemu-devel] [PATCH] Report error when opening device with locked tray Colin Lord
2016-06-07 10:28 ` Kevin Wolf
2016-06-07 20:00 ` John Snow [this message]
2016-06-08 8:20 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
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=54e10e22-57ac-c56a-99ee-20116a08a45e@redhat.com \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=clord@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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).