[Libvirt-cim] How LIBVIRT-CIM actually works

John Ferlan jferlan at redhat.com
Fri Jan 31 19:52:31 UTC 2014



On 01/30/2014 03:40 AM, Bouabid Mohamed Amine wrote:
> Hello,
> 
> I am a CIM developer and i am interested in LIBVIRT-CIM as a foundation
> for a futur work, so i have some questions about its design:
> 
> How the VMs' life cycle methods are mapped with libvirt API? i mean the
> methods of the class CIM_VirtualSystemManagementService (DefineSystem,
> DestroySystem, ModifyResourceSettings, ModifySystemSettings,
> RemoveResourceSettings)

Suffice to say libvirt-cim hasn't been very active for a number of years
now.  You can look through the monthly archives if you want:

http://www.redhat.com/archives/libvirt-cim/index.html

As such, the libvirt-cim provider does not have as rich an XML parsing
as virsh does since virsh is developed along with features/commands
added to libvirt. Not keeping up causes numerous bugs along the way
where new XML is introduced, but libvirt-cim doesn't know/recognize it
so when it goes to write out the XML again it may not "keep" the newer
XML.  There were some patches posted last month to try and help that
situation out, but they haven't been accepted.

You are certainly welcome to look at the code and provide patches. I
assume some amount of git and code reading experience:

git clone git://libvirt.org/libvirt-cim.git libvirt-cim

I then use things like 'cscope' in order to peruse sources.  Looking up
"DefineSystem" brings me to the 'define_system()' API which calls
'create_system()', then connect_and_create()', and eventually
'virDomainDefineXML()'.

Most API's end up calling some 'virDomain*()' or 'virConnect*()' API.
Because the code is older and must build back to an older version of
libvirt, some of the newer API's aren't utilized. There are instances in
the code using LIBVIR_VERSION_NUMBER.

> 
> What is the relation between the command wirsh and its XML description
> with  the classes CIM_VirtualSystemSettingData,
> CIM_ResourceAllocationSettingData ?
> 

No relationship with virsh at all. Is there something specific that
virsh *dumpxml is providing that you're not seeing perhaps in either of
the two classes you referenced?  I'm assuming yes, but you have to be a
bit more specific as the dartboard is large.

> Is the libvirt-cim provider invoking the virsh command ?
> 

As already been answered. Nope.

virsh is a "CLI" command of sorts for libvirt.  libvirt-cim is a "CLI"
command of sorts for a CIM based application.

I'm not the most proficient CIM developer and far from an expert.
Currently activity is minimal with a few IBM folks still chipping away
at mostly minor point changes.

John




More information about the Libvirt-cim mailing list