Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiliDeng committed Feb 13, 2025
1 parent eb65b8a commit ca50e13
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lisa/tools/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from lisa.executable import Tool
from lisa.operating_system import Fedora, Posix, Redhat
from lisa.tools import Ip, Kill, Lscpu, Lsmod, Pgrep
from lisa.tools import Ip, KernelConfig, Kill, Lscpu, Lsmod, Pgrep
from lisa.tools.lscpu import CpuType
from lisa.util import LisaException, SkippedException, get_matched_str

Expand Down Expand Up @@ -104,9 +104,10 @@ def create_vm(
f"-device {nic_model},netdev=nettap{self.interface_count},"
f"mac={random_mac_address} "
)
cmd += (
f"-netdev tap,id=nettap{self.interface_count},vhost=on,script=no "
)
if self.node.tools[KernelConfig].is_enabled("CONFIG_VHOST_NET"):
cmd += f"-netdev tap,id=nettap{self.interface_count},vhost=on,script=no "
else:
cmd += f"-netdev tap,id=nettap{self.interface_count},script=no "
added_taps.append(f"tap{self.interface_count}")
self.interface_count += 1

Expand Down

0 comments on commit ca50e13

Please sign in to comment.