mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
conf: domain: support for virtio packed option
Expose the virtio parameter for packed virtqueues as an optional libvirt XML attribute to virtio-backed devices, e.g.: <interface type='user'> <mac address='00:11:22:33:44:55'/> <model type='virtio'/> <driver packed='on'/> </interface> If the attribute is omitted, the default value for this attribute is 'off' and regular split virtqueues are used. Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
979500e1c1
commit
0e3b30944d
@ -5961,6 +5961,11 @@
|
|||||||
<ref name="virOnOff"/>
|
<ref name="virOnOff"/>
|
||||||
</attribute>
|
</attribute>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<attribute name="packed">
|
||||||
|
<ref name="virOnOff"/>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
<define name="usbmaster">
|
<define name="usbmaster">
|
||||||
|
@ -1512,6 +1512,16 @@ virDomainVirtioOptionsParseXML(xmlNodePtr driver,
|
|||||||
}
|
}
|
||||||
res->ats = val;
|
res->ats = val;
|
||||||
}
|
}
|
||||||
|
VIR_FREE(str);
|
||||||
|
|
||||||
|
if ((str = virXMLPropString(driver, "packed"))) {
|
||||||
|
if ((val = virTristateSwitchTypeFromString(str)) <= 0) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
|
_("invalid packed value"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
res->packed = val;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -5091,6 +5101,12 @@ virDomainCheckVirtioOptions(virDomainVirtioOptionsPtr virtio)
|
|||||||
"for virtio devices"));
|
"for virtio devices"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("packed driver option is only supported "
|
||||||
|
"for virtio devices"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7377,6 +7393,10 @@ virDomainVirtioOptionsFormat(virBufferPtr buf,
|
|||||||
virBufferAsprintf(buf, " ats='%s'",
|
virBufferAsprintf(buf, " ats='%s'",
|
||||||
virTristateSwitchTypeToString(virtio->ats));
|
virTristateSwitchTypeToString(virtio->ats));
|
||||||
}
|
}
|
||||||
|
if (virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {
|
||||||
|
virBufferAsprintf(buf, " packed='%s'",
|
||||||
|
virTristateSwitchTypeToString(virtio->packed));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -22415,6 +22435,14 @@ virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptionsPtr src,
|
|||||||
virTristateSwitchTypeToString(src->ats));
|
virTristateSwitchTypeToString(src->ats));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (src->packed != dst->packed) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Target device packed option '%s' does not "
|
||||||
|
"match source '%s'"),
|
||||||
|
virTristateSwitchTypeToString(dst->packed),
|
||||||
|
virTristateSwitchTypeToString(src->packed));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2417,6 +2417,7 @@ struct _virDomainVsockDef {
|
|||||||
struct _virDomainVirtioOptions {
|
struct _virDomainVirtioOptions {
|
||||||
virTristateSwitch iommu;
|
virTristateSwitch iommu;
|
||||||
virTristateSwitch ats;
|
virTristateSwitch ats;
|
||||||
|
virTristateSwitch packed;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user