On 05/11/2012 10:48 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
If the LXC config has a filesystem
<filesystem>
<source dir='/'/>
<target dir='/'/>
</filesystem>
then there is no need to go down the pivot root codepath.
We can simply use the existing root as needed.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_container.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
@@ -1192,10 +1201,14 @@ static int
lxcContainerSetupMounts(virDomainDefPtr vmDef,
if (lxcContainerResolveSymlinks(vmDef) < 0)
return -1;
- if (root)
+ /* If the user has specified a dst '/' with a source of '/'
+ * then we don't really want to go down the pivot root
+ * path, as we're just tuning the existing root
+ */
+ if (root && root->src && STRNEQ(root->src, "/"))
Do we want to handle users that spell things as "///" instead of "/"?
But that's a corner case that doesn't affect this change.
ACK.
--
Eric Blake eblake(a)redhat.com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org