From: Peter Maydell <peter.maydell@linaro.org>
To: David CARLIER <devnexen@gmail.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH 4/5] haiku build fix
Date: Fri, 26 Jun 2020 12:11:23 +0100 [thread overview]
Message-ID: <CAFEAcA-8fVstxegNFP9pVYi3v4iznqLd2GpGVvcYY6ZPazFVcg@mail.gmail.com> (raw)
In-Reply-To: <CA+XhMqzFX3_kNmrLeuk7TCn9MQ5wwe-wWdDdWsGPBViuiHRAAg@mail.gmail.com>
On Fri, 26 Jun 2020 at 11:09, David CARLIER <devnexen@gmail.com> wrote:
>
> From 775173ded5657de4d4b467f2f68e747f6a9c0750 Mon Sep 17 00:00:00 2001
> From: David Carlier <devnexen@gmail.com>
> Date: Fri, 26 Jun 2020 10:44:36 +0000
> Subject: [PATCH 4/5] Platform specific changes qemu_exec_dir implementation
If you could provide more detailed commit messages that
would be helpful (mostly it will save me having to expand
them myself when I apply the patches :-)).
> Signed-off-by: David Carlier <devnexen@gmail.com>
> ---
> include/qemu/osdep.h | 4 ++++
> util/oslib-posix.c | 20 ++++++++++++++++++++
> 2 files changed, 24 insertions(+)
>
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index ff7c17b857..da970cf654 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -388,6 +388,10 @@ void qemu_anon_ram_free(void *ptr, size_t size);
> #define HAVE_CHARDEV_PARPORT 1
> #endif
>
> +#if defined(__HAIKU__)
> +#define SIGIO SIGPOLL
> +#endif
This isn't part of the qemu_exec_dir change, so it
shouldn't be in this patch.
> +
> #if defined(CONFIG_LINUX)
> #ifndef BUS_MCEERR_AR
> #define BUS_MCEERR_AR 4
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 39ddc77c85..ff36fa41ff 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -38,7 +38,12 @@
> #include "qemu/sockets.h"
> #include "qemu/thread.h"
> #include <libgen.h>
> +#if !defined __HAIKU__
> #include <sys/signal.h>
> +#else
> +#include <kernel/image.h>
> +#include <signal.h>
> +#endif
osdep.h already includes signal.h, so you shouldn't need
to include it here. Looking at osdep.h it already includes
sys/signal.h for OpenBSD, so I think the right answer is:
In one patch:
* have configure check whether sys/signal.h exists
* change the "#ifdef __OpenBSD__" guard on including
sys/signal.h in osdep.h to check CONFIG_SYS_SIGNAL instead
* remove the #include of <sys/signal.h> from util/oslib-posix.c
and hw/xen/xen-legacy-backend.c
In another patch:
* have the workaround in osdep.h for Haiku not providing SIGIO
In a third patch:
* have the new qemu_init_exec_dir() implementation (which
should now only need to add kernel/image.h to the #includes
in oslib-posix.c and not also change the signal related includes)
> #include "qemu/cutils.h"
>
> #ifdef CONFIG_LINUX
> @@ -390,6 +395,21 @@ void qemu_init_exec_dir(const char *argv0)
> }
> }
> }
> +#elif defined(__HAIKU__)
> + {
> + image_info ii;
> + int32_t c = 0;
> +
> + *buf = '\0';
> + while (get_next_image_info(0, &c, &ii) == B_OK) {
> + if (ii.type == B_APP_IMAGE) {
> + strncpy(buf, ii.name, sizeof(buf));
> + buf[sizeof(buf) - 1] = '\0';
> + p = buf;
> + break;
> + }
> + }
> + }
> #endif
> /* If we don't have any way of figuring out the actual executable
> location then try argv[0]. */
thanks
-- PMM
next prev parent reply other threads:[~2020-06-26 11:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 10:07 [PATCH 4/5] haiku build fix David CARLIER
2020-06-26 11:11 ` Peter Maydell [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-26 12:53 David CARLIER
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=CAFEAcA-8fVstxegNFP9pVYi3v4iznqLd2GpGVvcYY6ZPazFVcg@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=devnexen@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).