Re: [sandbox][PATCH 2/2] virt-sandbox-service: mount /var after all other file systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 25, 2014 at 02:29:26PM +0100, Cédric Bosdonnat wrote:
When creating a sandbox with an image file, the /var folder contains
the mounted image. If we mount it before other file systems, how
could we possibly mount them? The new /var won't contain the mounted
image.
---
bin/virt-sandbox-service | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/virt-sandbox-service b/bin/virt-sandbox-service
index 7f72107..701bd6e 100755
--- a/bin/virt-sandbox-service
+++ b/bin/virt-sandbox-service
@@ -658,7 +658,7 @@ WantedBy=multi-user.target
        self.config.add_mount(mount)

        for d in self.BIND_SYSTEM_DIRS:
-            if os.path.exists(d):
+            if d != "/var" and os.path.exists(d):
                source = "%s%s" % ( self.dest, d)
                self.add_bind_mount(source, d)

@@ -677,6 +677,10 @@ WantedBy=multi-user.target
            if not found:
                source = "%s%s" % ( self.dest, d)
                self.add_bind_mount(source, d)
+
+        # /var contains the mounted image if there is an image: should be the
+        # last thing to mount
+        self.add_bind_mount(source, "/var")

You have the source set from a random value from self.dirs, ACK if you
use "%s/var" % self.dist instead of source.

Martin

        self.add_mounts()

    def get_expanded_unit_template(self, unit):
--
2.1.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]