From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: Assume raw for drives without media
Date: Tue, 01 Jun 2010 10:15:33 -0700 [thread overview]
Message-ID: <1275412533.16953.0.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <1275411000-27324-1-git-send-email-kwolf@redhat.com>
On Tue, 2010-06-01 at 18:50 +0200, Kevin Wolf wrote:
> qemu -cdrom /dev/cdrom with an empty CD-ROM drive doesn't work any more because
> we try to guess the format and when this fails (because there is no medium) we
> exit with an error message.
>
> This patch should restore the old behaviour by assuming raw format for such
> drives.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block.c b/block.c
> index d789d02..7dded4e 100644
> --- a/block.c
> +++ b/block.c
> @@ -331,8 +331,8 @@ static BlockDriver *find_image_format(const char *filename)
> if (ret < 0)
> return NULL;
>
> - /* Return the raw BlockDriver * to scsi-generic devices */
> - if (bs->sg) {
> + /* Return the raw BlockDriver * to scsi-generic devices or empty drives */
> + if (bs->sg || !bdrv_is_inserted(bs)) {
> bdrv_delete(bs);
> return bdrv_find_format("raw");
> }
Makes sense to me.
Acked-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
prev parent reply other threads:[~2010-06-01 17:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 16:50 [Qemu-devel] [PATCH] block: Assume raw for drives without media Kevin Wolf
2010-06-01 17:15 ` Nicholas A. Bellinger [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=1275412533.16953.0.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=kwolf@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).