<div dir="ltr"><div>Hi Michal,</div><div>Any more advice update?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 8, 2019 at 8:42 PM Han Han <<a href="mailto:hhan@redhat.com">hhan@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 8, 2019 at 5:50 PM Michal Privoznik <<a href="mailto:mprivozn@redhat.com" target="_blank">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 10/8/19 10:36 AM, Han Han wrote:<br>
> Adjust valid range of rebootTimeout according to qemu-4.0.0 commit<br>
> ee5d0f89de3.<br>
> <br>
> Signed-off-by: Han Han <<a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a>><br>
> ---<br>
>   src/conf/domain_conf.c | 6 ++++--<br>
>   1 file changed, 4 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c<br>
> index a53cd6a725..57ab254f52 100644<br>
> --- a/src/conf/domain_conf.c<br>
> +++ b/src/conf/domain_conf.c<br>
> @@ -18090,10 +18090,12 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,<br>
>               /* that was really just for the check if it is there */<br>
>   <br>
>               if (virStrToLong_i(tmp, NULL, 0, &def->os.bios.rt_delay) < 0 ||<br>
> -                def->os.bios.rt_delay < -1 || def->os.bios.rt_delay > 65535) {<br>
> +                def->os.bios.rt_delay < 0 || def->os.bios.rt_delay > 65535) {<br>
>                   virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",<br>
>                                  _("invalid value for rebootTimeout, "<br>
> -                                 "must be in range [-1,65535]"));<br>
> +                                 "must be in range [0,65535]. "<br>
> +                                 "To disable reboot, "<br>
> +                                 "just remove this attribute."));<br>
>                   return -1;<br>
>               }<br>
>               def->os.bios.rt_set = true;<br>
> <br>
<br>
Firstly¸patch 2/3 must come before 1/3 because we require patches to be <br>
able to compile & run 'make syntax-check check' successfuly after every <br>
single one.<br>
<br>
But more serious problem is, that we document that -1 is a special value <br>
that disables automatic reboot. So did QEMU just lose functionality <br>
there? If they have some other way to prevent automatic reboot on failed <br></blockquote><div>Yes. <br></div><div>The qemu commit ee5d0f89de3 says:</div><div>" This patch checks for conversion errors properly, and reject all values<br>  outside 0...0xffff."</div><div>And check the definition of fw_cfg_reboot(), you can found the default value</div><div>passed to pointer argument is alwarys -1 before or after the commit.<br></div><div><br></div><div>Test on qemu-4.0.0:</div><div># qemu-system-x86_64 -boot reboot-timeout=-1 /tmp/new <br></div><div>WARNING: Image format was not specified for '/tmp/new' and probing guessed raw.<br>         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.<br>         Specify the 'raw' format explicitly to remove the restrictions.<br>qemu-system-x86_64: reboot timeout is invalid,it should be a value between 0 and 65535</div><div><br></div><div># echo $?</div><div>1<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
boot, then we need to use that if user requested -1.<br>
<br>
Michal<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Best regards,</div><div dir="ltr">-----------------------------------<br></div><div dir="ltr">Han Han<br>Quality Engineer<br>Redhat.<br><br>Email: <a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a><br>Phone: +861065339333<br></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Best regards,</div><div dir="ltr">-----------------------------------<br></div><div dir="ltr">Han Han<br>Quality Engineer<br>Redhat.<br><br>Email: <a href="mailto:hhan@redhat.com" target="_blank">hhan@redhat.com</a><br>Phone: +861065339333<br></div></div></div></div></div></div>