qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] tests: fw_cfg: add reboot_timeout test case


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH 3/4] tests: fw_cfg: add reboot_timeout test case
Date: Tue, 23 Apr 2019 18:29:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 20/04/2019 12.00, Li Qiang wrote:
> Signed-off-by: Li Qiang <address@hidden>
> ---
>  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]