diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-05-18 06:31:48 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2013-05-30 11:37:37 -0500 |
commit | e2ea3515a9d2d747f91dadf361afcbeb57a71500 (patch) | |
tree | 8ee87328e85454ee845c2896708f49c893bd71bc /util/oslib-posix.c | |
parent | 87d23f78aa79b72da022afda358bbc8a8509ca70 (diff) | |
download | qemu-e2ea3515a9d2d747f91dadf361afcbeb57a71500.tar.gz qemu-e2ea3515a9d2d747f91dadf361afcbeb57a71500.tar.bz2 qemu-e2ea3515a9d2d747f91dadf361afcbeb57a71500.zip |
osdep: add qemu_get_local_state_pathname()
This function returns ${prefix}/var/RELATIVE_PATHNAME on POSIX-y systems,
and <CSIDL_COMMON_APPDATA>/RELATIVE_PATHNAME on Win32.
http://msdn.microsoft.com/en-us/library/bb762494.aspx
[...] This folder is used for application data that is not user
specific. For example, an application can store a spell-check
dictionary, a database of clip art, or a log file in the
CSIDL_COMMON_APPDATA folder. [...]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'util/oslib-posix.c')
-rw-r--r-- | util/oslib-posix.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 631a1dea33..3dc8b1b074 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -47,6 +47,8 @@ extern int daemon(int, int); # define QEMU_VMALLOC_ALIGN getpagesize() #endif +#include <glib/gprintf.h> + #include "config-host.h" #include "sysemu/sysemu.h" #include "trace.h" @@ -232,3 +234,10 @@ int qemu_utimens(const char *path, const struct timespec *times) return utimes(path, &tv[0]); } + +char * +qemu_get_local_state_pathname(const char *relative_pathname) +{ + return g_strdup_printf("%s/%s", CONFIG_QEMU_LOCALSTATEDIR, + relative_pathname); +} |