[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/16] linux-user: Add some new blk ioctls
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 12/16] linux-user: Add some new blk ioctls |
Date: |
Tue, 19 Jul 2016 15:54:10 +0300 |
From: Peter Maydell <address@hidden>
Add some new blk ioctls (these are 0x12,119 through
to 0x12,127). Several of these are used by mke2fs; this silences
the warnings:
mke2fs 1.42.12 (29-Aug-2014)
Unsupported ioctl: cmd=0x127b
Unsupported ioctl: cmd=0x127a
warning: Unable to get device geometry for /dev/loop5
Unsupported ioctl: cmd=0x127c
Unsupported ioctl: cmd=0x127c
Unsupported ioctl: cmd=0x1277
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/ioctls.h | 29 +++++++++++++++++++++++++++++
linux-user/syscall_defs.h | 11 +++++++++++
2 files changed, 40 insertions(+)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 33ede9c..4b36baa 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -80,6 +80,35 @@
IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT))
IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg,
MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg)))
+
+#ifdef BLKDISCARD
+ IOCTL(BLKDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
+#endif
+#ifdef BLKIOMIN
+ IOCTL(BLKIOMIN, IOC_R, MK_PTR(TYPE_INT))
+#endif
+#ifdef BLKIOOPT
+ IOCTL(BLKIOOPT, IOC_R, MK_PTR(TYPE_INT))
+#endif
+#ifdef BLKALIGNOFF
+ IOCTL(BLKALIGNOFF, IOC_R, MK_PTR(TYPE_INT))
+#endif
+#ifdef BLKPBSZGET
+ IOCTL(BLKPBSZGET, IOC_R, MK_PTR(TYPE_INT))
+#endif
+#ifdef BLKDISCARDZEROES
+ IOCTL(BLKDISCARDZEROES, IOC_R, MK_PTR(TYPE_INT))
+#endif
+#ifdef BLKSECDISCARD
+ IOCTL(BLKSECDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
+#endif
+#ifdef BLKROTATIONAL
+ IOCTL(BLKROTATIONAL, IOC_R, MK_PTR(TYPE_SHORT))
+#endif
+#ifdef BLKZEROOUT
+ IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
+#endif
+
#ifdef FIBMAP
IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
#endif
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 096f91c..7835654 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -985,6 +985,17 @@ struct target_pollfd {
#define TARGET_BLKGETSIZE64 TARGET_IOR(0x12,114,abi_ulong)
/* return device size in bytes
(u64 *arg) */
+
+#define TARGET_BLKDISCARD TARGET_IO(0x12, 119)
+#define TARGET_BLKIOMIN TARGET_IO(0x12, 120)
+#define TARGET_BLKIOOPT TARGET_IO(0x12, 121)
+#define TARGET_BLKALIGNOFF TARGET_IO(0x12, 122)
+#define TARGET_BLKPBSZGET TARGET_IO(0x12, 123)
+#define TARGET_BLKDISCARDZEROES TARGET_IO(0x12, 124)
+#define TARGET_BLKSECDISCARD TARGET_IO(0x12, 125)
+#define TARGET_BLKROTATIONAL TARGET_IO(0x12, 126)
+#define TARGET_BLKZEROOUT TARGET_IO(0x12, 127)
+
#define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */
#define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for
bmap */
#define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)
--
2.1.4
- [Qemu-devel] [PULL 01/16] linux-user: fd_trans_*_data() returns the length, (continued)
- [Qemu-devel] [PULL 01/16] linux-user: fd_trans_*_data() returns the length, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 04/16] linux-user: convert sockaddr_ll from host to target, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 02/16] linux-user: fix netlink memory corruption, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 06/16] linux-user: Check sigsetsize argument to syscalls, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 07/16] linux-user: Add loop control ioctls, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 08/16] linux-user: Correct type for BLKSSZGET, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 10/16] linux-user: Forget about synchronous signal once it is delivered, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 05/16] linux-user: add nested netlink types, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 11/16] linux-user: Handle short lengths in host_to_target_sockaddr(), riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 09/16] linux-user: Correct type for LOOP_GET_STATUS{, 64} ioctls, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 12/16] linux-user: Add some new blk ioctls,
riku . voipio <=
- [Qemu-devel] [PULL 13/16] TIOCGPTN and related terminal control ioctls were not converted to the guest ioctl format on x86_64 targets. Convert these ioctls to enable terminal functionality on x86_64 guests., riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 15/16] linux-user: Fix type for SIOCATMARK ioctl, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 14/16] linux-user: define missing sparc syscalls, riku . voipio, 2016/07/19
- [Qemu-devel] [PULL 16/16] linux-user: AArch64 has sync_file_range, not sync_file_range2, riku . voipio, 2016/07/19