---
src/qemu/qemu_command.c | 20 ++++++++++++++++++++
.../qemuxml2argv-net-virtio-disable-offloads.args | 8 ++++++++
tests/qemuxml2argvtest.c | 2 ++
3 files changed, 30 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 665a590..0b88a48 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4430,6 +4430,26 @@ qemuBuildNicDevStr(virDomainDefPtr def,
virBufferAsprintf(&buf, ",event_idx=%s",
virTristateSwitchTypeToString(net->driver.virtio.event_idx));
}
+ if (net->driver.virtio.csum) {
+ virBufferAsprintf(&buf, ",csum=%s",
+
virTristateSwitchTypeToString(net->driver.virtio.csum));
+ }
+ if (net->driver.virtio.gso) {
+ virBufferAsprintf(&buf, ",gso=%s",
+ virTristateSwitchTypeToString(net->driver.virtio.gso));
+ }
+ if (net->driver.virtio.guest_tso4) {
+ virBufferAsprintf(&buf, ",guest_tso4=%s",
+
virTristateSwitchTypeToString(net->driver.virtio.guest_tso4));
+ }
+ if (net->driver.virtio.guest_tso6) {
+ virBufferAsprintf(&buf, ",guest_tso6=%s",
+
virTristateSwitchTypeToString(net->driver.virtio.guest_tso6));
+ }
+ if (net->driver.virtio.guest_ecn) {
+ virBufferAsprintf(&buf, ",guest_ecn=%s",
+
virTristateSwitchTypeToString(net->driver.virtio.guest_ecn));
+ }
}
if (usingVirtio && vhostfdSize > 1) {
/* As advised at
http://www.linux-kvm.org/page/Multiqueue
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args
b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args
new file mode 100644
index 0000000..49e8bf7
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args
@@ -0,0 +1,8 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
+-hda /dev/HostVG/QEMUGuest7 \
+-device virtio-net-pci,csum=off,gso=off,guest_tso4=off,guest_tso6=off\
+,guest_ecn=off,vlan=0,id=net0,mac=00:22:44:66:88:aa,bus=pci.0,addr=0x3 \
+-net user,vlan=0,name=hostnet0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 5c28253..9da1214 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -959,6 +959,8 @@ mymain(void)
DO_TEST("net-virtio", NONE);
DO_TEST("net-virtio-device",
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_VIRTIO_TX_ALG);
+ DO_TEST("net-virtio-disable-offloads",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("net-virtio-netdev",
QEMU_CAPS_DEVICE, QEMU_CAPS_NETDEV, QEMU_CAPS_NODEFCONFIG);
DO_TEST("net-virtio-s390",
--
1.8.5.5