Re: [PATCH] Expose name + UUID to LXC containers via env variables

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

 



On Tue, Feb 22, 2011 at 07:50:43AM -0700, Eric Blake wrote:
> On 02/22/2011 07:08 AM, Daniel P. Berrange wrote:
> > When spawning 'init' in the container, set
> > 
> >   LIBVIRT_LXC_UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
> >   LIBVIRT_LXC_NAME=YYYYYYYYYYYY
> > 
> > to allow guest software to detect & identify that they
> > are in a container
> 
> Sounds reasonable.  Does virt-what know to look for these yet?
> 
> > @@ -109,6 +124,8 @@ static int lxcContainerExecInit(virDomainDefPtr vmDef)
> >      const char *const envp[] = {
> >          "PATH=/bin:/sbin",
> >          "TERM=linux",
> > +        uuidenv,
> > +        nameenv,
> >          NULL,
> >      };
> 
> ACK, but why aren't we using virCommand yet?

Containers are very special in their startup requirements. You can't use
a plain fork()+exec() to create them. We use clone() call with a bunch of
magic flags, and then do crazy stuff pivot_root/mount setup and finally
execve() the container init process.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]