<boot dev='cdrom'/>
<bootmenu enable='yes'/>
<smbios mode='sysinfo'/>
- <bios useserial='yes'/>
+ <bios useserial='yes' rebootTimeout='0'/>
</os>
...</pre>
Serial Graphics Adapter which allows users to see BIOS messages
on a serial port. Therefore, one needs to have
<a href="#elementCharSerial">serial port</a> defined.
- <span class="since">Since 0.9.4</span>
- </dd>
+ <span class="since">Since 0.9.4</span>.
+ <span class="since">Since 0.10.2 (QEMU only)</span> there is
+ another attribute, <code>rebootTimeout</code> that controls
+ whether and after how long the guest should start booting
+ again in case the boot fails (according to BIOS). The value is
+ in milliseconds with maximum of <code>65535</code> and special
+ value <code>-1</code> disables the reboot.
</dl>
<h4><a name="elementsOSBootloader">Host bootloader</a></h4>
<define name="bios">
<element name="bios">
- <attribute name="useserial">
- <choice>
- <value>yes</value>
- <value>no</value>
- </choice>
- </attribute>
+ <optional>
+ <attribute name="useserial">
+ <choice>
+ <value>yes</value>
+ <value>no</value>
+ </choice>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="rebootTimeout">
+ <ref name="rebootTimeoutDelay"/>
+ </attribute>
+ </optional>
</element>
</define>
<param name='minInclusive'>-1</param>
</data>
</define>
+ <define name="rebootTimeoutDelay">
+ <data type="short">
+ <param name="minInclusive">-1</param>
+ </data>
+ </define>
<define name="PortNumber">
<data type="short">
<param name="minInclusive">-1</param>
{
xmlNodePtr *nodes = NULL;
int i, n;
- char *bootstr;
+ char *bootstr, *tmp;
char *useserial = NULL;
int ret = -1;
unsigned long deviceBoot, serialPorts;
}
}
+ tmp = virXPathString("string(./os/bios[1]/@rebootTimeout)", ctxt);
+ if (tmp) {
+ /* that was really just for the check if it is there */
+
+ if (virStrToLong_i(tmp, NULL, 0, &def->os.bios.rt_delay) < 0 ||
+ def->os.bios.rt_delay < -1 || def->os.bios.rt_delay > 65535) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("invalid value for rebootTimeout, "
+ "must be in range [-1,65535]"));
+ goto cleanup;
+ }
+ def->os.bios.rt_set = true;
+ }
+
*bootCount = deviceBoot;
ret = 0;
cleanup:
+ VIR_FREE(tmp);
VIR_FREE(useserial);
VIR_FREE(nodes);
return ret;
virBufferAsprintf(buf, " <bootmenu enable='%s'/>\n", enabled);
}
- if (def->os.bios.useserial) {
- const char *useserial = (def->os.bios.useserial ==
- VIR_DOMAIN_BIOS_USESERIAL_YES ? "yes"
- : "no");
- virBufferAsprintf(buf, " <bios useserial='%s'/>\n", useserial);
+ if (def->os.bios.useserial || def->os.bios.rt_set) {
+ virBufferAddLit(buf, " <bios");
+ if (def->os.bios.useserial)
+ virBufferAsprintf(buf, " useserial='%s'",
+ (def->os.bios.useserial ==
+ VIR_DOMAIN_BIOS_USESERIAL_YES ? "yes"
+ : "no"));
+ if (def->os.bios.rt_set)
+ virBufferAsprintf(buf, " rebootTimeout='%d'", def->os.bios.rt_delay);
+
+ virBufferAddLit(buf, "/>\n");
}
}