Deepak Shetty <deepakcs(a)linux.vnet.ibm.com>
Sent by: libvirt-cim-bounces(a)redhat.com
12/02/2011 05:13 AM
Please respond to
List for discussion and development of libvirt CIM
<libvirt-cim(a)redhat.com>
To
libvirt-cim(a)redhat.com
cc
Subject
Re: [Libvirt-cim] RFC : Introducing new CIM_RES_TYPE for 9pfs
support on QEMU/KVM environment
On 12/02/2011 01:23 PM, Deepak Shetty wrote:
> On 12/02/2011 04:32 AM, Sharad Mishra wrote:
[...]
>> <filesystem type='mount'>
>> <driver type='handle'/>
>> <source dir='/tmp/virt1'/>
>> <target dir='test-lib'/>
>> <alias name='fs0'/>
>> <address type='pci' domain='0x0000' bus='0x00'
slot='0x03'
>> function='0x0'/>
>> </filesystem>
>> What in the above libvirt XML makes it specific to 9pfs? I am
>> looking for
>> special 'tags' or 'properties'.
>>
>> -Sharad Mishra
> type='mount' makes it specific to 9pfs. So its the type attribute of
> the filesystem tag.
> I confirmed the same by looking into libvirt code also.
>
[...]
>>> The<filesystem> node comes directly under the<domain> node.
>>>
>>> My approach for introducing 9pfs support in libvirt-cim is ...
>>>
>>> 1) Add a new CIM res type, eg; CIM_RES_TYPE_9PFS, is this ok ?
>>>
>>> 2) Add appropriate handlers for the above new resource type
>>>
>>> 3) Add new members in struct domain for representing this new device
>> type.
>>> 4) Add appropriate xml parsing generation tags for the new resource
>>> type.
>>>
>>> 5) I probably need to add something like
>>> KVM_9PFSResourceAllocationSettingData -- I am not very clear on this
>>> yet.
>>> Need some help on how to do this ?
>>>
I found some more enlightment today looking at the code, so here are my
newer thoughts...
1) It looks like the <filesystem> libvirt xml node ( that comes directly
under <devices>) is supported in a psuedo fashion, under
CIM_RES_TYPE_DISK, is this correct ?
It does res_type = ...DISK and dev_type = ..DISK_FS.
That is right. So, a filesystem is a disk device with type set to DISK_FS.
2) The cim code is structured in such a way that for each device type
that comes under <devices> there is a virt-device and
<device_type>_device (eg: disk_device, net_device) structures and they
are described by the respective RASDs. In following this tradition the
there should have been virt_device and fs_device structures to
correspond to the <filesystem> device type, eventually getting embedded
under 'struct domain' but I don't see it, why is this so ? Why is
<filesystem> treated differently in cim code ?
Not sure why its treated differently.
3) Assuming "yes" to #1 above, i need to extend the EmulatedType in
KVM_DiskResourceAllocationSettingData to support "filesystem" as a
value, set the disk_type = DISK_FS in disk_rasd_to_vdev and then it
should probably work, as the disk_xml and disk_fs_xml code is already
present to create the <filesystem> xml node.
Bulk of the code already exist. You may need to test it and fix some bugs.
4) I probably will re-use some of the members of
KVM_DiskResourceAllocationSettingData from a 9pfs perspective, source
and target will remain same as before, DriverCache, Address, may not be
relevant for 9pfs. I might need to add few more stuff in DiskRASD as
needed to support more sub-elements and attributes in for the
<filesystem> in 9pfs case.
Depending on your requirement, you may have to add new properties.
-Sharad
Let me know if the above approach/understanding is correct. Appreciate
your inputs.
thanx,
deepak
_______________________________________________
Libvirt-cim mailing list
Libvirt-cim(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-cim