Skip to content

Commit b6c61f6

Browse files
committed
qemu-common: Document qemu_find_file()
Document qemu_find_file(), in particular the returned value which must be freed. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Reviewed-by: Li Qiang <[email protected]> Reviewed-by: Michael Rolnik <[email protected]> Tested-by: Michael Rolnik <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Message-Id: <[email protected]>
1 parent d450ccc commit b6c61f6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

include/qemu-common.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,23 @@ const char *qemu_get_vm_name(void);
110110

111111
#define QEMU_FILE_TYPE_BIOS 0
112112
#define QEMU_FILE_TYPE_KEYMAP 1
113+
/**
114+
* qemu_find_file:
115+
* @type: QEMU_FILE_TYPE_BIOS (for BIOS, VGA BIOS)
116+
* or QEMU_FILE_TYPE_KEYMAP (for keymaps).
117+
* @name: Relative or absolute file name
118+
*
119+
* If @name exists on disk as an absolute path, or a path relative
120+
* to the current directory, then returns @name unchanged.
121+
* Otherwise searches for @name file in the data directories, either
122+
* configured at build time (DATADIR) or registered with the -L command
123+
* line option.
124+
*
125+
* The caller must use g_free() to free the returned data when it is
126+
* no longer required.
127+
*
128+
* Returns: a path that can access @name, or NULL if no matching file exists.
129+
*/
113130
char *qemu_find_file(int type, const char *name);
114131

115132
/* OS specific functions */

0 commit comments

Comments
 (0)