linux-user: Ignore broken loop ioctl
authorAlexander Graf <agraf@suse.de>
Tue, 12 Jun 2012 02:41:10 +0000 (04:41 +0200)
committerChanho Park <parkch98@gmail.com>
Tue, 9 Sep 2014 02:32:50 +0000 (11:32 +0900)
During invocations of losetup, we run into an ioctl that doesn't
exist. However, because of that we output an error, which then
screws up the kiwi logic around that call.

So let's silently ignore that bogus ioctl.

Signed-off-by: Alexander Graf <agraf@suse.de>
[AF: Rebased for v2.1.0-rc0]
Signed-off-by: Andreas Färber <afaerber@suse.de>
linux-user/ioctls.h
linux-user/linux_loop.h
linux-user/syscall.c
linux-user/syscall_defs.h

index d2b7a50..0680dc4 100644 (file)
   IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
   IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
   IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
+  IOCTL_SPECIAL(LOOP_BOGUS_CMD, 0, do_ioctl_fail, TYPE_INT)
 
   IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
   IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget)))
index 8974caa..810ae61 100644 (file)
@@ -91,5 +91,6 @@ struct loop_info64 {
 #define LOOP_SET_STATUS64      0x4C04
 #define LOOP_GET_STATUS64      0x4C05
 #define LOOP_CHANGE_FD         0x4C06
+#define LOOP_BOGUS_CMD         0x4C82
 
 #endif
index 701809e..4ce7b84 100644 (file)
@@ -3722,6 +3722,13 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp,
     return get_errno(ioctl(fd, ie->host_cmd, sig));
 }
 
+static abi_long do_ioctl_fail(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
+                              abi_long cmd, abi_long arg)
+{
+    /* Fail silently */
+    return -EINVAL;
+}
+
 static IOCTLEntry ioctl_entries[] = {
 #define IOCTL(cmd, access, ...) \
     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
index e4ae769..a6aa6b5 100644 (file)
@@ -1061,6 +1061,7 @@ struct target_pollfd {
 #define TARGET_LOOP_SET_STATUS64      0x4C04
 #define TARGET_LOOP_GET_STATUS64      0x4C05
 #define TARGET_LOOP_CHANGE_FD         0x4C06
+#define TARGET_LOOP_BOGUS_CMD         0x4C82
 
 /* fb ioctls */
 #define TARGET_FBIOGET_VSCREENINFO    0x4600