Currently we added a comma for netdev_extra_params in framework,
if we want to add multiple parameters in more than one times,
we should not use comma prefix in first parameter string.

eg. add multiple parameters more than one times:
  netdev_extra_params = "vhost=on"
  netdev_extra_params += ",sndbuf=512"

This patch moved the comma out of framework, then we can
set the parameter conveniently. We don't care about if it's the
first assignment, just using comma prefix for all params strings.

Signed-off-by: Amos Kong <[email protected]>
---
 qemu/tests/cfg/multi_host.cfg                    |    8 ++++----
 shared/cfg/guest-hw.cfg                          |    2 +-
 virttest/qemu_vm.py                              |    2 +-
 virttest/unittest_data/testcfg.huge/guest-hw.cfg |    2 +-
 virttest/unittest_data/testcfg.huge/subtests.cfg |    8 ++++----
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/qemu/tests/cfg/multi_host.cfg b/qemu/tests/cfg/multi_host.cfg
index ba4f6a4..f5bc5e5 100644
--- a/qemu/tests/cfg/multi_host.cfg
+++ b/qemu/tests/cfg/multi_host.cfg
@@ -58,14 +58,14 @@
                     netdev_extra_params_host1 = ""
                     netdev_extra_params_host2 = ""
                 - vhost_src_yes_dst_yes:
-                    netdev_extra_params_host1 = "vhost=on"
-                    netdev_extra_params_host2 = "vhost=on"
+                    netdev_extra_params_host1 = ",vhost=on"
+                    netdev_extra_params_host2 = ",vhost=on"
                 - vhost_src_yes_dst_no:
-                    netdev_extra_params_host1 = "vhost=on"
+                    netdev_extra_params_host1 = ",vhost=on"
                     netdev_extra_params_host2 = ""
                 - vhost_src_no_dst_yes:
                     netdev_extra_params_host1 = ""
-                    netdev_extra_params_host2 = "vhost=on"
+                    netdev_extra_params_host2 = ",vhost=on"
 
             variants:
                 # Migration properties
diff --git a/shared/cfg/guest-hw.cfg b/shared/cfg/guest-hw.cfg
index 3b73068..539913f 100644
--- a/shared/cfg/guest-hw.cfg
+++ b/shared/cfg/guest-hw.cfg
@@ -22,7 +22,7 @@ variants:
         # such as sndbuf, as an example, you can uncomment the
         # following lines to enable the vhost support ( only available
         # for tap )
-        #netdev_extra_params = "vhost=on"
+        #netdev_extra_params = ",vhost=on"
         jumbo:
             mtu = 65520
         ethtool:
diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py
index b58b9ee..cf2ecf1 100644
--- a/virttest/qemu_vm.py
+++ b/virttest/qemu_vm.py
@@ -654,7 +654,7 @@ class VM(virt_vm.BaseVM):
             if has_option(help_text, "netdev"):
                 cmd = " -netdev %s,id=%s" % (mode, netdev_id)
                 if netdev_extra_params:
-                    cmd += ",%s" % netdev_extra_params
+                    cmd += "%s" % netdev_extra_params
             else:
                 cmd = " -net %s,vlan=%d" % (mode, vlan)
             if mode == "tap" and tapfd:
diff --git a/virttest/unittest_data/testcfg.huge/guest-hw.cfg 
b/virttest/unittest_data/testcfg.huge/guest-hw.cfg
index 13f6b5e..2b41222 100644
--- a/virttest/unittest_data/testcfg.huge/guest-hw.cfg
+++ b/virttest/unittest_data/testcfg.huge/guest-hw.cfg
@@ -22,7 +22,7 @@ variants:
         # such as sndbuf, as an example, you can uncomment the
         # following lines to enable the vhost support ( only available
         # for tap )
-        #netdev_extra_params = "vhost=on"
+        #netdev_extra_params = ",vhost=on"
         jumbo:
             mtu = 65520
         ethtool:
diff --git a/virttest/unittest_data/testcfg.huge/subtests.cfg 
b/virttest/unittest_data/testcfg.huge/subtests.cfg
index 16f20b3..1a90c60 100644
--- a/virttest/unittest_data/testcfg.huge/subtests.cfg
+++ b/virttest/unittest_data/testcfg.huge/subtests.cfg
@@ -675,14 +675,14 @@ variants:
                         netdev_extra_params_host1 = ""
                         netdev_extra_params_host2 = ""
                     - vhost_src_yes_dst_yes:
-                        netdev_extra_params_host1 = "vhost=on"
-                        netdev_extra_params_host2 = "vhost=on"
+                        netdev_extra_params_host1 = ",vhost=on"
+                        netdev_extra_params_host2 = ",vhost=on"
                     - vhost_src_yes_dst_no:
-                        netdev_extra_params_host1 = "vhost=on"
+                        netdev_extra_params_host1 = ",vhost=on"
                         netdev_extra_params_host2 = ""
                     - vhost_src_no_dst_yes:
                         netdev_extra_params_host1 = ""
-                        netdev_extra_params_host2 = "vhost=on"
+                        netdev_extra_params_host2 = ",vhost=on"
     
                 variants:
                     # Migration properties
-- 
1.7.1

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to