On 20/04/2019 12.00, Li Qiang wrote: > Signed-off-by: Li Qiang <liq...@163.com> > --- > tests/fw_cfg-test.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c > index c22503619f..9f75dbb5f4 100644 > --- a/tests/fw_cfg-test.c > +++ b/tests/fw_cfg-test.c > @@ -174,6 +174,24 @@ static void test_fw_cfg_boot_menu(void) > qtest_quit(s); > } > > +static void test_fw_cfg_reboot_timeout(void) > +{ > + QFWCFG *fw_cfg; > + QTestState *s; > + uint32_t reboot_timeout = 0; > + size_t filesize; > + > + s = qtest_init("-boot reboot-timeout=15"); > + fw_cfg = pc_fw_cfg_init(s); > + > + filesize = qfw_cfg_get_file(fw_cfg, "etc/boot-fail-wait", > + &reboot_timeout, sizeof(reboot_timeout)); > + g_assert_cmpint(filesize, ==, sizeof(reboot_timeout)); > + g_assert_cmpint(reboot_timeout, ==, 15);
Is this endianess-safe? Or do you need to byteswap reboot_timeout if the host and guest endianess does not match? Thomas