On Tue, Mar 18, 2008 at 12:30:53PM +0100, Flavio wrote:
> >
> > As a sanity-check, you can do this again, look for the line above, and
> > make sure the file descriptor (16 in this case) refers to /dev/cdrom.
> > Look in /proc/<pid>/fd for the same pid that you strace.
> I don't know why I don't have the /proc/16 directory.
> As a matter of fact I don't know how to exactly verify if the fd 16
> refers to /dev/cdrom (maybe there's some file to cat).
You forgot the pid.
> >
> > As another sanity-check, strace eject running on the host. It's
> > possible that CDROMEJECT fails the same way and one of its fallbacks
> > works. In that case, I just need to make UML use the same fallbacks.
> As I said before, eject perfectly works on the host.
> This is the strace 'eject /dev/cdrom' output related to the above line:
> ioctl(3, CDROMEJECT, 0x1) = 0
I just noticed something. I forgot to pass down the ioctl argument.
See if the patch below makes any differece.
> And the directory /proc/3/ exists on the host.
/proc/3 is irrelevant. You want /proc/<eject-pid>/3.
Jeff
--
Work email - jdike at linux dot intel dot com
Index: linux-2.6.22/arch/um/drivers/ubd_kern.c
===================================================================
--- linux-2.6.22.orig/arch/um/drivers/ubd_kern.c 2008-03-06
08:57:08.000000000 -0500
+++ linux-2.6.22/arch/um/drivers/ubd_kern.c 2008-03-18 11:29:55.000000000
-0400
@@ -1162,6 +1162,10 @@ static int ubd_ioctl(struct inode * inod
if(copy_to_user((char __user *) arg, &volume, sizeof(volume)))
return -EFAULT;
return 0;
+ case CDROMEJECT:
+ if (ubd_dev->fd == -1)
+ return -ENXIO;
+ return os_ioctl_generic(ubd_dev->fd, CDROMEJECT, arg);
}
return -EINVAL;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user