summary refs log tree commit diff stats
path: root/qga/main.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-20 17:26:21 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-21 17:09:09 +0400
commit1fbf2665e6773d87657c2a1654d9bf272a4f1ec0 (patch)
treecca3c06c3112551683a35f96fe1a04ab0a202c51 /qga/main.c
parent1b34d08f0b529ccf80e9da9d0928afa97d5d7807 (diff)
downloadfocaccia-qemu-1fbf2665e6773d87657c2a1654d9bf272a4f1ec0.tar.gz
focaccia-qemu-1fbf2665e6773d87657c2a1654d9bf272a4f1ec0.zip
util: replace qemu_get_local_state_pathname()
Simplify the function to only return the directory path. Callers are
adjusted to use the GLib function to build paths, g_build_filename().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220420132624.2439741-39-marcandre.lureau@redhat.com>
Diffstat (limited to 'qga/main.c')
-rw-r--r--qga/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/qga/main.c b/qga/main.c
index aa00ad8fab..3c20bf1fbf 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -129,12 +129,12 @@ static void stop_agent(GAState *s, bool requested);
 static void
 init_dfl_pathnames(void)
 {
+    g_autofree char *state = qemu_get_local_state_dir();
+
     g_assert(dfl_pathnames.state_dir == NULL);
     g_assert(dfl_pathnames.pidfile == NULL);
-    dfl_pathnames.state_dir = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR);
-    dfl_pathnames.pidfile   = qemu_get_local_state_pathname(
-      QGA_STATE_RELATIVE_DIR G_DIR_SEPARATOR_S "qemu-ga.pid");
+    dfl_pathnames.state_dir = g_build_filename(state, QGA_STATE_RELATIVE_DIR, NULL);
+    dfl_pathnames.pidfile = g_build_filename(state, QGA_STATE_RELATIVE_DIR, "qemu-ga.pid", NULL);
 }
 
 static void quit_handler(int sig)