]> xenbits.xensource.com Git - xen.git/commit
tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute
authorHongbo <hehongbo@mail.com>
Sun, 30 Mar 2025 16:03:04 +0000 (00:03 +0800)
committerAnthony PERARD <anthony.perard@vates.tech>
Fri, 25 Apr 2025 09:42:32 +0000 (11:42 +0200)
commitf6281291704aa356489f4bd927cc7348a920bd01
tree96494efa3313b6a4a94cb933dfca4a8936a35430
parente43d9621d8081a88397e2b49b08906c4f4acaa57
tools/libxl: search PATH for QEMU if `QEMU_XEN_PATH` is not absolute

`QEMU_XEN_PATH` will be configured as `qemu-system-i386` with no clue where, if
`--with-system-qemu` is set without giving a path (as matched in the case `yes`
but not `*`). However, the existence of the executable is checked by `access()`,
that will not look for anywhere in $PATH but the current directory. And since it
is possible for `qemu-system-i386` (or any other configured values) to be
executed from PATH later, we'd better find that in PATH and return the full path
for the caller to check against.

Signed-off-by: Hongbo <hehongbo@mail.com>
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
[Initialise `saveptr` to NULL]
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
tools/libs/light/libxl_dm.c