Re: [PATCH 2/4] Avoid LXC pivot root in the root source is still /

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

 



On 05/11/2012 10:48 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP 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]