qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] os_find_datadir: search as in version 4.2


From: Marc-André Lureau
Subject: Re: [PATCH 1/1] os_find_datadir: search as in version 4.2
Date: Wed, 15 Jul 2020 23:57:14 +0400

Hi

On Wed, Jul 15, 2020 at 11:37 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Tue, 16 Jun 2020 at 10:19, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Tue, 16 Jun 2020 at 00:00, Joe Slater <joe.slater@windriver.com> wrote:
> > >
> > > Always look for ../share/qemu then ../pc-bios when looking for datadir.
> >
> > Could you provide some more context, please? Why is this
> > change useful; presumably we broke some setup in 5.0, but
> > what exactly ?
> >
> > I'm guessing this might be a regression introduced by commit
> > 6dd2dacedd83d12328 so I'm ccing the relevant people.
>
> Marco, Paolo: ping? Another user has just asked me the status
> of this as they also ran into this regression in what directories
> we search...

Thanks for the heads-up, I didn't see that bug/mail. Indeed, that
commit assumed that either we run from a build directory or from an
installed qemu. It seems this is hybrid approach, which I didn't know
we supported. I'll check it.

cheers

>
> thanks
> -- PMM
>
>
> > > Signed-off-by: Joe Slater <joe.slater@windriver.com>
> > > ---
> > >  os-posix.c | 9 ++++++++-
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/os-posix.c b/os-posix.c
> > > index 3cd52e1e70..f77da94bf6 100644
> > > --- a/os-posix.c
> > > +++ b/os-posix.c
> > > @@ -82,8 +82,9 @@ void os_setup_signal_handling(void)
> > >
> > >  /*
> > >   * Find a likely location for support files using the location of the 
> > > binary.
> > > + * Typically, this would be "$bindir/../share/qemu".
> > >   * When running from the build tree this will be "$bindir/../pc-bios".
> > > - * Otherwise, this is CONFIG_QEMU_DATADIR.
> > > + * Otherwise, this is CONFIG_QEMU_DATADIR as constructed by configure.
> > >   */
> > >  char *os_find_datadir(void)
> > >  {
> > > @@ -93,6 +94,12 @@ char *os_find_datadir(void)
> > >      exec_dir = qemu_get_exec_dir();
> > >      g_return_val_if_fail(exec_dir != NULL, NULL);
> > >
> > > +    dir = g_build_filename(exec_dir, "..", "share", "qemu", NULL);
> > > +    if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
> > > +        return g_steal_pointer(&dir);
> > > +    }
> > > +    g_free(dir);  /* no autofree this time */
> > > +
> > >      dir = g_build_filename(exec_dir, "..", "pc-bios", NULL);
> > >      if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
> > >          return g_steal_pointer(&dir);
> > > --
> > > 2.17.1
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]