diff mbox series

[05/13] oslib-posix: relocate path to /var

Message ID 20200901062020.26660-6-pbonzini@redhat.com
State Superseded
Headers show
Series None | expand

Commit Message

Paolo Bonzini Sept. 1, 2020, 6:20 a.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 util/oslib-posix.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Sept. 2, 2020, 8:20 a.m. UTC | #1
On 9/1/20 8:20 AM, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  util/oslib-posix.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index a68fccb52d..8e23b8fac0 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -339,8 +339,10 @@ int qemu_pipe(int pipefd[2])
>  char *
>  qemu_get_local_state_pathname(const char *relative_pathname)
>  {
> -    return g_strdup_printf("%s/%s", CONFIG_QEMU_LOCALSTATEDIR,
> -                           relative_pathname);
> +    g_autofree char *dir = g_strdup_printf("%s/%s",
> +                                           CONFIG_QEMU_LOCALSTATEDIR,
> +                                           relative_pathname);
> +    return get_relocated_path(dir);
>  }
>  
>  void qemu_set_tty_echo(int fd, bool echo)
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index a68fccb52d..8e23b8fac0 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -339,8 +339,10 @@  int qemu_pipe(int pipefd[2])
 char *
 qemu_get_local_state_pathname(const char *relative_pathname)
 {
-    return g_strdup_printf("%s/%s", CONFIG_QEMU_LOCALSTATEDIR,
-                           relative_pathname);
+    g_autofree char *dir = g_strdup_printf("%s/%s",
+                                           CONFIG_QEMU_LOCALSTATEDIR,
+                                           relative_pathname);
+    return get_relocated_path(dir);
 }
 
 void qemu_set_tty_echo(int fd, bool echo)