qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after med


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH v2 3/3] raw-posix: Re-open host CD-ROM after media change
Date: Mon, 04 Apr 2011 18:11:20 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.9

On 04/04/2011 06:09 PM, Stefan Hajnoczi wrote:
On Mon, Apr 4, 2011 at 2:49 PM, Avi Kivity<address@hidden>  wrote:
>  On 04/04/2011 04:38 PM, Anthony Liguori wrote:
>>
>>  On 04/04/2011 08:22 AM, Avi Kivity wrote:
>>>
>>>  On 04/03/2011 02:57 PM, Stefan Hajnoczi wrote:
>>>>
>>>>  In order for media change to work with Linux host CD-ROM it is
>>>>  necessary to reopen the file (otherwise the inode size will not
>>>>  refresh, this is an issue with existing kernels).
>>>>
>>>
>>>  Maybe we should fix the bug in Linux (and backport as necessary)?
>>>
>>>  I think cd-rom assignment is sufficiently obscure that we can require a
>>>  fixed kernel instead of providing a workaround.
>>
>>  Do reads fail after CD change?  Or do they succeed and the size is just
>>  reported incorrectly?
>>
>>  If it's the later, I'd agree that it needs fixing in the kernel.  If it's
>>  the former, I'd say it's clearly a feature.
>>
>
>  Even if it's a documented or intentional feature, we can add an ioctl to
>  "refresh" the device with up-to-date data.

It's possible to fix this in the kernel.  I just haven't written the
patch yet.  The inode size needs to be updated when the new medium is
detected.

I haven't tested but I suspect reads within the size of the previous
medium will succeed.  But if the new medium is larger then reads
beyond the old medium size will fail.

The size reported by lseek(fd, 0, SEEK_END) is outdated.

I believe a kernel fix is best in that case, leaving qemu alone.

--
error compiling committee.c: too many arguments to function




reply via email to

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