render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 540c7a0b9ff298f88c0c21ba6d0afbd47ac90a78 Mon Sep 17 00:00:00 2001
Message-Id: <540c7a0b9ff298f88c0c21ba6d0afbd47ac90a78@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 8 Nov 2016 13:42:11 +0100
Subject: [PATCH] qemuBuildVhostuserCommandLine: Unify -netdev creation

RHEL-7.3: https://bugzilla.redhat.com/show_bug.cgi?id=1366108
RHEL-7.3.z: https://bugzilla.redhat.com/show_bug.cgi?id=1392032

Currently, what we do for vhost-user network is generate the
following part of command line:

-netdev type=vhost-user,id=hostnet0,chardev=charnet0

There's no need for 'type=' it is the default. Drop it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit b093e8522483c689e6ffaf7bdef98991f862c88b)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_command.c                                       | 2 +-
 tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args | 6 +++---
 tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b99fb7a8f..aa289ad64 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7955,7 +7955,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
         goto error;
     }
 
-    virBufferAsprintf(&netdev_buf, "type=vhost-user,id=host%s,chardev=char%s",
+    virBufferAsprintf(&netdev_buf, "vhost-user,id=host%s,chardev=char%s",
                       net->info.alias, net->info.alias);
 
     if (queues > 1) {
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
index a136dbab6..48930ef16 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser-multiq.args
@@ -20,16 +20,16 @@ QEMU_AUDIO_DRV=none \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
 -chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
--netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
+-netdev vhost-user,id=hostnet0,chardev=charnet0 \
 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
 addr=0x3 \
 -chardev socket,id=charnet1,path=/tmp/vhost1.sock \
--netdev type=vhost-user,id=hostnet1,chardev=charnet1 \
+-netdev vhost-user,id=hostnet1,chardev=charnet1 \
 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
 addr=0x4 \
 -netdev socket,listen=:2015,id=hostnet2 \
 -device rtl8139,netdev=hostnet2,id=net2,mac=52:54:00:95:db:c0,bus=pci.0,addr=0x5 \
 -chardev socket,id=charnet3,path=/tmp/vhost2.sock \
--netdev type=vhost-user,id=hostnet3,chardev=charnet3,queues=4 \
+-netdev vhost-user,id=hostnet3,chardev=charnet3,queues=4 \
 -device virtio-net-pci,mq=on,vectors=10,netdev=hostnet3,id=net3,\
 mac=52:54:00:ee:96:6d,bus=pci.0,addr=0x6
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
index 8356ef0c7..f4dc9d573 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-vhostuser.args
@@ -20,11 +20,11 @@ QEMU_AUDIO_DRV=none \
 -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
 -chardev socket,id=charnet0,path=/tmp/vhost0.sock,server \
--netdev type=vhost-user,id=hostnet0,chardev=charnet0 \
+-netdev vhost-user,id=hostnet0,chardev=charnet0 \
 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ee:96:6b,bus=pci.0,\
 addr=0x3 \
 -chardev socket,id=charnet1,path=/tmp/vhost1.sock \
--netdev type=vhost-user,id=hostnet1,chardev=charnet1 \
+-netdev vhost-user,id=hostnet1,chardev=charnet1 \
 -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:ee:96:6c,bus=pci.0,\
 addr=0x4 \
 -netdev socket,listen=:2015,id=hostnet2 \
-- 
2.11.0