On Thu, Mar 31, 2011 at 11:05 AM, Kevin Wolf <kw...@redhat.com> wrote: > The other thing is that I'm not sure if everything in raw-posix is > prepared to deal with a -1 fd. At the very least, I think we'll get > -EBADF errors instead of the expected -ENOMEDIUM.
Not all of block.c checks for !bdrv_is_inserted() so you are right, I missed cases where we should return -ENOMEDIUM. We have a similar scenario with floppy disks where fd_open() can return leaving s->fd == -1. I would like to unify these floppy and CD-ROM open cases. Stefan