mirror of https://gitee.com/openkylin/libvirt.git
qemu_command.c: move QEMU_CAPS_VIRTIO_TX_ALG 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
a40659eb82
commit
37c6d4a62c
|
@ -3330,10 +3330,6 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
|||
net->driver.virtio.txmode);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtio-net-pci 'tx' option not supported in this QEMU binary"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if (usingVirtio) {
|
||||
|
|
|
@ -1253,6 +1253,14 @@ 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 & (net->driver.virtio.rx_queue_size - 1)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("rx_queue_size has to be a power of two"));
|
||||
|
|
|
@ -467,7 +467,7 @@ mymain(void)
|
|||
DO_TEST("net-user", NONE);
|
||||
DO_TEST("net-user-addr", NONE);
|
||||
DO_TEST("net-virtio", NONE);
|
||||
DO_TEST("net-virtio-device", NONE);
|
||||
DO_TEST("net-virtio-device", QEMU_CAPS_VIRTIO_TX_ALG);
|
||||
DO_TEST("net-virtio-disable-offloads", NONE);
|
||||
DO_TEST("net-eth", NONE);
|
||||
DO_TEST("net-eth-ifname", NONE);
|
||||
|
@ -795,7 +795,7 @@ mymain(void)
|
|||
DO_TEST("numad-auto-memory-vcpu-no-cpuset-and-placement", NONE);
|
||||
DO_TEST("numad-auto-memory-vcpu-cpuset", NONE);
|
||||
DO_TEST("usb-ich9-ehci-addr", NONE);
|
||||
DO_TEST("disk-copy_on_read", NONE);
|
||||
DO_TEST("disk-copy_on_read", QEMU_CAPS_VIRTIO_TX_ALG);
|
||||
DO_TEST_CAPS_LATEST("tpm-passthrough");
|
||||
DO_TEST_CAPS_LATEST("tpm-passthrough-crb");
|
||||
DO_TEST_CAPS_LATEST("tpm-emulator");
|
||||
|
|
Loading…
Reference in New Issue