summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-07-04 17:06:17 +0100
committerRiku Voipio <riku.voipio@linaro.org>2016-07-19 15:22:33 +0300
commit884cdc48a98fca7d758a5934af526cd1fcedcc9e (patch)
tree1e7e24477303fddcc8c875c11db3c8380b333898
parentc815701e8169d25ae6f84183f4b593b9335a9798 (diff)
downloadfocaccia-qemu-884cdc48a98fca7d758a5934af526cd1fcedcc9e.tar.gz
focaccia-qemu-884cdc48a98fca7d758a5934af526cd1fcedcc9e.zip
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>
-rw-r--r--linux-user/ioctls.h4
-rw-r--r--linux-user/linux_loop.h11
-rw-r--r--linux-user/syscall_defs.h4
3 files changed, 18 insertions, 1 deletions
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index e672655100..abff6b6e7d 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -327,6 +327,10 @@
   IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
   IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
 
+  IOCTL(LOOP_CTL_ADD, 0, TYPE_INT)
+  IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT)
+  IOCTL(LOOP_CTL_GET_FREE, 0, TYPE_NULL)
+
   IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
   IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget)))
   IOCTL(MTIOCPOS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtpos)))
diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
index 1f52403814..c69fea11e4 100644
--- a/linux-user/linux_loop.h
+++ b/linux-user/linux_loop.h
@@ -1,4 +1,6 @@
-/* Copied from 2.6.25 kernel headers to avoid problems on older hosts.  */
+/* Copied from 2.6.25 kernel headers to avoid problems on older hosts,
+ * and subsequently updated to match newer additions to the API.
+ */
 
 #ifndef LINUX_LOOP_H
 #define LINUX_LOOP_H
@@ -92,5 +94,12 @@ struct loop_info64 {
 #define LOOP_SET_STATUS64	0x4C04
 #define LOOP_GET_STATUS64	0x4C05
 #define LOOP_CHANGE_FD		0x4C06
+#define LOOP_SET_CAPACITY       0x4C07
+#define LOOP_SET_DIRECT_IO      0x4C08
+
+/* /dev/loop-control interface */
+#define LOOP_CTL_ADD            0x4C80
+#define LOOP_CTL_REMOVE         0x4C81
+#define LOOP_CTL_GET_FREE       0x4C82
 
 #endif
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index b43966ece0..096f91ce83 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1117,6 +1117,10 @@ struct target_pollfd {
 #define TARGET_LOOP_GET_STATUS64      0x4C05
 #define TARGET_LOOP_CHANGE_FD         0x4C06
 
+#define TARGET_LOOP_CTL_ADD           0x4C80
+#define TARGET_LOOP_CTL_REMOVE        0x4C81
+#define TARGET_LOOP_CTL_GET_FREE      0x4C82
+
 /* fb ioctls */
 #define TARGET_FBIOGET_VSCREENINFO    0x4600
 #define TARGET_FBIOPUT_VSCREENINFO    0x4601