From: Alexander Graf Date: Tue, 14 Apr 2009 16:26:33 +0200 Subject: qemu-cvs-ioctl_debug Extends unsupported ioctl debug output. Signed-off-by: Alexander Graf Signed-off-by: Ulrich Hecht [BR: minor edits to pass qemu's checkpatch script] Signed-off-by: Bruce Rogers --- linux-user/syscall.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4a66b6b0072fbeba0629bf93be29..6c1daf5addf0c8b746a7aafddbf7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5688,8 +5688,21 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg) ie = ioctl_entries; for(;;) { if (ie->target_cmd == 0) { + int i; qemu_log_mask( - LOG_UNIMP, "Unsupported ioctl: cmd=0x%04lx\n", (long)cmd); + LOG_UNIMP, "Unsupported ioctl: cmd=0x%04lx (%x)\n", (unsigned long)cmd, + (unsigned int)(cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) + >> TARGET_IOC_SIZESHIFT); + for (i = 0; ioctl_entries[i].target_cmd; i++) { + if ((ioctl_entries[i].target_cmd & ~(TARGET_IOC_SIZEMASK + << TARGET_IOC_SIZESHIFT)) == (cmd & ~(TARGET_IOC_SIZEMASK << + TARGET_IOC_SIZESHIFT))) + qemu_log_mask( + LOG_UNIMP, "%p\t->\t%s (%x)\n", (void *)(unsigned long) + ioctl_entries[i].host_cmd, ioctl_entries[i].name, + (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK + << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT); + } return -TARGET_ENOSYS; } if (ie->target_cmd == cmd)