Re: [Qemu-devel] [PATCH 1/2] hw: fw_cfg: ensure reboot_time is nonegative

2018-11-05 Thread Markus Armbruster
Gerd Hoffmann writes: >> -/* validate the input */ >> -if (reboot_timeout > 0x) { >> -error_report("reboot timeout is larger than 65535, force it to >> 65535."); >> -reboot_timeout = 0x; >> + >> +if (reboot_timeout >= 0) { >> +/* validate the input */

Re: [Qemu-devel] [PATCH 1/2] hw: fw_cfg: ensure reboot_time is nonegative

2018-11-05 Thread Gerd Hoffmann
> -/* validate the input */ > -if (reboot_timeout > 0x) { > -error_report("reboot timeout is larger than 65535, force it to > 65535."); > -reboot_timeout = 0x; > + > +if (reboot_timeout >= 0) { > +/* validate the input */ > +if (reboot_timeout >

[Qemu-devel] [PATCH 1/2] hw: fw_cfg: ensure reboot_time is nonegative

2018-11-01 Thread Li Qiang
This can avoid setting a negative value to etc/boot-fail-wait. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 3fcfa35..dff6e06 100644 --- a/hw/nvram/fw_cfg.c +++