mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 06:13:53 -06:00
cutils: introduce get_relocated_path
Add the function that will compute a relocated version of the directories in CONFIG_QEMU_*DIR and CONFIG_QEMU_*PATH. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
9386a4a715
commit
f4f5ed2cbd
3 changed files with 75 additions and 2 deletions
|
@ -184,4 +184,16 @@ int uleb128_decode_small(const uint8_t *in, uint32_t *n);
|
|||
*/
|
||||
int qemu_pstrcmp0(const char **str1, const char **str2);
|
||||
|
||||
|
||||
/**
|
||||
* get_relocated_path:
|
||||
* @dir: the directory (typically a `CONFIG_*DIR` variable) to be relocated.
|
||||
*
|
||||
* Returns a path for @dir that uses the directory of the running executable
|
||||
* as the prefix. For example, if `bindir` is `/usr/bin` and @dir is
|
||||
* `/usr/share/qemu`, the function will append `../share/qemu` to the
|
||||
* directory that contains the running executable and return the result.
|
||||
*/
|
||||
char *get_relocated_path(const char *dir);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue