-
-| Configure guest VM with linux bridge connected via vhost-user
-| | [Documentation]
-| | ... | Start QEMU guest with two vhost-user interfaces and interconnecting\
-| | ... | linux bridge.
-| | ...
-| | ... | *Arguments:*
-| | ... | - dut - DUT node to start guest VM on. Type: dictionary
-| | ... | - sock1 - Socket path for first Vhost-User interface.
-| | ... | Type: string
-| | ... | - sock2 - Socket path for second Vhost-User interface.
-| | ... | Type: string
-| | ... | - vm_name - QemuUtil instance name. Type: string
-| | ... | - skip_cnt - number of cpus which will be skipped. Type: int
-| | ...
-| | ... | _NOTE:_ This KW expects following test case variables to be set:
-| | ... | - cpu_count_int - Number of Physical CPUs allocated for DUT.
-| | ...
-| | ... | *Example:*
-| | ...
-| | ... | \| Configure guest VM with linux bridge connected via vhost-user \
-| | ... | \| ${nodes['DUT1']} \| /tmp/sock1 \| /tmp/sock2 \| DUT1_VM \| ${6} \|
-| | ...
-| | [Arguments] | ${dut} | ${sock1} | ${sock2} | ${vm_name} | ${skip_cnt}=${6}
-| | ... | ${count}=${5}
-| | ...
-| | Import Library | resources.libraries.python.QemuUtils
-| | ... | WITH NAME | ${vm_name}
-| | Run keyword | ${vm_name}.Qemu Set Node | ${dut}
-| | ${dut_numa}= | Get interfaces numa node | ${dut}
-| | ... | ${dut1_if1} | ${dut1_if2}
-| | ${vm_phy_cpus}= | Evaluate | ${cpu_count_int} + ${1}
-| | ${skip_cnt}= | Evaluate | ${skip} + (${qemu_id} - ${1}) * ${vm_phy_cpus}
-| | ${qemu_cpus}= | Cpu slice of list per node | ${dut} | ${dut_numa}
-| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${vm_phy_cpus} | smt_used=${smt_used}
-| | ${vm_thr_cpus}= | Get Length | ${qemu_cpus}
-| | Run keyword | ${vm_name}.Qemu Set Queue Size | ${perf_qemu_qsz}
-| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
-| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
-| | ${apply_patch}= | Set Variable | ${False}
-| | ${perf_qemu_path}= | Set Variable If | ${apply_patch}
-| | ... | ${perf_qemu_path}-patch/bin/
-| | ... | ${perf_qemu_path}-base/bin/
-| | Run Keyword If | ${qemu_build} | ${vm_name}.Build QEMU | ${dut}
-| | ... | apply_patch=${apply_patch}
-| | Run keyword | ${vm_name}.Qemu Set Path | ${perf_qemu_path}
-| | Run keyword | ${vm_name}.Qemu Set Smp | ${vm_thr_cpus} | ${vm_thr_cpus}
-| | ... | 1 | 1
-| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
-| | Run keyword | ${vm_name}.Qemu Set Disk Image | ${perf_vm_image}
-| | ${vm}= | Run keyword | ${vm_name}.Qemu Start
-| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
-| | ${br}= | Set Variable | br0
-| | ${vhost1}= | Get Vhost User If Name By Sock | ${vm} | ${sock1}
-| | ${vhost2}= | Get Vhost User If Name By Sock | ${vm} | ${sock2}
-| | Linux Add Bridge | ${vm} | ${br} | ${vhost1} | ${vhost2}
-| | Set Interface State | ${vm} | ${vhost1} | up | if_type=name
-| | Set Interface State | ${vm} | ${vhost2} | up | if_type=name
-| | Set Interface State | ${vm} | ${br} | up | if_type=name
-| | Return From Keyword | ${vm}