qemu: always assume QEMU_CAPS_VIRTIO_TX_ALG

Introduced back in 2010 by QEMU commit:
  commit a697a334b3c4d3250e6420f5d38550ea10eb5319
      virtio-net: Introduce a new bottom half packet TX

Released in QEMU 0.14.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
Ján Tomko 2022-08-11 15:30:23 +02:00
parent 9a23c55b04
commit c80b10e88f
4 changed files with 19 additions and 30 deletions

View File

@ -3680,28 +3680,26 @@ qemuBuildNicDevProps(virDomainDef *def,
unsigned long long vectors = 0;
virTristateSwitch failover = VIR_TRISTATE_SWITCH_ABSENT;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_TX_ALG)) {
switch (net->driver.virtio.txmode) {
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_IOTHREAD:
tx = "bh";
break;
switch (net->driver.virtio.txmode) {
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_IOTHREAD:
tx = "bh";
break;
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_TIMER:
tx = "timer";
break;
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_TIMER:
tx = "timer";
break;
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_DEFAULT:
break;
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_DEFAULT:
break;
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_LAST:
default:
/* this should never happen, if it does, we need
* to add another case to this switch.
*/
virReportEnumRangeError(virDomainNetVirtioTxModeType,
net->driver.virtio.txmode);
return NULL;
}
case VIR_DOMAIN_NET_VIRTIO_TX_MODE_LAST:
default:
/* this should never happen, if it does, we need
* to add another case to this switch.
*/
virReportEnumRangeError(virDomainNetVirtioTxModeType,
net->driver.virtio.txmode);
return NULL;
}
if (net->driver.virtio.queues > 1) {

View File

@ -1928,14 +1928,6 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
}
if (virDomainNetIsVirtioModel(net)) {
if (net->driver.virtio.txmode &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_TX_ALG)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("virtio-net-pci 'tx' option not supported in "
"this QEMU binary"));
return -1;
}
if (net->driver.virtio.rx_queue_size) {
if (!VIR_IS_POW2(net->driver.virtio.rx_queue_size)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",

View File

@ -1529,8 +1529,7 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST_FULL("net-user", "x86_64", ARG_FLAGS, FLAG_SLIRP_HELPER);
DO_TEST_NOCAPS("net-user-addr");
DO_TEST_NOCAPS("net-virtio");
DO_TEST("net-virtio-device",
QEMU_CAPS_VIRTIO_TX_ALG);
DO_TEST_NOCAPS("net-virtio-device");
DO_TEST_NOCAPS("net-virtio-disable-offloads");
DO_TEST_NOCAPS("net-virtio-netdev");
DO_TEST("net-virtio-ccw", QEMU_CAPS_CCW);

View File

@ -464,7 +464,7 @@ mymain(void)
DO_TEST_NOCAPS("net-user");
DO_TEST_NOCAPS("net-user-addr");
DO_TEST_NOCAPS("net-virtio");
DO_TEST("net-virtio-device", QEMU_CAPS_VIRTIO_TX_ALG);
DO_TEST_NOCAPS("net-virtio-device");
DO_TEST_NOCAPS("net-virtio-disable-offloads");
DO_TEST_NOCAPS("net-eth");
DO_TEST_NOCAPS("net-eth-ifname");