[libvirt] [PATCH] send 'container=libvirt' in env to container init

Eric Blake eblake at redhat.com
Tue May 17 14:48:42 UTC 2011


On 05/17/2011 08:40 AM, Serge Hallyn wrote:
>>> +++ b/src/lxc/lxc_container.c
>>> @@ -112,6 +112,7 @@ static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef)
>>>  
>>>      virCommandAddEnvString(cmd, "PATH=/bin:/sbin");
>>>      virCommandAddEnvString(cmd, "TERM=linux");
>>> +    virCommandAddEnvString(cmd, "container=libvirt");
>>>      virCommandAddEnvPair(cmd, "LIBVIRT_LXC_UUID", uuidstr);
>>>      virCommandAddEnvPair(cmd, "LIBVIRT_LXC_NAME", vmDef->name);
>>
>> I've no objection to this, but IMHO the value should be
>>
>>    container=libvirt-lxc
> 
> So long as it is guaranteed that henceforth LIBVIRT_LXC_UUID=x will always
> be passed to init, that suffices.  But I worry about it changing in 6 or
> 12 months to a slightly different name, or not always being passed.  Do
> you think there is any chance of that happening?

No risk of change.  Libvirt is documented as providing a stable library,
and LIBVIRT_LXC_UUID is externally visible, therefore it is now part of
our documented interface and we cannot change it without breaking
backwards compatibility.  You can safely use $LIBVIRT_LXC_UUID.

Since Daniel was okay with also adding $container, do you want to keep
this patch under consideration, or are you okay dropping it in favor of
$LIBVIRT_LXC_UUID?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110517/9b89192c/attachment-0001.sig>


More information about the libvir-list mailing list