Blame SOURCES/virt-manager-cli-filesystem-add-binary.sandbox.mode-and-source.socket.patch

ba559b
From 5c16353a007fd7f18eb44a7413d0c146b7de1a4c Mon Sep 17 00:00:00 2001
ba559b
From: Cole Robinson <crobinso@redhat.com>
ba559b
Date: Fri, 30 Jul 2021 13:15:29 -0400
ba559b
Subject: [PATCH] cli: --filesystem: add binary.sandbox.mode and source.socket
ba559b
ba559b
Signed-off-by: Cole Robinson <crobinso@redhat.com>
ba559b
(cherry picked from commit 520b3a3b35359ddd07f3a818d6cc3e6740079eff)
ba559b
ba559b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2045932
ba559b
ba559b
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
ba559b
---
ba559b
 tests/data/cli/compare/virt-install-many-devices.xml | 5 ++++-
ba559b
 tests/test_cli.py                                    | 2 +-
ba559b
 virtinst/cli.py                                      | 2 ++
ba559b
 virtinst/devices/filesystem.py                       | 2 ++
ba559b
 4 files changed, 9 insertions(+), 2 deletions(-)
ba559b
ba559b
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
ba559b
index 3bd756b3..417d8db0 100644
ba559b
--- a/tests/data/cli/compare/virt-install-many-devices.xml
ba559b
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
ba559b
@@ -293,11 +293,14 @@
ba559b
       <readonly/>
ba559b
       <space_hard_limit>1234</space_hard_limit>
ba559b
       <space_soft_limit>500</space_soft_limit>
ba559b
-      <source pool="pool1" volume="vol"/>
ba559b
+      <source pool="pool1" volume="vol">
ba559b
+        <socket>/tmp/foo.sock</socket>
ba559b
+      </source>
ba559b
       <target dir="/foo"/>
ba559b
       <binary path="/foo/virtiofsd" xattr="off">
ba559b
         <cache mode="always"/>
ba559b
         <lock posix="off" flock="on"/>
ba559b
+        <sandbox mode="chroot"/>
ba559b
       </binary>
ba559b
       <driver name="virtiofs" queue="3"/>
ba559b
     </filesystem>
ba559b
diff --git a/tests/test_cli.py b/tests/test_cli.py
ba559b
index 2034d21c..862d19dd 100644
ba559b
--- a/tests/test_cli.py
ba559b
+++ b/tests/test_cli.py
ba559b
@@ -686,7 +686,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
ba559b
 --filesystem type-mount,source.dir=/,target=/
ba559b
 --filesystem type=template,source.name=foo,target=/
ba559b
 --filesystem type=file,source.file=foo.img,target=/
ba559b
---filesystem type=volume,model=virtio,multidevs=remap,readonly=on,space_hard_limit=1234,space_soft_limit=500,source.pool=pool1,source.volume=vol,driver.name=virtiofs,driver.queue=3,binary.path=/foo/virtiofsd,binary.xattr=off,binary.cache.mode=always,binary.lock.posix=off,binary.lock.flock=on,target.dir=/foo
ba559b
+--filesystem type=volume,model=virtio,multidevs=remap,readonly=on,space_hard_limit=1234,space_soft_limit=500,source.pool=pool1,source.volume=vol,driver.name=virtiofs,driver.queue=3,binary.path=/foo/virtiofsd,binary.xattr=off,binary.cache.mode=always,binary.lock.posix=off,binary.lock.flock=on,target.dir=/foo,binary.sandbox.mode=chroot,source.socket=/tmp/foo.sock
ba559b
 --filesystem type=block,source.dev=/dev/foo,target.dir=/
ba559b
 --filesystem type=ram,source.usage=1024,source.units=MiB,target=/
ba559b
 
ba559b
diff --git a/virtinst/cli.py b/virtinst/cli.py
ba559b
index dbd4a545..13782fc8 100644
ba559b
--- a/virtinst/cli.py
ba559b
+++ b/virtinst/cli.py
ba559b
@@ -4225,6 +4225,7 @@ class ParserFilesystem(VirtCLIParser):
ba559b
         cls.add_arg("source.volume", "source_volume")
ba559b
         cls.add_arg("source.units", "source_units")
ba559b
         cls.add_arg("source.usage", "source_usage")
ba559b
+        cls.add_arg("source.socket", "source_socket")
ba559b
 
ba559b
         cls.add_arg("target.dir", "target_dir")
ba559b
 
ba559b
@@ -4233,6 +4234,7 @@ class ParserFilesystem(VirtCLIParser):
ba559b
         cls.add_arg("binary.cache.mode", "binary_cache_mode")
ba559b
         cls.add_arg("binary.lock.posix", "binary_lock_posix", is_onoff=True)
ba559b
         cls.add_arg("binary.lock.flock", "binary_lock_flock", is_onoff=True)
ba559b
+        cls.add_arg("binary.sandbox.mode", "binary_sandbox_mode")
ba559b
 
ba559b
         cls.add_arg("driver.format", "driver_format")
ba559b
         cls.add_arg("driver.name", "driver_name")
ba559b
diff --git a/virtinst/devices/filesystem.py b/virtinst/devices/filesystem.py
ba559b
index 574844b6..02402bac 100644
ba559b
--- a/virtinst/devices/filesystem.py
ba559b
+++ b/virtinst/devices/filesystem.py
ba559b
@@ -49,12 +49,14 @@ class DeviceFilesystem(Device):
ba559b
     source_units = XMLProperty("./source/@units")
ba559b
     source_pool = XMLProperty("./source/@pool")
ba559b
     source_volume = XMLProperty("./source/@volume")
ba559b
+    source_socket = XMLProperty("./source/socket")
ba559b
 
ba559b
     binary_path = XMLProperty("./binary/@path")
ba559b
     binary_xattr = XMLProperty("./binary/@xattr", is_onoff=True)
ba559b
     binary_cache_mode = XMLProperty("./binary/cache/@mode")
ba559b
     binary_lock_posix = XMLProperty("./binary/lock/@posix", is_onoff=True)
ba559b
     binary_lock_flock = XMLProperty("./binary/lock/@flock", is_onoff=True)
ba559b
+    binary_sandbox_mode = XMLProperty("./binary/sandbox/@mode")
ba559b
 
ba559b
     def _type_to_source_prop(self):
ba559b
         if self.type == DeviceFilesystem.TYPE_TEMPLATE:
ba559b
-- 
ba559b
2.34.1
ba559b