[Libvirt-cim] [PATCH] [TEST] #2 LXC support using DefineSystem & VSMS.01

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Jun 3 16:49:02 UTC 2008


Zhengang Li wrote:
> Kaitlin Rupert wrote:
> 
>>> +    # LXC only takes disk and memory device for now.
>>> +    # Only disk __init__ takes different params.
>>> +    if virt == 'LXC':
>>> +        d = LXC_DiskResourceAllocationSettingData(
>>> +                mountpoint=const.LXC_default_mp,
>>> +                source=const.LXC_default_mp, name=dom_name)
>>
>> Instead of using the same directory for the mountpoint and the source. 
>> You could create a directory such as /tmp/lxc_files to mount on /tmp. 
>> That way we can distinguish between the two.
> I'll add this in the next revision.

Sure - no problem.

> 
>>
>>> +    else:
>>> +        class_dasd = get_dasd_class(virt)
>>> +        if virt == 'KVM':
>>> +            disk_dev = 'hda'
>>> +            disk_source = const.KVM_disk_path
>>> +        elif virt == 'XenFV':
>>> +            disk_dev = 'hda'
>>> +            disk_source = const.XenFV_disk_path
>>> +        d = class_dasd(
>>> +                    dev=disk_dev, +                    
>>> source=disk_source,
>>> +                    name=dom_name)
>>> +         class_nasd = get_nasd_class(virt)
>>
>> We'll need to skip over network and processor for now, since they 
>> aren't supported.
> I tried with 'None' and empty values to the network and processor 
> mof-string. Pywbem had a problem parsing them. How do we skip the two 
> devices?

You don't need to specify RASDs for every device.  So, you can return 
something like the following for containers:

return vssd.mof(), [d.mof(), m.mof()]

So, you could reorder things so that disk and memory are created first, 
then check if the virt type is LXC and return.  Or you can just skip 
over the network and proc RASD creation in the case of LXC.  And then 
return accordingly at the end.

Either way is fine. I think the latter might be useful - it'll be easier 
to enable containers for network/processor should that kind of support 
come available.

-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list