qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] blockdev.c - bug
Date: Tue, 15 Oct 2013 09:12:50 +0800	[thread overview]
Message-ID: <20131015011250.GA19098@T430s.nay.redhat.com> (raw)
In-Reply-To: <1381796904.95421.YahooMailNeo@web163905.mail.gq1.yahoo.com>

On Mon, 10/14 17:28, Edivaldo de Araujo Pereira wrote:
> Dear qemu developers,
> 
> 
> I've noticed about 3 days ago a bug, apparently introduced by the last massive modifications in blockdev.c, that prevents the use of a cdrom ISO without write permission, like in "qemu-system-i386 -cdrom /some.iso ...", giving the message "could not open disk image /bpd/bpd.iso: Could not open file: Permission denied".
> 
> I didn't make a git bisect to identify the offending commit, but, as the problem seemed too simple, I've searched through the source code for references to "cdrom", "fopen", "media" and the like, trying to find any clue. My search was fruitful and I've been succesful in producing and testing the following patch. 
> 

Thanks for reporting this.

> I don't know if it is the best solution, as I don't really know the qemu source very well, but it works for me.
> 
> Thank you, very much.
> 
> Edivaldo de Araújo Pereira
> 
> 
> Patch:
> -------------------------------------------------------------------------------------------------------
> diff -rupN a/blockdev.c b/blockdev.c
> --- a/blockdev.c        2013-10-14 13:59:59.000000000 -0300
> +++ b/blockdev.c        2013-10-14 20:54:42.342329073 -0300
> @@ -709,7 +709,7 @@ DriveInfo *drive_init(QemuOpts *all_opts
> }
> 
> /* copy-on-read is disabled with a warning for read-only devices */
> -    read_only = qemu_opt_get_bool(legacy_opts, "read-only", false);
> +    read_only = ( qemu_opt_get_bool(legacy_opts, "read-only", false) || media == MEDIA_CDROM );

Media check is right above this stanza, we can set the value for it there.

> copy_on_read = qemu_opt_get_bool(legacy_opts, "copy-on-read", false);
> 
> if (read_only && copy_on_read) {
> 
> -------------------------------------------------------------------------------------------------------

Please use `git send-email` to format (and send) your email. See
http://qemu-project.org/Contribute/SubmitAPatch for instructions on sending
patches.

However as this is a short fix, I'll roll out a patch and Cc you.

Thanks.
Fam

      reply	other threads:[~2013-10-15  1:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15  0:28 [Qemu-devel] blockdev.c - bug Edivaldo de Araujo Pereira
2013-10-15  1:12 ` Fam Zheng [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=20131015011250.GA19098@T430s.nay.redhat.com \
    --to=famz@redhat.com \
    --cc=edivaldoapereira@yahoo.com.br \
    --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).