virtual function of an sr-iov capable ethernet device (which
has no boot ROMs for the VFs).
<span class="since">Since 0.9.10 (QEMU and KVM only)</span>.
+ The optional <code>enabled</code> attribute can be set to
+ <code>no</code> to disable PCI ROM loading completely for the device;
+ if PCI ROM loading is disabled through this attribute, attempts to
+ tweak the loading process further using the <code>bar</code> or
+ <code>file</code> attributes will be rejected.
+ <span class="since">Since 4.3.0 (QEMU and KVM only)</span>.
</dd>
<dt><code>address</code></dt>
<dd>The <code>address</code> element for USB devices has a
}
if ((flags & VIR_DOMAIN_DEF_FORMAT_ALLOW_ROM) &&
- (info->rombar != VIR_TRISTATE_SWITCH_ABSENT || info->romfile)) {
+ (info->romenabled != VIR_TRISTATE_BOOL_ABSENT ||
+ info->rombar != VIR_TRISTATE_SWITCH_ABSENT ||
+ info->romfile)) {
virBufferAddLit(buf, "<rom");
+ if (info->romenabled != VIR_TRISTATE_BOOL_ABSENT) {
+ const char *romenabled = virTristateBoolTypeToString(info->romenabled);
+
+ if (romenabled)
+ virBufferAsprintf(buf, " enabled='%s'", romenabled);
+ }
if (info->rombar != VIR_TRISTATE_SWITCH_ABSENT) {
const char *rombar = virTristateSwitchTypeToString(info->rombar);
xmlNodePtr boot = NULL;
xmlNodePtr rom = NULL;
char *type = NULL;
+ char *romenabled = NULL;
char *rombar = NULL;
char *aliasStr = NULL;
int ret = -1;
}
if (rom) {
+ if ((romenabled = virXMLPropString(rom, "enabled")) &&
+ ((info->romenabled = virTristateBoolTypeFromString(romenabled)) <= 0)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unknown rom enabled value '%s'"), romenabled);
+ goto cleanup;
+ }
if ((rombar = virXMLPropString(rom, "bar")) &&
((info->rombar = virTristateSwitchTypeFromString(rombar)) <= 0)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
goto cleanup;
}
info->romfile = virXMLPropString(rom, "file");
+
+ if (info->romenabled == VIR_TRISTATE_BOOL_NO &&
+ (info->rombar != VIR_TRISTATE_SWITCH_ABSENT || info->romfile)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("ROM tuning is not supported when ROM is disabled"));
+ goto cleanup;
+ }
}
if (address &&
virDomainDeviceInfoClear(info);
VIR_FREE(type);
VIR_FREE(rombar);
+ VIR_FREE(romenabled);
VIR_FREE(aliasStr);
return ret;
}