c8c376
From 540c7a0b9ff298f88c0c21ba6d0afbd47ac90a78 Mon Sep 17 00:00:00 2001
c8c376
Message-Id: <540c7a0b9ff298f88c0c21ba6d0afbd47ac90a78@dist-git>
c8c376
From: Michal Privoznik <mprivozn@redhat.com>
c8c376
Date: Tue, 8 Nov 2016 13:42:11 +0100
c8c376
Subject: [PATCH] qemuBuildVhostuserCommandLine: Unify -netdev creation
c8c376
c8c376
RHEL-7.3: https://bugzilla.redhat.com/show_bug.cgi?id=1366108
c8c376
RHEL-7.3.z: https://bugzilla.redhat.com/show_bug.cgi?id=1392032
c8c376
c8c376
Currently, what we do for vhost-user network is generate the
c8c376
following part of command line:
c8c376
c8c376
-netdev type=vhost-user,id=hostnet0,chardev=charnet0
c8c376
c8c376
There's no need for 'type=' it is the default. Drop it.
c8c376
c8c376
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c8c376
(cherry picked from commit b093e8522483c689e6ffaf7bdef98991f862c88b)
c8c376
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c8c376
---
c8c376
 src/qemu/qemu_command.c                                       | 2 +-
c8c376
 tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args | 6 +++---
c8c376
 tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args        | 4 ++--
c8c376
 3 files changed, 6 insertions(+), 6 deletions(-)
c8c376
c8c376
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
c8c376
index b99fb7a8f..aa289ad64 100644
c8c376
--- a/src/qemu/qemu_command.c
c8c376
+++ b/src/qemu/qemu_command.c
c8c376
@@ -7955,7 +7955,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
c8c376
         goto error;
c8c376
     }
c8c376
 
c8c376
-    virBufferAsprintf(&netdev_buf, "type=vhost-user,id=host%s,chardev=char%s",
c8c376
+    virBufferAsprintf(&netdev_buf, "vhost-user,id=host%s,chardev=char%s",
c8c376
                       net->info.alias, net->info.alias);
c8c376
 
c8c376
     if (queues > 1) {
c8c376
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
c8c376
index a136dbab6..48930ef16 100644
c8c376
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
c8c376
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
c8c376
@@ -20,16 +20,16 @@ QEMU_AUDIO_DRV=none \
c8c376
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
c8c376
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
c8c376
 -chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
c8c376
--netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
c8c376
+-netdev vhost-user,id=hostnet0,chardev=charnet0 \
c8c376
 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
c8c376
 addr=0x3 \
c8c376
 -chardev socket,id=charnet1,path=/tmp/vhost1.sock \
c8c376
--netdev type=vhost-user,id=hostnet1,chardev=charnet1 \
c8c376
+-netdev vhost-user,id=hostnet1,chardev=charnet1 \
c8c376
 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
c8c376
 addr=0x4 \
c8c376
 -netdev socket,listen=:2015,id=hostnet2 \
c8c376
 -device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,addr=0x5 \
c8c376
 -chardev socket,id=charnet3,path=/tmp/vhost2.sock \
c8c376
--netdev type=vhost-user,id=hostnet3,chardev=charnet3,queues=4 \
c8c376
+-netdev vhost-user,id=hostnet3,chardev=charnet3,queues=4 \
c8c376
 -device virtio-net-pci,mq=on,vectors=10,netdev=hostnet3,id=net3,\
c8c376
 mac=52:54:00:ee:96:6d,bus=pci.0,addr=0x6
c8c376
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
c8c376
index 8356ef0c7..f4dc9d573 100644
c8c376
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
c8c376
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
c8c376
@@ -20,11 +20,11 @@ QEMU_AUDIO_DRV=none \
c8c376
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
c8c376
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
c8c376
 -chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
c8c376
--netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
c8c376
+-netdev vhost-user,id=hostnet0,chardev=charnet0 \
c8c376
 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
c8c376
 addr=0x3 \
c8c376
 -chardev socket,id=charnet1,path=/tmp/vhost1.sock \
c8c376
--netdev type=vhost-user,id=hostnet1,chardev=charnet1 \
c8c376
+-netdev vhost-user,id=hostnet1,chardev=charnet1 \
c8c376
 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
c8c376
 addr=0x4 \
c8c376
 -netdev socket,listen=:2015,id=hostnet2 \
c8c376
-- 
c8c376
2.11.0
c8c376