From d450cccc9a4f4409434f4bd0a80270836f6bc3c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 14 Jul 2020 18:14:33 +0200 Subject: qemu/osdep: Reword qemu_get_exec_dir() documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This comment is confuse, reword it a bit. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Rolnik Tested-by: Michael Rolnik Reviewed-by: Daniel P. Berrangé Message-Id: <20200714164257.23330-3-f4bug@amsat.org> --- include/qemu/osdep.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 4841b5c..45c217a 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -588,7 +588,10 @@ char *qemu_get_local_state_pathname(const char *relative_pathname); void qemu_init_exec_dir(const char *argv0); /* Get the saved exec dir. - * Caller needs to release the returned string by g_free() */ + * + * The caller is responsible for releasing the value returned with g_free() + * after use. + */ char *qemu_get_exec_dir(void); /** -- cgit v1.1 From b6c61f69349ca3706c7e757ec1f2df916b70de7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Tue, 14 Jul 2020 18:10:10 +0200 Subject: qemu-common: Document qemu_find_file() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document qemu_find_file(), in particular the returned value which must be freed. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Li Qiang Reviewed-by: Michael Rolnik Tested-by: Michael Rolnik Reviewed-by: Daniel P. Berrangé Message-Id: <20200714164257.23330-4-f4bug@amsat.org> --- include/qemu-common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/qemu-common.h b/include/qemu-common.h index d0142f2..bb9496b 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -110,6 +110,23 @@ const char *qemu_get_vm_name(void); #define QEMU_FILE_TYPE_BIOS 0 #define QEMU_FILE_TYPE_KEYMAP 1 +/** + * qemu_find_file: + * @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS) + * or QEMU_FILE_TYPE_KEYMAP (for keymaps). + * @name: Relative or absolute file name + * + * If @name exists on disk as an absolute path, or a path relative + * to the current directory, then returns @name unchanged. + * Otherwise searches for @name file in the data directories, either + * configured at build time (DATADIR) or registered with the -L command + * line option. + * + * The caller must use g_free() to free the returned data when it is + * no longer required. + * + * Returns: a path that can access @name, or NULL if no matching file exists. + */ char *qemu_find_file(int type, const char *name); /* OS specific functions */ -- cgit v1.1