Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
virtme
0002-Use-fsdev-multidevs-remap-on-QEMU-4.2.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Use-fsdev-multidevs-remap-on-QEMU-4.2.patch of Package virtme
From 5e80c9310ca2280db20ff984046251da88c0095f Mon Sep 17 00:00:00 2001 From: Andy Lutomirski <luto@kernel.org> Date: Sun, 19 Jul 2020 11:05:29 -0700 Subject: [PATCH 2/6] Use -fsdev multidevs=remap on QEMU 4.2+ Apparently having a virtfs export that spans multiple host filesystems can cause problems in the guest. QEMU 4.2+ will warn about this and supports a workaround: multidevs=remap. Probe for new enough QEMU and pass multidevs=remap on 4.2+. See #60. Signed-off-by: Andy Lutomirski <luto@kernel.org> --- virtme/commands/run.py | 9 ++++++--- virtme/qemu_helpers.py | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/virtme/commands/run.py b/virtme/commands/run.py index 5d9b96b..46cf312 100644 --- a/virtme/commands/run.py +++ b/virtme/commands/run.py @@ -236,13 +236,16 @@ def find_kernel_and_mods(arch, args) -> Kernel: return kernel -def export_virtfs(qemu, arch, qemuargs, path, mount_tag, security_model='none', readonly=True) -> None: +def export_virtfs(qemu: qemu_helpers.Qemu, arch: architectures.Arch, + qemuargs: List[str], path: str, + mount_tag: str, security_model='none', readonly=True) -> None: # NB: We can't use -virtfs for this, because it can't handle a mount_tag # that isn't a valid QEMU identifier. fsid = 'virtfs%d' % len(qemuargs) - qemuargs.extend(['-fsdev', 'local,id=%s,path=%s,security_model=%s%s' % + qemuargs.extend(['-fsdev', 'local,id=%s,path=%s,security_model=%s%s%s' % (fsid, qemu.quote_optarg(path), - security_model, ',readonly' if readonly else '')]) + security_model, ',readonly' if readonly else '', + ',multidevs=remap' if qemu.has_multidevs else '')]) qemuargs.extend(['-device', '%s,fsdev=%s,mount_tag=%s' % (arch.virtio_dev_type('9p'), fsid, qemu.quote_optarg(mount_tag))]) def quote_karg(arg: str) -> str: diff --git a/virtme/qemu_helpers.py b/virtme/qemu_helpers.py index 8ddc3dd..6ba0c03 100644 --- a/virtme/qemu_helpers.py +++ b/virtme/qemu_helpers.py @@ -30,6 +30,10 @@ class Qemu(object): self.cannot_overmount_virtfs = ( re.search(r'version 1\.[012345]', self.version) is not None) + # QEMU 4.2+ supports -fsdev multidevs=remap + self.has_multidevs = ( + re.search(r'version (?:1\.|2\.|3\.|4\.[01][^\d])', self.version) is None) + def quote_optarg(self, a): """Quote an argument to an option.""" return a.replace(',', ',,') -- 2.27.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor