mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
qemu_command.c: move QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE check to qemu_validate.c
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
78c6507473
commit
53fa517082
@ -3405,14 +3405,8 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
||||
if (usingVirtio && net->driver.virtio.rx_queue_size)
|
||||
virBufferAsprintf(&buf, ",rx_queue_size=%u", net->driver.virtio.rx_queue_size);
|
||||
|
||||
if (usingVirtio && net->driver.virtio.tx_queue_size) {
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtio tx_queue_size option is not supported with this QEMU binary"));
|
||||
return NULL;
|
||||
}
|
||||
if (usingVirtio && net->driver.virtio.tx_queue_size)
|
||||
virBufferAsprintf(&buf, ",tx_queue_size=%u", net->driver.virtio.tx_queue_size);
|
||||
}
|
||||
|
||||
if (usingVirtio && net->mtu) {
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) {
|
||||
|
@ -1269,6 +1269,14 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (net->driver.virtio.tx_queue_size &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtio tx_queue_size option is not supported "
|
||||
"with this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (net->driver.virtio.rx_queue_size & (net->driver.virtio.rx_queue_size - 1)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("rx_queue_size has to be a power of two"));
|
||||
|
@ -475,7 +475,8 @@ mymain(void)
|
||||
DO_TEST("net-eth-unmanaged-tap", NONE);
|
||||
DO_TEST("net-virtio-network-portgroup", NONE);
|
||||
DO_TEST("net-virtio-rxtxqueuesize",
|
||||
QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE);
|
||||
QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE,
|
||||
QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE);
|
||||
DO_TEST("net-virtio-teaming",
|
||||
QEMU_CAPS_VIRTIO_NET_FAILOVER,
|
||||
QEMU_CAPS_DEVICE_VFIO_PCI);
|
||||
|
Loading…
Reference in New Issue
Block a user