[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/5] fw_cfg: reboot: store reboot-timeout as litt
From: |
Li Qiang |
Subject: |
[Qemu-devel] [PATCH v2 3/5] fw_cfg: reboot: store reboot-timeout as little endian |
Date: |
Wed, 24 Apr 2019 07:06:41 -0700 |
So that if the guest and host endianess does not match it
can still work as expection.
Signed-off-by: Li Qiang <address@hidden>
---
hw/nvram/fw_cfg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 5c3a46ce6f..df4242fc9c 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -178,6 +178,7 @@ static void fw_cfg_reboot(FWCfgState *s)
{
const char *reboot_timeout = NULL;
int64_t rt_val = -1;
+ uint32_t rt_le32;
/* get user configuration */
QemuOptsList *plist = qemu_find_opts("boot-opts");
@@ -194,7 +195,8 @@ static void fw_cfg_reboot(FWCfgState *s)
}
}
- fw_cfg_add_file(s, "etc/boot-fail-wait", g_memdup(&rt_val, 4), 4);
+ rt_le32 = cpu_to_le32(rt_val);
+ fw_cfg_add_file(s, "etc/boot-fail-wait", g_memdup(&rt_le32, 4), 4);
}
static void fw_cfg_write(FWCfgState *s, uint8_t value)
--
2.17.1
- [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases, Li Qiang, 2019/04/24
- [Qemu-devel] [PATCH v2 4/5] tests: fw_cfg: add reboot_timeout test case, Li Qiang, 2019/04/24
- [Qemu-devel] [PATCH v2 5/5] tests: fw_cfg: add splash time test case, Li Qiang, 2019/04/24
- [Qemu-devel] [PATCH v2 3/5] fw_cfg: reboot: store reboot-timeout as little endian,
Li Qiang <=
- [Qemu-devel] [PATCH v2 2/5] tests: fw_cfg: add a function to get the fw_cfg file, Li Qiang, 2019/04/24
- [Qemu-devel] [PATCH v2 1/5] tests: refactor fw_cfg_test, Li Qiang, 2019/04/24
- Re: [Qemu-devel] [PATCH v2 0/5] fw_cfg_test refactor and add two test cases, Thomas Huth, 2019/04/25