qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] blockdev.c - bug


From: Fam Zheng
Subject: Re: [Qemu-devel] blockdev.c - bug
Date: Tue, 15 Oct 2013 09:12:50 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]