qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

linux-user: Add loop control ioctls

Add support for the /dev/loop-control ioctls:
LOOP_CTL_ADD
LOOP_CTL_REMOVE
LOOP_CTL_GET_FREE

[RV: fixed to apply to new header guards]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

authored by

Peter Maydell and committed by
Riku Voipio
884cdc48 c815701e

+18 -1
+4
linux-user/ioctls.h
··· 327 327 IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64))) 328 328 IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT) 329 329 330 + IOCTL(LOOP_CTL_ADD, 0, TYPE_INT) 331 + IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT) 332 + IOCTL(LOOP_CTL_GET_FREE, 0, TYPE_NULL) 333 + 330 334 IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop))) 331 335 IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget))) 332 336 IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos)))
+10 -1
linux-user/linux_loop.h
··· 1 - /* Copied from 2.6.25 kernel headers to avoid problems on older hosts. */ 1 + /* Copied from 2.6.25 kernel headers to avoid problems on older hosts, 2 + * and subsequently updated to match newer additions to the API. 3 + */ 2 4 3 5 #ifndef LINUX_LOOP_H 4 6 #define LINUX_LOOP_H ··· 92 94 #define LOOP_SET_STATUS64 0x4C04 93 95 #define LOOP_GET_STATUS64 0x4C05 94 96 #define LOOP_CHANGE_FD 0x4C06 97 + #define LOOP_SET_CAPACITY 0x4C07 98 + #define LOOP_SET_DIRECT_IO 0x4C08 99 + 100 + /* /dev/loop-control interface */ 101 + #define LOOP_CTL_ADD 0x4C80 102 + #define LOOP_CTL_REMOVE 0x4C81 103 + #define LOOP_CTL_GET_FREE 0x4C82 95 104 96 105 #endif
+4
linux-user/syscall_defs.h
··· 1117 1117 #define TARGET_LOOP_GET_STATUS64 0x4C05 1118 1118 #define TARGET_LOOP_CHANGE_FD 0x4C06 1119 1119 1120 + #define TARGET_LOOP_CTL_ADD 0x4C80 1121 + #define TARGET_LOOP_CTL_REMOVE 0x4C81 1122 + #define TARGET_LOOP_CTL_GET_FREE 0x4C82 1123 + 1120 1124 /* fb ioctls */ 1121 1125 #define TARGET_FBIOGET_VSCREENINFO 0x4600 1122 1126 #define TARGET_FBIOPUT_VSCREENINFO 0x4601