From: Laurent Vivier <laurent@vivier.eu>
To: Shu-Chun Weng <scw@google.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/8] linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls
Date: Tue, 11 Aug 2020 16:09:31 +0200 [thread overview]
Message-ID: <cd6fce1f-ea09-be73-bba4-5d5cb1776053@vivier.eu> (raw)
In-Reply-To: <020a4b8e2185a0aab62c99abd0d8f9d8ff315c37.1597129029.git.scw@google.com>
Le 11/08/2020 à 09:09, Shu-Chun Weng a écrit :
> Also reorder blocks so that they are all in the same order everywhere.
>
> Signed-off-by: Shu-Chun Weng <scw@google.com>
> ---
> v1 -> v2:
> Updated print_fcntl().
>
> linux-user/strace.c | 55 ++++++++++++++++++++++++++++++++-------
> linux-user/syscall.c | 10 +++++++
> linux-user/syscall_defs.h | 14 +++++-----
> 3 files changed, 64 insertions(+), 15 deletions(-)
>
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index 13981341b3..4fff24b880 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -1684,6 +1684,18 @@ print_fcntl(const struct syscallname *name,
> qemu_log("F_SETFL,");
> print_open_flags(arg2, 1);
> break;
> + case TARGET_F_OFD_GETLK:
> + qemu_log("F_OFD_GETLK,");
> + print_pointer(arg2, 1);
> + break;
> + case TARGET_F_OFD_SETLK:
> + qemu_log("F_OFD_SETLK,");
> + print_pointer(arg2, 1);
> + break;
> + case TARGET_F_OFD_SETLKW:
> + qemu_log("F_OFD_SETLKW,");
> + print_pointer(arg2, 1);
> + break;
> case TARGET_F_GETLK:
> qemu_log("F_GETLK,");
> print_pointer(arg2, 1);
> @@ -1726,26 +1738,51 @@ print_fcntl(const struct syscallname *name,
> #endif
> case TARGET_F_SETLEASE:
> qemu_log("F_SETLEASE,");
> - print_raw_param(TARGET_ABI_FMT_ld, arg2, 0);
> + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
> break;
> case TARGET_F_GETLEASE:
> qemu_log("F_GETLEASE");
> break;
> - case TARGET_F_SETPIPE_SZ:
> - qemu_log("F_SETPIPE_SZ,");
> - print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
> - break;
> - case TARGET_F_GETPIPE_SZ:
> - qemu_log("F_GETPIPE_SZ");
> - break;
> +#ifdef F_DUPFD_CLOEXEC
> case TARGET_F_DUPFD_CLOEXEC:
> qemu_log("F_DUPFD_CLOEXEC,");
> print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
> break;
> +#endif
> case TARGET_F_NOTIFY:
> qemu_log("F_NOTIFY,");
> - print_raw_param(TARGET_ABI_FMT_ld, arg2, 0);
> + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
> break;
> +#ifdef F_GETOWN_EX
> + case TARGET_F_GETOWN_EX:
> + qemu_log("F_GETOWN_EX,");
> + print_pointer(arg2, 1);
> + break;
> +#endif
> +#ifdef F_SETOWN_EX
> + case TARGET_F_SETOWN_EX:
> + qemu_log("F_SETOWN_EX,");
> + print_pointer(arg2, 1);
> + break;
> +#endif
> +#ifdef F_SETPIPE_SZ
> + case TARGET_F_SETPIPE_SZ:
> + qemu_log("F_SETPIPE_SZ,");
> + print_raw_param(TARGET_ABI_FMT_ld, arg2, 1);
> + break;
> + case TARGET_F_GETPIPE_SZ:
> + qemu_log("F_GETPIPE_SZ");
> + break;
> +#endif
> +#ifdef F_ADD_SEALS
> + case TARGET_F_ADD_SEALS:
> + qemu_log("F_ADD_SEALS,");
> + print_raw_param("0x"TARGET_ABI_FMT_lx, arg2, 1);
> + break;
> + case TARGET_F_GET_SEALS:
> + qemu_log("F_GET_SEALS");
> + break;
> +#endif
> default:
> print_raw_param(TARGET_ABI_FMT_ld, arg1, 0);
> print_pointer(arg2, 1);
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 945fc25279..5645862798 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -6305,6 +6305,14 @@ static int target_to_host_fcntl_cmd(int cmd)
> case TARGET_F_GETPIPE_SZ:
> ret = F_GETPIPE_SZ;
> break;
> +#endif
> +#ifdef F_ADD_SEALS
> + case TARGET_F_ADD_SEALS:
> + ret = F_ADD_SEALS;
> + break;
> + case TARGET_F_GET_SEALS:
> + ret = F_GET_SEALS;
> + break;
> #endif
> default:
> ret = -TARGET_EINVAL;
> @@ -6591,6 +6599,8 @@ static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
> case TARGET_F_GETLEASE:
> case TARGET_F_SETPIPE_SZ:
> case TARGET_F_GETPIPE_SZ:
> + case TARGET_F_ADD_SEALS:
> + case TARGET_F_GET_SEALS:
> ret = get_errno(safe_fcntl(fd, host_cmd, arg));
> break;
>
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index 3c261cff0e..70df1a94fb 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -2292,12 +2292,14 @@ struct target_statfs64 {
> #endif
>
> #define TARGET_F_LINUX_SPECIFIC_BASE 1024
> -#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0)
> -#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1)
> -#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6)
> -#define TARGET_F_SETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 7)
> -#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8)
> -#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE+2)
> +#define TARGET_F_SETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 0)
> +#define TARGET_F_GETLEASE (TARGET_F_LINUX_SPECIFIC_BASE + 1)
> +#define TARGET_F_DUPFD_CLOEXEC (TARGET_F_LINUX_SPECIFIC_BASE + 6)
> +#define TARGET_F_NOTIFY (TARGET_F_LINUX_SPECIFIC_BASE + 2)
> +#define TARGET_F_SETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 7)
> +#define TARGET_F_GETPIPE_SZ (TARGET_F_LINUX_SPECIFIC_BASE + 8)
> +#define TARGET_F_ADD_SEALS (TARGET_F_LINUX_SPECIFIC_BASE + 9)
> +#define TARGET_F_GET_SEALS (TARGET_F_LINUX_SPECIFIC_BASE + 10)
>
> #include "target_fcntl.h"
>
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
next prev parent reply other threads:[~2020-08-11 14:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-11 7:09 [PATCH v2 0/8] fcntl, sockopt, and ioctl options Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 1/8] linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls Shu-Chun Weng
2020-08-11 14:09 ` Laurent Vivier [this message]
2020-08-11 7:09 ` [PATCH v2 2/8] linux-user: add missing UDP get/setsockopt option Shu-Chun Weng
2020-08-11 14:21 ` Laurent Vivier
2020-08-11 20:04 ` Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 3/8] linux-user: add missing IPv6 " Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 4/8] linux-user: Add IPv6 options to do_print_sockopt() Shu-Chun Weng
2020-09-17 7:26 ` Shu-Chun Weng
2020-09-29 23:29 ` Laurent Vivier
2020-12-18 3:58 ` Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 5/8] linux-user: Update SO_TIMESTAMP to SO_TIMESTAMP_OLD/NEW Shu-Chun Weng
2020-09-17 7:29 ` Shu-Chun Weng
2020-12-18 4:01 ` Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 6/8] linux-user: setsockopt() SO_TIMESTAMPNS and SO_TIMESTAMPING Shu-Chun Weng
2020-12-18 4:02 ` Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 7/8] thunk: supports flexible arrays Shu-Chun Weng
2020-08-11 21:39 ` Shu-Chun Weng
2020-12-18 4:03 ` Shu-Chun Weng
2020-08-11 7:09 ` [PATCH v2 8/8] linux-user: Add support for SIOCETHTOOL ioctl Shu-Chun Weng
2020-12-18 4:03 ` Shu-Chun Weng
2020-12-18 8:24 ` [PATCH v2 0/8] fcntl, sockopt, and ioctl options Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cd6fce1f-ea09-be73-bba4-5d5cb1776053@vivier.eu \
--to=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=scw@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).