[PATCH 0 of 2] [RFC] Prepare provider registration and provider name for OpenWbem

To enable the libvirt-cim providers for registration and work with OpenWbem it is necessary to update the mof files with an additional "Provider" qualifier and slightly change the provider name. patch 1: updated the mof files with the additional "Provider" qualifier. The syntax is "<provider interface>:<module name>". For our providers this means "cmpi:<filename>", e.g. "cmpi:Virt_HostSystem" patch 2: the registration for OpenWbem requires an entry point <modulename>_Create_InstanceMI, which means that the filename and the providername have to become the same. This is necessary to let STD_InstanceMIStub correctly create the right CMPI entry points. I have tested this setup with sfcb, Pegasus and OpenWbem and it worked for all. If no one encounteres issues with this slighly changed provider naming, I will create patches for all providers. If someone has a hard requirement to name the provider different compared to the file, please raise your hand ;). I look forward an interesting discussion.

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1197981478 -3600 # Node ID 620a0b90739abfcd605968458fc5bcfe7ada7d6a # Parent 65312624c9db0b41ec81ccb81a37274cf6901996 HostSystem: Added Provider qualifier to mof for OpenWbem support Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 65312624c9db -r 620a0b90739a schema/HostSystem.mof --- a/schema/HostSystem.mof Tue Dec 18 12:57:26 2007 +0100 +++ b/schema/HostSystem.mof Tue Dec 18 13:37:58 2007 +0100 @@ -2,7 +2,8 @@ [Description ( "A class derived from CIM_ComputerSystem to represent " - "the Xen host system.") + "the Xen host system."), + Provider("cmpi:Virt_HostSystem") ] class Xen_HostSystem : CIM_ComputerSystem { @@ -10,7 +11,8 @@ class Xen_HostSystem : CIM_ComputerSyste [Description ( "A class derived from CIM_ComputerSystem to represent " - "the KVM host system.") + "the KVM host system."), + Provider("cmpi:Virt_HostSystem") ] class KVM_HostSystem : CIM_ComputerSystem {

# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1197982193 -3600 # Node ID 3466e99c2b386af976b9f1f0e230606ea6a571eb # Parent 620a0b90739abfcd605968458fc5bcfe7ada7d6a Renamed provider from HostSystemProvider to HostSystem Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 620a0b90739a -r 3466e99c2b38 schema/HostSystem.registration --- a/schema/HostSystem.registration Tue Dec 18 13:37:58 2007 +0100 +++ b/schema/HostSystem.registration Tue Dec 18 13:49:53 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance -KVM_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance +Xen_HostSystem root/virt Virt_HostSystem Virt_HostSystem instance +KVM_HostSystem root/virt Virt_HostSystem Virt_HostSystem instance diff -r 620a0b90739a -r 3466e99c2b38 src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Tue Dec 18 13:37:58 2007 +0100 +++ b/src/Virt_HostSystem.c Tue Dec 18 13:49:53 2007 +0100 @@ -173,7 +173,7 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -STD_InstanceMIStub(, Virt_HostSystemProvider, _BROKER, libvirt_cim_init()); +STD_InstanceMIStub(, Virt_HostSystem, _BROKER, libvirt_cim_init()); /* * Local Variables:

Heidi Eckhart wrote:
To enable the libvirt-cim providers for registration and work with OpenWbem it is necessary to update the mof files with an additional "Provider" qualifier and slightly change the provider name.
patch 1: updated the mof files with the additional "Provider" qualifier. The syntax is "<provider interface>:<module name>". For our providers this means "cmpi:<filename>", e.g. "cmpi:Virt_HostSystem" patch 2: the registration for OpenWbem requires an entry point <modulename>_Create_InstanceMI, which means that the filename and the providername have to become the same. This is necessary to let STD_InstanceMIStub correctly create the right CMPI entry points.
I have tested this setup with sfcb, Pegasus and OpenWbem and it worked for all. If no one encounteres issues with this slighly changed provider naming, I will create patches for all providers. If someone has a hard requirement to name the provider different compared to the file, please raise your hand ;). I look forward an interesting discussion.
I tested this with tog-pegasus-2.6.1-2.fc8 - no problems for me. I don't have any foreseeable objections to the name change either. I haven't seen the "Provider" qualifier before. Is this something non-standard that OpenWbem requires? Or is this a standard qualifier that Pegasus / sfcb opt not to use? -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com

Kaitlin Rupert wrote:
I haven't seen the "Provider" qualifier before. Is this something non-standard that OpenWbem requires? Or is this a standard qualifier that Pegasus / sfcb opt not to use?
This is very close to what the "Provider" qualifier is. Section 2.5.3 "Optional Qualifiers" of DMTF's DSP0004 "CIM Infrastructure Specification" v2.3 Final describes it as following: The optional qualifiers listed in this table address situations that are not common to all CIM-compliant implementations. Thus, CIM-compliant implementations can ignore optional qualifiers since they are not required to interpret or understand these qualifiers. These are provided in the specification to avoid random user-defined qualifiers for these recurring situations. ... PROVIDER: An implementation specific handle to the instrumentation that populates those elements in the schemas that refer to dynamic data. ... OpenWbem makes use of the optional "Provider" qualifier, while Pegasus and sfcb ignore the qualifier and have their own approach to register providers. That's why we also need the provider_register script and the registration files. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

