Skip to content

Commit

Permalink
qdevices: Adapt virtiofsd options
Browse files Browse the repository at this point in the history
Some options are deprecated since the dedicated virtiofsd package
since rhel9, while before virtiofsd belongs to qemu package.

Signed-off-by: Tingting Mao <[email protected]>
  • Loading branch information
hellohellenmao committed Sep 5, 2024
1 parent b7ca5fd commit eb03767
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions virttest/qemu_devices/qdevices.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import re
import shutil
import signal
import subprocess
import time
import traceback
from collections import OrderedDict
Expand Down Expand Up @@ -2259,11 +2260,26 @@ def _handle_log(self, line):

def start_daemon(self):
"""Start the virtiofs daemon in background."""
fsd_cmd = "%s --socket-path=%s" % (
self.get_param("binary"),
self.get_param("sock_path"),
virtiofs_binary = self.get_param("binary")
socket_path = self.get_param("sock_path")
source_dir = self.get_param("source")

fsd_cmd = f"{virtiofs_binary} --socket-path={socket_path}"

# capture the capabilities of virtiofsd
result = subprocess.check_output(
[virtiofs_binary, "--print-capabilities"], universal_newlines=True
)
fsd_cmd += " -o source=%s" % self.get_param("source")
virtiofs_cpblt = json.loads(result)

if (
"features" in virtiofs_cpblt
and "separate-options" in virtiofs_cpblt["features"]
):
fsd_cmd += f" --shared-dir {source_dir}"
else:
fsd_cmd += f" -o source={source_dir}"

if self.get_param("enable_debug_mode") == "on":
fsd_cmd += " -d"
self.set_param("status_active", "Waiting for vhost-user socket connection")
Expand Down

0 comments on commit eb03767

Please sign in to comment.