On 14/03/2008, Jeff Dike <[EMAIL PROTECTED]> wrote: > On Thu, Mar 13, 2008 at 07:22:06PM +0100, Flavio wrote: > > ioctl(3, CDROMEJECT, 0) = -1 EINVAL (Invalid argument) > > > Try the patch below - compile tested only.
Thanks Jeff, I've just applied that patch successfully. Let me repeat the tests I made before, once the patch is working. Note that I've applied that patch to my 2.6.24 kernel tree (to the ubd_kern.c source file). That guest kernel have been already patched and compiled using skas4 (compiled again with your patch). I told you only to clarify what is the situation. Results: Scenario 1: it happens the same thing I previously described. ~# dmesg | grep cdrom Kernel command line: ubd0=rootfs.debian.etch ubd1=swapfs.debian ubd2=/dev/cdrom eth0=tuntap,,,192.168.1.101 mem=512M root=98:0 Couldn't open "/dev/cdrom", errno = 123 I can also read some significant messages during the boot process: Initializing software serial port version 1 console [mc-1] enabled ubda: unknown partition table ubdb: unknown partition table Couldn't open "/dev/cdrom", errno = 123 Failed to initialize ubd device 2 :Couldn't determine size of device's file The /dev/ubd2 node seems to be present as well as for the /dev/ubdc. Scenario 2: I get the same message above as regard boot messages. But I still get these: ~# eject /dev/ubd2 not an sg device, or old sg driver eject: unable to eject, last error: Invalid argument ~# dmesg | grep cdrom Kernel command line: ubd0=rootfs.debian.etch ubd1=swapfs.debian ubd2=/dev/cdrom eth0=tuntap,,,192.168.1.101 mem=512M root=98:0 2.1) Same result I posted last time. 2.2) Same result I posted last time. Let me give you the strace eject /dev/ubd2 again, it may helps you to understand. (I don't know if it's the same strace I posted before) ~# strace eject /dev/ubd2 execve("/usr/bin/eject", ["eject", "/dev/ubd2"], [/* 12 vars */]) = 0 brk(0) = 0x606000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001d000 uname({sys="Linux", node="DebianUM", ...}) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=24172, ...}) = 0 mmap(NULL, 24172, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40020000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\342"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1420624, ...}) = 0 mmap(NULL, 3527256, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4021e000 mprotect(0x40372000, 2097152, PROT_NONE) = 0 mmap(0x40572000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x154000) = 0x40572000 mmap(0x40577000, 16984, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40577000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40026000 arch_prctl(ARCH_SET_FS, 0x400266e0) = 0 mprotect(0x40572000, 12288, PROT_READ) = 0 munmap(0x40020000, 24172) = 0 brk(0) = 0x606000 brk(0x627000) = 0x627000 access("/dev/ubd2", F_OK) = 0 readlink("/dev/ubd2", 0x7f7fa7bab0, 4095) = -1 EINVAL (Invalid argument) stat("/dev/ubd2", {st_mode=S_IFBLK|0644, st_rdev=makedev(98, 32), ...}) = 0 open("/etc/mtab", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=144, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40020000 read(3, "/dev/ubd0 / ext3 rw 0 0\nproc /pr"..., 4096) = 144 stat("/dev/ubd0", {st_mode=S_IFBLK|0644, st_rdev=makedev(98, 0), ...}) = 0 stat("proc", 0x7f7fa789d0) = -1 ENOENT (No such file or directory) stat("sysfs", 0x7f7fa789d0) = -1 ENOENT (No such file or directory) stat("tmpfs", 0x7f7fa789d0) = -1 ENOENT (No such file or directory) stat("devpts", 0x7f7fa789d0) = -1 ENOENT (No such file or directory) read(3, "", 4096) = 0 close(3) = 0 munmap(0x40020000, 4096) = 0 open("/etc/fstab", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=209, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40020000 read(3, "# UNCONFIGURED FSTAB FOR BASE SY"..., 4096) = 209 read(3, "", 4096) = 0 close(3) = 0 munmap(0x40020000, 4096) = 0 stat("/dev/ubd2", {st_mode=S_IFBLK|0644, st_rdev=makedev(98, 32), ...}) = 0 open("/dev/ubd2", O_RDWR|O_NONBLOCK) = 3 ioctl(3, CDROMEJECT, 0) = -1 EIO (Input/output error) ioctl(3, SG_GET_VERSION_NUM, 0x7f7fa78a4c) = -1 EINVAL (Invalid argument) fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 1), ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40020000 write(1, "not an sg device, or old sg driv"..., 35not an sg device, or old sg driver ) = 35 ioctl(3, FDEJECT, 0x40577980) = -1 EINVAL (Invalid argument) ioctl(3, MGSL_IOCGPARAMS or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7f7fa7d6b0) = -1 EINVAL (Invalid argument) write(2, "eject: unable to eject, last err"..., 53eject: unable to eject, last error: Invalid argument ) = 53 exit_group(1) = ? Process 1140 detached Best regards, Flavio ------------------------------------------------------------------------- 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 User-mode-linux-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user