Heidi Eckhart wrote:
This is very close to what the "Provider" qualifier is. Section 2.5.3 "Optional Qualifiers" of DMTF's DSP0004 "CIM Infrastructure Specification" v2.3 Final describes it as following:
The optional qualifiers listed in this table address situations that are not common to all CIM-compliant implementations. Thus, CIM-compliant implementations can ignore optional qualifiers since they are not required to interpret or understand these qualifiers. These are provided in the specification to avoid random user-defined qualifiers for these recurring situations. ... PROVIDER: An implementation specific handle to the instrumentation that populates those elements in the schemas that refer to dynamic data. ...
OpenWbem makes use of the optional "Provider" qualifier, while Pegasus and sfcb ignore the qualifier and have their own approach to register providers. That's why we also need the provider_register script and the registration files.
Ah, I see. It wasn't clear to me at first what this qualifier was being used for. I get it now though, thanks. =) -- Kaitlin Rupert IBM Linux Technology Center karupert@us.ibm.com

HE> patch 1: updated the mof files with the additional "Provider" HE> qualifier. The syntax is "<provider interface>:<module name>". For HE> our providers this means "cmpi:<filename>", HE> e.g. "cmpi:Virt_HostSystem" Ugh.. Is this how OpenWBEM does registration? Meaning, does this eliminate the need for the .registration files for OpenWBEM? I guess by now I should expect no fewer than X different ways of doing things, given X CIMOMs :) HE> patch 2: the registration for OpenWbem requires an entry point HE> <modulename>_Create_InstanceMI, which means that the filename and HE> the providername have to become the same. This is necessary to let HE> STD_InstanceMIStub correctly create the right CMPI entry points. Seems reasonable, and possibly more organized. HE> I have tested this setup with sfcb, Pegasus and OpenWbem and it HE> worked for all. If no one encounteres issues with this slighly HE> changed provider naming, I will create patches for all HE> providers. If someone has a hard requirement to name the provider HE> different compared to the file, please raise your hand ;). I look HE> forward an interesting discussion. The easiest thing would be to go through and rename the providers to match the files, but I wonder if it isn't worth organizing things a bit further. Right now, we have some that are completely expanded (Virt_VirtualSystemManagementService.c) and others that are compressed (Virt_VSSD.c). Would it make sense to also rename the files (where appropriate) for more consistency? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

Dan Smith wrote:
HE> patch 1: updated the mof files with the additional "Provider" HE> qualifier. The syntax is "<provider interface>:<module name>". For HE> our providers this means "cmpi:<filename>", HE> e.g. "cmpi:Virt_HostSystem"
Ugh.. Is this how OpenWBEM does registration? Yes, and even more. The provider_register script added an additional ":" between the <provider interface> and <module name>. I have fixed this and will resend with the complete patch set. Meaning, does this eliminate the need for the .registration files for OpenWBEM? Yes, but only for OpenWbem. We still need it for Pegasus and sfcb. I guess by now I should expect no fewer than X different ways of doing things, given X CIMOMs :)
I can only say - yes ;).
HE> patch 2: the registration for OpenWbem requires an entry point HE> <modulename>_Create_InstanceMI, which means that the filename and HE> the providername have to become the same. This is necessary to let HE> STD_InstanceMIStub correctly create the right CMPI entry points.
Seems reasonable, and possibly more organized.
Yes, but maybe this is also a limitation. The approach to allow a different module and provider name enables hosting multiple providers in one module. Its not that I would recommend writing such a provider module - really not, because this blows up the module and makes the code worse readable - but this possibility is then gone. For the libvirt-cim providers no problem, because we do not - and definitely will not ;) - make use of this possibility. I'm only saying this to describe a bit of the background for defining providername and modulename in the registration files.
HE> I have tested this setup with sfcb, Pegasus and OpenWbem and itI would rather call it HE> worked for all. If no one encounteres issues with this slighly HE> changed provider naming, I will create patches for all HE> providers. If someone has a hard requirement to name the provider HE> different compared to the file, please raise your hand ;). I look HE> forward an interesting discussion.
The easiest thing would be to go through and rename the providers to match the files, but I wonder if it isn't worth organizing things a bit further. Right now, we have some that are completely expanded (Virt_VirtualSystemManagementService.c) and others that are compressed (Virt_VSSD.c). Would it make sense to also rename the files (where appropriate) for more consistency?
Yes, consistency makes always sense :) ! If the others are ok with this change, I will expand the filenames of the compressed providers in a separate patch set. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck@linux.vnet.ibm.com ************************************************** IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Martin Jetter Geschaeftsfuehrung: Herbert Kircher Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
participants (3)
-
Dan Smith
-
Heidi Eckhart
-
Kaitlin Rupert