* [PATCH] linux-user: implement more loop ioctls
@ 2021-11-22 14:18 Andreas Schwab
2021-11-22 15:21 ` Laurent Vivier
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2021-11-22 14:18 UTC (permalink / raw)
To: Laurent Vivier; +Cc: qemu-devel
LOOP_CONFIGURE is now used by losetup, and it cannot cope with ENOSYS.
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
linux-user/ioctls.h | 4 ++++
linux-user/linux_loop.h | 2 ++
linux-user/syscall_defs.h | 4 ++++
linux-user/syscall_types.h | 6 ++++++
4 files changed, 16 insertions(+)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 7193c3b226..5ac5efc8aa 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -637,6 +637,10 @@
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_GET_STATUS64, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
+ IOCTL(LOOP_SET_CAPACITY, 0, TYPE_INT)
+ IOCTL(LOOP_SET_DIRECT_IO, 0, TYPE_INT)
+ IOCTL(LOOP_SET_BLOCK_SIZE, 0, TYPE_INT)
+ IOCTL(LOOP_CONFIGURE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_configure)))
IOCTL(LOOP_CTL_ADD, 0, TYPE_INT)
IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT)
diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
index c69fea11e4..f80b96f1ff 100644
--- a/linux-user/linux_loop.h
+++ b/linux-user/linux_loop.h
@@ -96,6 +96,8 @@ struct loop_info64 {
#define LOOP_CHANGE_FD 0x4C06
#define LOOP_SET_CAPACITY 0x4C07
#define LOOP_SET_DIRECT_IO 0x4C08
+#define LOOP_SET_BLOCK_SIZE 0x4C09
+#define LOOP_CONFIGURE 0x4C0A
/* /dev/loop-control interface */
#define LOOP_CTL_ADD 0x4C80
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index a5ce487dcc..560a29afd8 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1219,6 +1219,10 @@ struct target_rtc_pll_info {
#define TARGET_LOOP_SET_STATUS64 0x4C04
#define TARGET_LOOP_GET_STATUS64 0x4C05
#define TARGET_LOOP_CHANGE_FD 0x4C06
+#define TARGET_LOOP_SET_CAPACITY 0x4C07
+#define TARGET_LOOP_SET_DIRECT_IO 0x4C08
+#define TARGET_LOOP_SET_BLOCK_SIZE 0x4C09
+#define TARGET_LOOP_CONFIGURE 0x4C0A
#define TARGET_LOOP_CTL_ADD 0x4C80
#define TARGET_LOOP_CTL_REMOVE 0x4C81
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index ba2c1518eb..7c46e4fb25 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -201,6 +201,12 @@ STRUCT(loop_info64,
MK_ARRAY(TYPE_CHAR, 32), /* lo_encrypt_key */
MK_ARRAY(TYPE_ULONGLONG, 2)) /* lo_init */
+STRUCT(loop_configure,
+ TYPE_INT, /* fd */
+ TYPE_INT, /* block_size */
+ MK_STRUCT(STRUCT_loop_info64), /* info */
+ MK_ARRAY(TYPE_ULONGLONG, 8)) /* __reserved */
+
/* mag tape ioctls */
STRUCT(mtop, TYPE_SHORT, TYPE_INT)
STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG,
--
2.34.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] linux-user: implement more loop ioctls
2021-11-22 14:18 [PATCH] linux-user: implement more loop ioctls Andreas Schwab
@ 2021-11-22 15:21 ` Laurent Vivier
2021-11-22 15:56 ` [PATCH v2] " Andreas Schwab
0 siblings, 1 reply; 4+ messages in thread
From: Laurent Vivier @ 2021-11-22 15:21 UTC (permalink / raw)
To: Andreas Schwab; +Cc: qemu-devel
Le 22/11/2021 à 15:18, Andreas Schwab a écrit :
> LOOP_CONFIGURE is now used by losetup, and it cannot cope with ENOSYS.
>
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
> linux-user/ioctls.h | 4 ++++
> linux-user/linux_loop.h | 2 ++
> linux-user/syscall_defs.h | 4 ++++
> linux-user/syscall_types.h | 6 ++++++
> 4 files changed, 16 insertions(+)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index 7193c3b226..5ac5efc8aa 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -637,6 +637,10 @@
> IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
> IOCTL(LOOP_GET_STATUS64, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
> IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
> + IOCTL(LOOP_SET_CAPACITY, 0, TYPE_INT)
> + IOCTL(LOOP_SET_DIRECT_IO, 0, TYPE_INT)
> + IOCTL(LOOP_SET_BLOCK_SIZE, 0, TYPE_INT)
> + IOCTL(LOOP_CONFIGURE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_configure)))
>
> IOCTL(LOOP_CTL_ADD, 0, TYPE_INT)
> IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT)
> diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
> index c69fea11e4..f80b96f1ff 100644
> --- a/linux-user/linux_loop.h
> +++ b/linux-user/linux_loop.h
> @@ -96,6 +96,8 @@ struct loop_info64 {
> #define LOOP_CHANGE_FD 0x4C06
> #define LOOP_SET_CAPACITY 0x4C07
> #define LOOP_SET_DIRECT_IO 0x4C08
> +#define LOOP_SET_BLOCK_SIZE 0x4C09
> +#define LOOP_CONFIGURE 0x4C0A
>
> /* /dev/loop-control interface */
> #define LOOP_CTL_ADD 0x4C80
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index a5ce487dcc..560a29afd8 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -1219,6 +1219,10 @@ struct target_rtc_pll_info {
> #define TARGET_LOOP_SET_STATUS64 0x4C04
> #define TARGET_LOOP_GET_STATUS64 0x4C05
> #define TARGET_LOOP_CHANGE_FD 0x4C06
> +#define TARGET_LOOP_SET_CAPACITY 0x4C07
> +#define TARGET_LOOP_SET_DIRECT_IO 0x4C08
> +#define TARGET_LOOP_SET_BLOCK_SIZE 0x4C09
> +#define TARGET_LOOP_CONFIGURE 0x4C0A
>
> #define TARGET_LOOP_CTL_ADD 0x4C80
> #define TARGET_LOOP_CTL_REMOVE 0x4C81
> diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
> index ba2c1518eb..7c46e4fb25 100644
> --- a/linux-user/syscall_types.h
> +++ b/linux-user/syscall_types.h
> @@ -201,6 +201,12 @@ STRUCT(loop_info64,
> MK_ARRAY(TYPE_CHAR, 32), /* lo_encrypt_key */
> MK_ARRAY(TYPE_ULONGLONG, 2)) /* lo_init */
>
> +STRUCT(loop_configure,
It should be named "loop_config", like int he kernel.
Except that:
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> + TYPE_INT, /* fd */
> + TYPE_INT, /* block_size */
> + MK_STRUCT(STRUCT_loop_info64), /* info */
> + MK_ARRAY(TYPE_ULONGLONG, 8)) /* __reserved */
> +
> /* mag tape ioctls */
> STRUCT(mtop, TYPE_SHORT, TYPE_INT)
> STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG,
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] linux-user: implement more loop ioctls
2021-11-22 15:21 ` Laurent Vivier
@ 2021-11-22 15:56 ` Andreas Schwab
2021-11-22 16:07 ` Laurent Vivier
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2021-11-22 15:56 UTC (permalink / raw)
To: Laurent Vivier; +Cc: qemu-devel
LOOP_CONFIGURE is now used by losetup, and it cannot cope with ENOSYS.
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
v2: fix s/loop_configure/loop_config/ typo
linux-user/ioctls.h | 4 ++++
linux-user/linux_loop.h | 2 ++
linux-user/syscall_defs.h | 4 ++++
linux-user/syscall_types.h | 6 ++++++
4 files changed, 16 insertions(+)
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
index 7193c3b226..f182d40190 100644
--- a/linux-user/ioctls.h
+++ b/linux-user/ioctls.h
@@ -637,6 +637,10 @@
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_GET_STATUS64, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
+ IOCTL(LOOP_SET_CAPACITY, 0, TYPE_INT)
+ IOCTL(LOOP_SET_DIRECT_IO, 0, TYPE_INT)
+ IOCTL(LOOP_SET_BLOCK_SIZE, 0, TYPE_INT)
+ IOCTL(LOOP_CONFIGURE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_config)))
IOCTL(LOOP_CTL_ADD, 0, TYPE_INT)
IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT)
diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
index c69fea11e4..f80b96f1ff 100644
--- a/linux-user/linux_loop.h
+++ b/linux-user/linux_loop.h
@@ -96,6 +96,8 @@ struct loop_info64 {
#define LOOP_CHANGE_FD 0x4C06
#define LOOP_SET_CAPACITY 0x4C07
#define LOOP_SET_DIRECT_IO 0x4C08
+#define LOOP_SET_BLOCK_SIZE 0x4C09
+#define LOOP_CONFIGURE 0x4C0A
/* /dev/loop-control interface */
#define LOOP_CTL_ADD 0x4C80
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index a5ce487dcc..560a29afd8 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -1219,6 +1219,10 @@ struct target_rtc_pll_info {
#define TARGET_LOOP_SET_STATUS64 0x4C04
#define TARGET_LOOP_GET_STATUS64 0x4C05
#define TARGET_LOOP_CHANGE_FD 0x4C06
+#define TARGET_LOOP_SET_CAPACITY 0x4C07
+#define TARGET_LOOP_SET_DIRECT_IO 0x4C08
+#define TARGET_LOOP_SET_BLOCK_SIZE 0x4C09
+#define TARGET_LOOP_CONFIGURE 0x4C0A
#define TARGET_LOOP_CTL_ADD 0x4C80
#define TARGET_LOOP_CTL_REMOVE 0x4C81
diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
index ba2c1518eb..c3b43f8022 100644
--- a/linux-user/syscall_types.h
+++ b/linux-user/syscall_types.h
@@ -201,6 +201,12 @@ STRUCT(loop_info64,
MK_ARRAY(TYPE_CHAR, 32), /* lo_encrypt_key */
MK_ARRAY(TYPE_ULONGLONG, 2)) /* lo_init */
+STRUCT(loop_config,
+ TYPE_INT, /* fd */
+ TYPE_INT, /* block_size */
+ MK_STRUCT(STRUCT_loop_info64), /* info */
+ MK_ARRAY(TYPE_ULONGLONG, 8)) /* __reserved */
+
/* mag tape ioctls */
STRUCT(mtop, TYPE_SHORT, TYPE_INT)
STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG,
--
2.34.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] linux-user: implement more loop ioctls
2021-11-22 15:56 ` [PATCH v2] " Andreas Schwab
@ 2021-11-22 16:07 ` Laurent Vivier
0 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2021-11-22 16:07 UTC (permalink / raw)
To: Andreas Schwab; +Cc: qemu-devel
Le 22/11/2021 à 16:56, Andreas Schwab a écrit :
> LOOP_CONFIGURE is now used by losetup, and it cannot cope with ENOSYS.
>
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
> v2: fix s/loop_configure/loop_config/ typo
>
> linux-user/ioctls.h | 4 ++++
> linux-user/linux_loop.h | 2 ++
> linux-user/syscall_defs.h | 4 ++++
> linux-user/syscall_types.h | 6 ++++++
> 4 files changed, 16 insertions(+)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index 7193c3b226..f182d40190 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -637,6 +637,10 @@
> IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
> IOCTL(LOOP_GET_STATUS64, IOC_R, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
> IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
> + IOCTL(LOOP_SET_CAPACITY, 0, TYPE_INT)
> + IOCTL(LOOP_SET_DIRECT_IO, 0, TYPE_INT)
> + IOCTL(LOOP_SET_BLOCK_SIZE, 0, TYPE_INT)
> + IOCTL(LOOP_CONFIGURE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_config)))
>
> IOCTL(LOOP_CTL_ADD, 0, TYPE_INT)
> IOCTL(LOOP_CTL_REMOVE, 0, TYPE_INT)
> diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
> index c69fea11e4..f80b96f1ff 100644
> --- a/linux-user/linux_loop.h
> +++ b/linux-user/linux_loop.h
> @@ -96,6 +96,8 @@ struct loop_info64 {
> #define LOOP_CHANGE_FD 0x4C06
> #define LOOP_SET_CAPACITY 0x4C07
> #define LOOP_SET_DIRECT_IO 0x4C08
> +#define LOOP_SET_BLOCK_SIZE 0x4C09
> +#define LOOP_CONFIGURE 0x4C0A
>
> /* /dev/loop-control interface */
> #define LOOP_CTL_ADD 0x4C80
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index a5ce487dcc..560a29afd8 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -1219,6 +1219,10 @@ struct target_rtc_pll_info {
> #define TARGET_LOOP_SET_STATUS64 0x4C04
> #define TARGET_LOOP_GET_STATUS64 0x4C05
> #define TARGET_LOOP_CHANGE_FD 0x4C06
> +#define TARGET_LOOP_SET_CAPACITY 0x4C07
> +#define TARGET_LOOP_SET_DIRECT_IO 0x4C08
> +#define TARGET_LOOP_SET_BLOCK_SIZE 0x4C09
> +#define TARGET_LOOP_CONFIGURE 0x4C0A
>
> #define TARGET_LOOP_CTL_ADD 0x4C80
> #define TARGET_LOOP_CTL_REMOVE 0x4C81
> diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h
> index ba2c1518eb..c3b43f8022 100644
> --- a/linux-user/syscall_types.h
> +++ b/linux-user/syscall_types.h
> @@ -201,6 +201,12 @@ STRUCT(loop_info64,
> MK_ARRAY(TYPE_CHAR, 32), /* lo_encrypt_key */
> MK_ARRAY(TYPE_ULONGLONG, 2)) /* lo_init */
>
> +STRUCT(loop_config,
> + TYPE_INT, /* fd */
> + TYPE_INT, /* block_size */
> + MK_STRUCT(STRUCT_loop_info64), /* info */
> + MK_ARRAY(TYPE_ULONGLONG, 8)) /* __reserved */
> +
> /* mag tape ioctls */
> STRUCT(mtop, TYPE_SHORT, TYPE_INT)
> STRUCT(mtget, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG, TYPE_LONG,
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-22 16:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-22 14:18 [PATCH] linux-user: implement more loop ioctls Andreas Schwab
2021-11-22 15:21 ` Laurent Vivier
2021-11-22 15:56 ` [PATCH v2] " Andreas Schwab
2021-11-22 16:07 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).