From: Manolo de Medici <manolodemedici@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, bug-hurd@gnu.org,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 2/4] Avoid multiple definitions of copy_file_range
Date: Wed, 17 Jan 2024 15:09:39 +0100 [thread overview]
Message-ID: <CAHP40mkNb5EH_Js02LpENMc2CA2pj7fEJY_S1sTMNWh_3rcUEQ@mail.gmail.com> (raw)
In-Reply-To: <37ef47fc-92a5-4ffe-9677-2bc013cfe20b@linaro.org>
Hello Philippe,
thank you for the feedback, I've checked that. The problem is that the
Hurd fails that test due to the following:
#if defined __stub_copy_file_range || defined __stub___copy_file_range
fail fail fail this function is not going to work
#endifefines the stub __copy_file_ran
rightfully so I'd say, because copy_file_range is just a stub on the Hurd.
As such, we really need to exclude the code that defines the stub in
qemu on the Hurd.
On Wed, Jan 17, 2024 at 2:56 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Hi Manolo,
>
> On 17/1/24 13:31, Manolo de Medici wrote:
> > It's already defined as a stub on the GNU Hurd.
>
> Meson checks for this function and defines
> HAVE_COPY_FILE_RANGE if available, see in meson.build:
>
> config_host_data.set('HAVE_COPY_FILE_RANGE',
> cc.has_function('copy_file_range'))
>
> Maybe some header is missing in "osdep.h" for GNU Hurd?
>
> > Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
> >
> > diff --git a/block/file-posix.c b/block/file-posix.c
> > index 35684f7e21..05426abb7d 100644
> > --- a/block/file-posix.c
> > +++ b/block/file-posix.c
> > @@ -1999,7 +1999,7 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
> > return handle_aiocb_write_zeroes(aiocb);
> > }
> >
> > -#ifndef HAVE_COPY_FILE_RANGE
> > +#if !defined(HAVE_COPY_FILE_RANGE) && !defined(__GNU__)
> > static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
> > off_t *out_off, size_t len, unsigned int flags)
> > {
> > ---
> > block/file-posix.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/block/file-posix.c b/block/file-posix.c
> > index 35684f7e21..05426abb7d 100644
> > --- a/block/file-posix.c
> > +++ b/block/file-posix.c
> > @@ -1999,7 +1999,7 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
> > return handle_aiocb_write_zeroes(aiocb);
> > }
> >
> > -#ifndef HAVE_COPY_FILE_RANGE
> > +#if !defined(HAVE_COPY_FILE_RANGE) && !defined(__GNU__)
> > static off_t copy_file_range(int in_fd, off_t *in_off, int out_fd,
> > off_t *out_off, size_t len, unsigned int flags)
> > {
> > --
> > 2.43.0
> >
>
next prev parent reply other threads:[~2024-01-17 14:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 12:31 [PATCH 2/4] Avoid multiple definitions of copy_file_range Manolo de Medici
2024-01-17 13:56 ` Philippe Mathieu-Daudé
2024-01-17 14:09 ` Manolo de Medici [this message]
2024-01-17 14:33 ` Samuel Thibault
2024-01-17 14:47 ` Manolo de Medici
2024-01-17 15:03 ` Samuel Thibault
2024-01-17 15:08 ` Manolo de Medici
2024-01-17 15:22 ` Samuel Thibault
2024-01-17 15:27 ` Manolo de Medici
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=CAHP40mkNb5EH_Js02LpENMc2CA2pj7fEJY_S1sTMNWh_3rcUEQ@mail.gmail.com \
--to=manolodemedici@gmail.com \
--cc=bug-hurd@gnu.org \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).