qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: joe.slater@windriver.com
Subject: Re: [RFC PATCH] os-posix: fix regression for install-less datadir location
Date: Tue, 18 Aug 2020 11:10:00 +0200	[thread overview]
Message-ID: <8c8090d3-9f81-77ba-6f8e-3f26b11ed77a@redhat.com> (raw)
In-Reply-To: <20200716141100.398296-1-marcandre.lureau@redhat.com>

On 16/07/20 16:11, Marc-André Lureau wrote:
> os_find_datadir() used to check the ../share/qemu location (regardless
> of CONFIG_QEMU_DATADIR). It turns out that people rely on that location
> for running qemu in an arbitrary "install-less/portable" fashion. Change
> the logic to return that directory as a last resort.
> 
> (this is an alternative to the patch "[PATCH 1/1] os_find_datadir: search
> as in version 4.2" from Joe Slater)
> 
> Fixes: 6dd2dacedd83d12328 ("os-posix: simplify os_find_datadir")
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

For 5.2 I plan to support fully relocatable installs, so I think this
will not be needed.

The idea is to write a function like

char *get_relocatable_path(const char *dir);

That takes CONFIG_QEMU_*DIR as the argument, turns it into a path
relative to bindir, and tacks it to the end of qemu_get_exec_dir().

So for example all references to CONFIG_QEMU_DATADIR would invoke
get_relocatable_path(CONFIG_QEMU_DATADIR), which would return something
like "/usr/bin/../share/qemu".

Paolo



  parent reply	other threads:[~2020-08-18  9:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 14:11 [RFC PATCH] os-posix: fix regression for install-less datadir location Marc-André Lureau
2020-07-16 14:15 ` Marc-André Lureau
2020-08-18  9:10 ` Paolo Bonzini [this message]
2020-08-18 13:10   ` Peter Maydell
2020-08-18 16:23     ` Paolo Bonzini

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=8c8090d3-9f81-77ba-6f8e-3f26b11ed77a@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=joe.slater@windriver.com \
    --cc=marcandre.lureau@redhat.com \
    --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).