summaryrefslogtreecommitdiffstats
path: root/recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch
diff options
context:
space:
mode:
authorBogdan Purcareata <bogdan.purcareata@freescale.com>2013-10-08 17:17:20 +0300
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-10-10 23:25:16 -0400
commitc5568d38acc8b2a7e3ff6e6e3d57740f9221fdde (patch)
tree7f970193e24eb8b6f929c6c90db9fdecf1922844 /recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch
parent4b1938df7242af4599fb6bd1c7e3901df16c86e8 (diff)
downloadmeta-virtualization-c5568d38acc8b2a7e3ff6e6e3d57740f9221fdde.tar.gz
libvirt: Try to fix selinux/securityfs mount handling in LXC
The current behavior for libvirt containers is to configure a set of "basic" mounts in the new container environment by default. Some of these mounts, such as securityfs or selinux, might not have kernel support on all running platforms. The added patchset implements proper handling for this case and makes some additional cleanups and refactoring. The patchset is taken from the upstream libvirt mailing list. Please refer to: https://www.redhat.com/archives/libvir-list/2013-October/msg00270.html Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch')
-rw-r--r--recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch b/recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch
new file mode 100644
index 00000000..5135fb01
--- /dev/null
+++ b/recipes-extended/libvirt/libvirt/0003-Remove-pointless-srcpath-variable-in-lxcContainerMountBasicFS.patch
@@ -0,0 +1,78 @@
1From: "Daniel P. Berrange" <berrange@redhat.com>
2To: libvir-list@redhat.com
3Date: Mon, 7 Oct 2013 14:06:48 +0100
4Message-Id: <1381151211-27111-4-git-send-email-berrange@redhat.com>
5In-Reply-To: <1381151211-27111-1-git-send-email-berrange@redhat.com>
6References: <1381151211-27111-1-git-send-email-berrange@redhat.com>
7X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
8X-loop: libvir-list@redhat.com
9Subject: [libvirt] [PATCH 3/6] Remove pointless 'srcpath' variable in
10 lxcContainerMountBasicFS
11X-BeenThere: libvir-list@redhat.com
12X-Mailman-Version: 2.1.12
13Precedence: junk
14List-Id: Development discussions about the libvirt library & tools
15 <libvir-list.redhat.com>
16List-Unsubscribe: <https://www.redhat.com/mailman/options/libvir-list>,
17 <mailto:libvir-list-request@redhat.com?subject=unsubscribe>
18List-Archive: <https://www.redhat.com/archives/libvir-list>
19List-Post: <mailto:libvir-list@redhat.com>
20List-Help: <mailto:libvir-list-request@redhat.com?subject=help>
21List-Subscribe: <https://www.redhat.com/mailman/listinfo/libvir-list>,
22 <mailto:libvir-list-request@redhat.com?subject=subscribe>
23X-List-Received-Date: Mon, 07 Oct 2013 13:06:59 -0000
24
25From: "Daniel P. Berrange" <berrange@redhat.com>
26
27The 'srcpath' variable is initialized from 'mnt->src' and never
28changed thereafter. Some places continue to use 'mnt->src' and
29others use 'srcpath'. Remove the pointless 'srcpath' variable
30and use 'mnt->src' everywhere.
31
32Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
33---
34 src/lxc/lxc_container.c | 13 +++++--------
35 1 file changed, 5 insertions(+), 8 deletions(-)
36
37diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
38index 3c89ed7..1b1c93b 100644
39--- a/src/lxc/lxc_container.c
40+++ b/src/lxc/lxc_container.c
41@@ -853,16 +853,13 @@ static int lxcContainerMountBasicFS(bool userns_enabled)
42
43 for (i = 0; i < ARRAY_CARDINALITY(lxcBasicMounts); i++) {
44 virLXCBasicMountInfo const *mnt = &lxcBasicMounts[i];
45- const char *srcpath = NULL;
46
47 VIR_DEBUG("Processing %s -> %s",
48 mnt->src, mnt->dst);
49
50- srcpath = mnt->src;
51-
52 /* Skip if mount doesn't exist in source */
53- if ((srcpath[0] == '/') &&
54- (access(srcpath, R_OK) < 0))
55+ if ((mnt->src[0] == '/') &&
56+ (access(mnt->src, R_OK) < 0))
57 continue;
58
59 #if WITH_SELINUX
60@@ -882,11 +879,11 @@ static int lxcContainerMountBasicFS(bool userns_enabled)
61 }
62
63 VIR_DEBUG("Mount %s on %s type=%s flags=%x",
64- srcpath, mnt->dst, mnt->type, mnt->mflags);
65- if (mount(srcpath, mnt->dst, mnt->type, mnt->mflags, NULL) < 0) {
66+ mnt->src, mnt->dst, mnt->type, mnt->mflags);
67+ if (mount(mnt->src, mnt->dst, mnt->type, mnt->mflags, NULL) < 0) {
68 virReportSystemError(errno,
69 _("Failed to mount %s on %s type %s flags=%x"),
70- srcpath, mnt->dst, NULLSTR(mnt->type),
71+ mnt->src, mnt->dst, NULLSTR(mnt->type),
72 mnt->mflags);
73 goto cleanup;
74 }
75--
761.8.3.1
77
78