From: Markus Armbruster <armbru@redhat.com>
To: Yury Kotov <yury-kotov@yandex-team.ru>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find
Date: Tue, 14 May 2019 16:00:19 +0200 [thread overview]
Message-ID: <8736lhf85o.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190514131552.15832-1-yury-kotov@yandex-team.ru> (Yury Kotov's message of "Tue, 14 May 2019 16:15:52 +0300")
Yury Kotov <yury-kotov@yandex-team.ru> writes:
> monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find()
> returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads to
Grammar nits:
s/returns/return/
s/Downcast/Downcasting/
> a bug with removing fd from fdset which id >= 2^32.
s/which/with/
> So, fix return types for these function.
>
> Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru>
> ---
If I feed your message to git-am, I get
Applying: monitor: Fix return type of monitor_fdset_dup_fd_find
error: corrupt patch at line 12
Patch failed at 0001 monitor: Fix return type of monitor_fdset_dup_fd_find
[...]
Did you use git-send-email?
> include/monitor/monitor.h | 2 +-
> monitor.c | 4 ++--
> stubs/fdset.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
> index c1b40a9cac..2872621afd 100644
> --- a/include/monitor/monitor.h
> +++ b/include/monitor/monitor.h
> @@ -46,7 +46,7 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_=
> id, int64_t fdset_id,
> int monitor_fdset_get_fd(int64_t fdset_id, int flags);
> int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd);
> void monitor_fdset_dup_fd_remove(int dup_fd);
> -int monitor_fdset_dup_fd_find(int dup_fd);
> +int64_t monitor_fdset_dup_fd_find(int dup_fd);
> =20
Looks mime-damaged.
> void monitor_vfprintf(FILE *stream,
> const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
> diff --git a/monitor.c b/monitor.c
> index 4807bbe811..50e6e820d6 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -2585,7 +2585,7 @@ err:
> return -1;
> }
> =20
> -static int monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)
> +static int64_t monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)
> {
> MonFdset *mon_fdset;
> MonFdsetFd *mon_fdset_fd_dup;
> @@ -2613,7 +2613,7 @@ err:
> return -1;
> }
> =20
> -int monitor_fdset_dup_fd_find(int dup_fd)
> +int64_t monitor_fdset_dup_fd_find(int dup_fd)
> {
> return monitor_fdset_dup_fd_find_remove(dup_fd, false);
> }
> diff --git a/stubs/fdset.c b/stubs/fdset.c
> index 4f3edf2ea4..a1b8f41f62 100644
> --- a/stubs/fdset.c
> +++ b/stubs/fdset.c
> @@ -7,7 +7,7 @@ int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd=
> )
> return -1;
> }
> =20
> -int monitor_fdset_dup_fd_find(int dup_fd)
> +int64_t monitor_fdset_dup_fd_find(int dup_fd)
> {
> return -1;
> }
> --=20
> 2.21.0
The patch is complete because:
* monitor_fdset_dup_fd_find_remove() is used only by
monitor_fdset_dup_fd_find(), which you fix as well, and
monitor_fdset_dup_fd_remove(), which ignores the return value.
* monitor_fdset_dup_fd_find() is used only by qemu_close(), which stores
the return value in an int64_t.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Yury Kotov <yury-kotov@yandex-team.ru>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find
Date: Tue, 14 May 2019 16:00:19 +0200 [thread overview]
Message-ID: <8736lhf85o.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190514131552.15832-1-yury-kotov@yandex-team.ru> (Yury Kotov's message of "Tue, 14 May 2019 16:15:52 +0300")
Yury Kotov <yury-kotov@yandex-team.ru> writes:
> monitor_fdset_dup_fd_find_remove() and monitor_fdset_dup_fd_find()
> returns mon_fdset->id which is int64_t. Downcast from int64_t to int leads to
Grammar nits:
s/returns/return/
s/Downcast/Downcasting/
> a bug with removing fd from fdset which id >= 2^32.
s/which/with/
> So, fix return types for these function.
>
> Signed-off-by: Yury Kotov <yury-kotov@yandex-team.ru>
> ---
If I feed your message to git-am, I get
Applying: monitor: Fix return type of monitor_fdset_dup_fd_find
error: corrupt patch at line 12
Patch failed at 0001 monitor: Fix return type of monitor_fdset_dup_fd_find
[...]
Did you use git-send-email?
> include/monitor/monitor.h | 2 +-
> monitor.c | 4 ++--
> stubs/fdset.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
> index c1b40a9cac..2872621afd 100644
> --- a/include/monitor/monitor.h
> +++ b/include/monitor/monitor.h
> @@ -46,7 +46,7 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_=
> id, int64_t fdset_id,
> int monitor_fdset_get_fd(int64_t fdset_id, int flags);
> int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd);
> void monitor_fdset_dup_fd_remove(int dup_fd);
> -int monitor_fdset_dup_fd_find(int dup_fd);
> +int64_t monitor_fdset_dup_fd_find(int dup_fd);
> =20
Looks mime-damaged.
> void monitor_vfprintf(FILE *stream,
> const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
> diff --git a/monitor.c b/monitor.c
> index 4807bbe811..50e6e820d6 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -2585,7 +2585,7 @@ err:
> return -1;
> }
> =20
> -static int monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)
> +static int64_t monitor_fdset_dup_fd_find_remove(int dup_fd, bool remove)
> {
> MonFdset *mon_fdset;
> MonFdsetFd *mon_fdset_fd_dup;
> @@ -2613,7 +2613,7 @@ err:
> return -1;
> }
> =20
> -int monitor_fdset_dup_fd_find(int dup_fd)
> +int64_t monitor_fdset_dup_fd_find(int dup_fd)
> {
> return monitor_fdset_dup_fd_find_remove(dup_fd, false);
> }
> diff --git a/stubs/fdset.c b/stubs/fdset.c
> index 4f3edf2ea4..a1b8f41f62 100644
> --- a/stubs/fdset.c
> +++ b/stubs/fdset.c
> @@ -7,7 +7,7 @@ int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd=
> )
> return -1;
> }
> =20
> -int monitor_fdset_dup_fd_find(int dup_fd)
> +int64_t monitor_fdset_dup_fd_find(int dup_fd)
> {
> return -1;
> }
> --=20
> 2.21.0
The patch is complete because:
* monitor_fdset_dup_fd_find_remove() is used only by
monitor_fdset_dup_fd_find(), which you fix as well, and
monitor_fdset_dup_fd_remove(), which ignores the return value.
* monitor_fdset_dup_fd_find() is used only by qemu_close(), which stores
the return value in an int64_t.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
next prev parent reply other threads:[~2019-05-14 14:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-14 13:15 [Qemu-trivial] [PATCH RESEND] monitor: Fix return type of monitor_fdset_dup_fd_find Yury Kotov
2019-05-14 13:15 ` [Qemu-devel] " Yury Kotov
2019-05-14 14:00 ` Markus Armbruster [this message]
2019-05-14 14:00 ` Markus Armbruster
2019-05-14 14:59 ` [Qemu-trivial] " Yury Kotov
2019-05-14 14:59 ` [Qemu-devel] [Qemu-trivial] " Yury Kotov
2019-05-14 14:05 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2019-05-14 14:05 ` Eric Blake
2019-05-14 14:51 ` [Qemu-trivial] " Yury Kotov
2019-05-14 14:51 ` Yury Kotov
2019-05-14 17:01 ` [Qemu-trivial] " Markus Armbruster
2019-05-14 17:01 ` Markus Armbruster
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=8736lhf85o.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=yury-kotov@yandex-team.ru \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.