]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: error out if fwcfg user file isn't read completely
authorCorvin Köhne <corvink@FreeBSD.org>
Fri, 12 May 2023 05:37:32 +0000 (07:37 +0200)
committerCorvin Köhne <corvink@FreeBSD.org>
Wed, 17 May 2023 13:39:37 +0000 (15:39 +0200)
commit26d9f973d8691eccc098ded7326137d6f76ad243
tree87e6b1cca4a5e5cc812e45ed832466272414c143
parentbdd47177528b5beacabb4837bfac0e9de92aae74
bhyve: error out if fwcfg user file isn't read completely

At the moment, fwcfg reads the file once at startup and passes these
data to the guest. Therefore, we should always read the whole file.
Otherwise we should error out.

Additionally, GCC12 complains that the comparison whether
fwcfg_file->size is lower than 0 is always false due to the limited
range of data type.

Reviewed by: markj
Fixes: ca14781c8170f3517ae79e198c0c880dbc3142dd ("bhyve: add cmdline option for user defined fw_cfg items")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40076
usr.sbin/bhyve/qemu_fwcfg.c