From danms at us.ibm.com Thu Nov 1 02:30:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 31 Oct 2007 19:30:09 -0700 Subject: [Libvirt-cim] [PATCH] Add some starter web content Message-ID: # HG changeset patch # User Dan Smith # Date 1193884206 25200 # Node ID b698e473b09ff77c24ff87db74ef112cd726a177 # Parent d349e62b888f0dda3577ff0e55f4dbe7681a5d57 Add some starter web content I have added a couple of new content sections since last time. I also trimmed and tweaked site.xsl a bit. I think this is probably close to "good enough" for a project announcement. Signed-off-by: Dan Smith diff -r d349e62b888f -r b698e473b09f Makefile.am --- a/Makefile.am Wed Oct 31 17:04:17 2007 -0700 +++ b/Makefile.am Wed Oct 31 19:30:06 2007 -0700 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 -SUBDIRS = libxkutil src +SUBDIRS = libxkutil src doc MOFS = \ schema/ComputerSystem.mof \ diff -r d349e62b888f -r b698e473b09f configure.ac --- a/configure.ac Wed Oct 31 17:04:17 2007 -0700 +++ b/configure.ac Wed Oct 31 19:30:06 2007 -0700 @@ -67,6 +67,7 @@ AC_CONFIG_FILES([ libxkutil/tests/Makefile src/Makefile src/tests/Makefile + doc/Makefile Makefile ]) diff -r d349e62b888f -r b698e473b09f doc/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/Makefile.am Wed Oct 31 19:30:06 2007 -0700 @@ -0,0 +1,9 @@ +XSLTPROC = /usr/bin/xsltproc + +WEB_PAGES = index.html + +$(WEB_PAGES): libvirt-cim.html site.xsl + $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html + +all: $(WEB_PAGES) + diff -r d349e62b888f -r b698e473b09f doc/libvirt-cim.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/libvirt-cim.html Wed Oct 31 19:30:06 2007 -0700 @@ -0,0 +1,172 @@ + + + + Libvirt-CIM: The CIM provider for libvirt + + + +

Libvirt-CIM: The CIM provider for libvirt

+ +

Note: this is the flat content of the web site

+ +

libvirt-cim

+ +

What is libvirt-cim?

+ +

Libvirt-CIM is a CIM provider for managing linux virtualization + platforms using libvirt. It is written in C and should work in any + CIMOM that supports CMPI 2.0 providers. The intent is to implement + the SVPC virtualization class model currently available in the DMTF + Experimental 2.16 schema. +

+ +

Releases

+ +

There have been no releases to date

+ +

Introduction

+ +

Libvirt-CIM is a CIM provider for managing linux virtualization + platforms using libvirt. It is written in C and should work in any + CIMOM that supports CMPI 2.0 providers. The intent is to implement + the SVPC virtualization class model currently available in the DMTF + Experimental 2.16 schema. +

+ +

The providers are currently under heavy development. Focus is on + Xen support right now, which means some of the providers have some + "shortcuts" hard-coded to Xen right now. The long-term goal is to + support all of the platforms that libvirt supports with minimal + differences. +

+ +

Downloads

+ +

The libvirt-cim development tree can be found in the + libvirt.org/hg repository. +

+ +

To get a copy of the development tree, use + mercurial's + clone feature: +

+ +

$ hg clone http://libvirt.org/hg/libvirt-cim

+ +

Alternatively, you can grab a + tarball or + zip + file snapshot of the repository. +

+ +

Schema

+ +

The libvirt-cim provider depends on an installed + DMTF + CIM v2.16 Experimental schema. The package can be obtained +here.

+ +

To install the schema in Pegasus:

+ +

+ $ PEGASUS_REPO=/var/lib/Pegasus # adjust this as needed
+ $ mkdir cim216
+ $ cd cim216
+ $ unzip $PATH_TO_ZIPFILE
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd cimv216.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd qualifiers.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd qualifiers_optional.mof
+

+ +

To install the schema in SFCB:

+ +

+ $ SFCB_CIM=/usr/local/share/sfcb/CIM # adjust this as needed
+ $ mkdir cim216
+ $ cd cim216
+ $ unzip $PATH_TO_ZIPFILE
+ $ mv cimv216.mof CIM_Schema.mof
+ $ sudo cp * $SFCB_CIM
+ $ sudo sfcbrepos
+

+ +

Note: in both cases, the CIM v2.16 schema seems to have a + few classes that don't register correctly. You may need to + disable installation of classes with something like the + following: +

+ +

+--- CIM_Schema.mof 2007-10-15 00:15:44.000000000 -0700
++++ cimv216.mof 2007-10-22 10:11:19.000000000 -0700
+@@ -507,3 +507,3 @@
+ #pragma include ("Policy/CIM_SharedSecretAuthentication.mof")
+-#pragma include ("Security/CIM_SecurityIndication.mof")
++//#pragma include ("Security/CIM_SecurityIndication.mof")
+ #pragma include ("Support/PRS_Activity.mof")
+@@ -728,4 +728,4 @@
+ #pragma include ("Policy/CIM_PolicyConditionInPolicyRule.mof")
+-#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")
+-#pragma include ("Security/CIM_IPPacketFilterIndication.mof")
++//#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")
++//#pragma include ("Security/CIM_IPPacketFilterIndication.mof")
+ #pragma include ("Support/PRS_ActivityContact.mof")
+

+ +

Platform Support

+ +

Currently, libvirt-cim is targetting Xen as its primary support + platform because is has the largest installed user base. The + long-term plan is to support many others (hopefully any that libvirt + supports). This includes KVM and containers. +

+ +

The code base currently has many Xen-specific "shortcuts" that need + to be resolved and generalized in order to support other platforms. + A short list of these may include:

+
    +
  • The XML generation and parsing code and the related device + modeling code.
  • +
  • The libvirt connection logic. Right now, (in most places) we + detect the current hypervisor in use and connect to libvirt + appropriately. This may or may not be the correct behavior in a + situation where you could need to support containers and QEMU + virtual machines.
  • +
  • Some lingering hard-coded "Xen_Foo" class names.
  • +
+ +

Further, supporting new platforms have some registration and + modeling implications:

+
    +
  • Additions to the MOF and registration files for "branded" + classes (Xen_Foo, KVM_Foo, etc)
  • +
  • Modifications to some of the association providers that register + separate CMPI provider structures for each class type they handle + (to avoid duplicate results in the general case)
  • +
+ +

Architecture

+ +

The libvirt-cim provider consists of two major parts:

+ +
    +
  • The provider classes themselves (src/)
  • +
  • A helper library of common components (libxkutil/)
  • +
+ +

The provider classes implement the actual CIM class model. Some of + the provider libraries implement one CIM class and one providier. + However, many of them perform more than one task. For example, + the Virt_Device and Virt_DevicePool providers + implement the device and device pool classes for each of the major + device types: Memory, Processor, Network, and Disk. +

+ +

The helper library contains common routines that almost all of the + providers use, such as libvirt connection type detection and device + and system XML parsing. +

+ + + + diff -r d349e62b888f -r b698e473b09f doc/site.xsl --- a/doc/site.xsl Wed Oct 31 17:04:17 2007 -0700 +++ b/doc/site.xsl Wed Oct 31 19:30:06 2007 -0700 @@ -19,7 +19,7 @@ docs.html - bugs.html + development.html help.html @@ -37,28 +37,19 @@ news.html - contribs.html - - - format.html + development.html architecture.html - - python.html - FAQ.html - - remote.html - - - uri.html - - - hvsupport.html + + platforms.html + + + schema.html unknown.html @@ -77,11 +68,11 @@ the main menu box --> - - + From veillard at redhat.com Thu Nov 1 08:58:04 2007 From: veillard at redhat.com (Daniel Veillard) Date: Thu, 01 Nov 2007 09:58:04 +0100 Subject: [Libvirt-cim] [PATCH] Add some starter web content In-Reply-To: References: Message-ID: <4729951C.3080801@redhat.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1193884206 25200 > # Node ID b698e473b09ff77c24ff87db74ef112cd726a177 > # Parent d349e62b888f0dda3577ff0e55f4dbe7681a5d57 > Add some starter web content > I have added a couple of new content sections since last time. I also > trimmed and tweaked site.xsl a bit. I think this is probably close to > "good enough" for a project announcement. Looks fine by me ! It will be easier to review and update once it's online, so let's commit it, thanks :-) Daniel From veillard at redhat.com Thu Nov 1 10:07:02 2007 From: veillard at redhat.com (Daniel Veillard) Date: Thu, 1 Nov 2007 06:07:02 -0400 Subject: [Libvirt-cim] [PATCH] fix trivial libcmpiutil compilation issue Message-ID: <20071101100702.GA25921@redhat.com> # HG changeset patch # User Daniel Veillard # Date 1193910954 -3600 # Node ID 5e54246e74833caed8f5176f8bd5bb9e28b60299 # Parent 05b01d03f0b801afe266d8d012bc464be6a2d165 Fix a trivial compilation problem, the variable declaration is at the wrong place. Signed-off-by: Daniel Veillard Daniel diff -r 05b01d03f0b8 -r 5e54246e7483 eo_parser.c --- a/eo_parser.c Sun Feb 15 22:01:53 2015 -0800 +++ b/eo_parser.c Thu Nov 01 10:55:54 2007 +0100 @@ -66,9 +66,9 @@ int cu_parse_embedded_instance(const cha const CMPIBroker *broker, CMPIInstance **instance) { + int ret; #ifdef HAVE_EOPARSER int fd; - int ret; FILE *fp; fd = write_temp(eo); -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From heidieck at linux.vnet.ibm.com Thu Nov 1 09:06:50 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 11:06:50 +0200 Subject: [Libvirt-cim] [PATCH] Registration of ElementConformsToProfile for two namespaces causes errors with Pegasus Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1193911569 -3600 # Node ID a44ff1bcb3942783ac939d843dfbe04efe677166 # Parent bf5ad6924b99903d68d019a7c5faaa2f5a5d1ef9 Registration of ElementConformsToProfile for two namespaces causes errors with Pegasus Signed-off-by: Heidi Eckhart diff -r bf5ad6924b99 -r a44ff1bcb394 schema/ElementConformsToProfile.registration --- a/schema/ElementConformsToProfile.registration Mon Oct 29 15:39:52 2007 -0400 +++ b/schema/ElementConformsToProfile.registration Thu Nov 01 11:06:09 2007 +0100 @@ -1,7 +1,7 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association +#Xen_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association Xen_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association +#KVM_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association KVM_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association From heidieck at linux.vnet.ibm.com Thu Nov 1 09:11:54 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 11:11:54 +0200 Subject: [Libvirt-cim] [PATCH] Provider registration script does not uninstall classes correctly for Pegasus Message-ID: <1d63d3271f9037ec0699.1193911914@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1193911654 -3600 # Node ID 1d63d3271f9037ec0699808fec54bd5083aea849 # Parent a44ff1bcb3942783ac939d843dfbe04efe677166 Provider registration script does not uninstall classes correctly for Pegasus Signed-off-by: Heidi Eckhart diff -r a44ff1bcb394 -r 1d63d3271f90 Makefile.am --- a/Makefile.am Thu Nov 01 11:06:09 2007 +0100 +++ b/Makefile.am Thu Nov 01 11:07:34 2007 +0100 @@ -86,12 +86,12 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk # @CIMSERVER@ is set by the configure script postinstall: sh register_base.sh @CIMSERVER@ $(EXTRA_BASE_MOFS) - sh provider-register.sh -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) - sh provider-register.sh -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) + sh provider-register.sh -v -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) + sh provider-register.sh -v -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) preuninstall: - sh provider-register.sh -d -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) - sh provider-register.sh -d -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) + sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) + sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) rpm: clean @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) diff -r a44ff1bcb394 -r 1d63d3271f90 provider-register.sh --- a/provider-register.sh Thu Nov 01 11:06:09 2007 +0100 +++ b/provider-register.sh Thu Nov 01 11:07:34 2007 +0100 @@ -262,7 +262,7 @@ pegasus_uninstall() echo "Error: wbemexec not found" >&2 return 1 fi - CLASSES=`cat $myregs 2> /dev/null | grep -v '^[[:space:]]*#.*' | cut -d ' ' -f 1 | grep -v '^CIM_'` + CLASSES=`cat $mymofs 2> /dev/null | grep '^class'| cut -d ' ' -f 2 | uniq` for _TEMPDIR in /var/tmp /tmp do From heidieck at linux.vnet.ibm.com Thu Nov 1 10:14:42 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 11:14:42 +0100 Subject: [Libvirt-cim] [PATCH] Make RASD not dependent on ResourceType key In-Reply-To: <87bqafpflv.fsf@theine.beaverton.ibm.com> References: <07b9be7502efdeead8b1.1193673967@localhost.localdomain> <472713B2.3000207@linux.vnet.ibm.com> <878x5ku3sl.fsf@theine.beaverton.ibm.com> <47284863.10703@linux.vnet.ibm.com> <87bqafpflv.fsf@theine.beaverton.ibm.com> Message-ID: <4729A712.2030207@linux.vnet.ibm.com> Dan Smith wrote: > HE> I suggest the following patch: > HE> - removes schema/KVM_ResourceAllocationSettingData.mof, > HE> schema/Xen_ResourceAllocationSettingData.mof and register_base.sh > HE> - adds definition of KVM/Xen_ResourceAllocationSettingData to > HE> schema/ResourceAllocationSettingData.mof > > That's what we originally had[1]! Does this work for you? It works fine > for me with sfcb, but Pegasus refuses to install the RASD MOF because > "One or more classes have children" (or some such similar error). > Thank you for this hint. I've encountered the same problem, which was caused by a bug in provider_register's uninstall process for Pegasus. The fix went out to the mailing list some minutes ago. > [1] http://libvirt.org/hg/libvirt-cim/file/d41b62edd941/schema/ResourceAllocationSettingData.mof > > -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From zli at linux.vnet.ibm.com Thu Nov 1 10:29:03 2007 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Thu, 01 Nov 2007 18:29:03 +0800 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <877il3pfc6.fsf@theine.beaverton.ibm.com> References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <47284C35.2040703@linux.vnet.ibm.com> <877il3pfc6.fsf@theine.beaverton.ibm.com> Message-ID: <4729AA6F.3030405@linux.vnet.ibm.com> Dan Smith wrote: > ZL> Now the method provider (VSMS.DefineSystem) blocks with pegasus on > ZL> the trigger_indication() call. Details here: define_system() --> > ZL> trigger_indication() --> stdi_trigger_indication() > --> CBInvokeMethod() > > Hmm, okay, I'll have to have a look at this. Might be something to do > with our use of the mutex in the indication code. Is your pegasus > using threads or processes? I can see the log spamming "Thread.cpp" and "ThreadPool.cpp". I assume it's using threads. -- - Zhengang From heidieck at linux.vnet.ibm.com Thu Nov 1 11:02:11 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:02:11 +0100 Subject: [Libvirt-cim] [PATCH 1 of 2] Enhance RegisteredProfile to support getInstance and gets static ID In-Reply-To: <47289A97.9090002@linux.vnet.ibm.com> References: <47289A97.9090002@linux.vnet.ibm.com> Message-ID: <4729B233.2090504@linux.vnet.ibm.com> Jay Gagnon wrote: > One thing I forgot to ask about. Many of the profiles we were > advertising have been removed. Is this temporary, or is there a reason > to not advertise those? Its temporary, as at the moment most of the Resource Profiles that have been listed are not available or currently in the process of being defined by the DMTF. But as the Profiles become standard, we will update the provider. As the approach is generic the effort will be only a new struct in profiles.h > Also, I'm not so great at connecting the > non-obvious profiles with their providers, could you explain why the > System Virtualization Profile is now linked to HostSystem and not > VirtualSystemManagementService? > Instances of RegisteredProfile are connected via ECTP to the scoping class instance of the corresponding Profile. This means: the scoping class of the System Virtualization Profile is the CIM_System class, in our case the class KVM/Xen_HostSystem. The class VirtualSystemManagementService is part of the profile, but not the scoping class. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Thu Nov 1 10:17:23 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:17:23 +0200 Subject: [Libvirt-cim] [PATCH 0 of 2] Updates to RegisteredProfile and ElementConformsToProfile Message-ID: From heidieck at linux.vnet.ibm.com Thu Nov 1 10:17:25 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:17:25 +0200 Subject: [Libvirt-cim] [PATCH 2 of 2] Adoption of changes in RegisteredProfile to association ElementConformsToProfile; ECTP uses upcalls to retrieve ManagedElements and minor bug fixes In-Reply-To: Message-ID: <94b0d9a380ab954890de.1193915845@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1193915708 -3600 # Node ID 94b0d9a380ab954890de0b4867057f2db84f17e0 # Parent b14cdc8c5e904694b025850856a238cf7a4f93db Adoption of changes in RegisteredProfile to association ElementConformsToProfile; ECTP uses upcalls to retrieve ManagedElements and minor bug fixes Signed-off-by: Heidi Eckhart diff -r b14cdc8c5e90 -r 94b0d9a380ab src/Makefile.am --- a/src/Makefile.am Thu Nov 01 12:07:44 2007 +0100 +++ b/src/Makefile.am Thu Nov 01 12:15:08 2007 +0100 @@ -7,7 +7,6 @@ noinst_HEADERS = profiles.h svpc_types.h Virt_ComputerSystemIndication.h \ Virt_Device.h \ Virt_DevicePool.h \ - Virt_ElementConformsToProfile.h \ Virt_EnabledLogicalElementCapabilities.h \ Virt_HostSystem.h \ Virt_RASD.h \ diff -r b14cdc8c5e90 -r 94b0d9a380ab src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Thu Nov 01 12:07:44 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Thu Nov 01 12:15:08 2007 +0100 @@ -35,7 +35,6 @@ #include "std_association.h" #include "Virt_RegisteredProfile.h" -#include "Virt_ElementConformsToProfile.h" /* Associate an XXX_RegisteredProfile to the proper XXX_ManagedElement. * @@ -46,75 +45,53 @@ const static CMPIBroker *_BROKER; -static CMPIStatus prof_from_ref(struct reg_prof *prof, - const CMPIObjectPath *ref) -{ - CMPIStatus s = {CMPI_RC_OK, NULL}; - char *tmp_str; - int tmp_int; - - memset(prof, 0, sizeof(*prof)); - - prof->reg_name = cu_get_str_path(ref, "RegisteredName"); - prof->reg_version = cu_get_str_path(ref, "RegisteredVersion"); - prof->other_reg_org = cu_get_str_path(ref, "OtherRegisteredOrganization"); - - tmp_str = cu_get_str_path(ref, "RegisteredOrganization"); - if (tmp_str) { - sscanf(tmp_str, "%d", &tmp_int); - prof->reg_org = (uint16_t)tmp_int; - } - - free(tmp_str); - return s; - -} - -static bool compare_profiles(struct reg_prof *target, - struct reg_prof *candidate) -{ - if (!STREQC(target->reg_name, candidate->reg_name)) - return false; - - COMPARE_OPT_STR(target, candidate, reg_version); - COMPARE_OPT_NUM(target, candidate, reg_org); - //COMPARE_OPT_NUM(target, candidate, ad_types); - COMPARE_OPT_STR(target, candidate, other_reg_org); - //COMPARE_OPT_STR(target, candidate, ad_type_descriptions); - - return true; -} - -static CMPIInstance *elem_instance(const CMPIObjectPath *ref, - char *provider_name) -{ - CMPIStatus s; +static CMPIStatus elem_instances(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list, + struct reg_prof *profile) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; - CMPIInstance *instance = NULL; + CMPIEnumeration *en = NULL; + CMPIData data ; char *classname; - classname = get_typed_class(provider_name); + classname = get_typed_class(profile->provider_name); if (classname == NULL) { - //TRACE("Can't assemble classname."); - printf("Can't assemble classname.\n"); - goto out; - } - - op = CMNewObjectPath(_BROKER, NAMESPACE(ref), classname, &s); + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't assemble classname." ); + goto out; + } + + op = CMNewObjectPath(_BROKER, "/root/ibmsd", classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; - - instance = CMNewInstance(_BROKER, op, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(instance)) - goto out; - - CMSetProperty(instance, "CreationClassName", (CMPIValue *)classname, - CMPI_chars); - - out: + goto error; + + en = CBEnumInstances(_BROKER, info->context , op, NULL, &s); + if (en == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Upcall enumInstances to target class failed."); + goto error; + } + + while (CMHasNext(en, &s)) { + data = CMGetNext(en, &s); + if (CMIsNullObject(data.value.inst)) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to retrieve enumeration entry."); + goto error; + } + + inst_list_add(list, data.value.inst); + } + + error: free(classname); - - return instance; + out: + return s; } static CMPIStatus prof_to_elem(const CMPIObjectPath *ref, @@ -122,25 +99,28 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIInstance *instance; - struct reg_prof target; - struct reg_prof *candidate; + char *id; int i; - - s = prof_from_ref(&target, ref); + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); + goto out; + } for (i = 0; profiles[i] != NULL; i++) { - candidate = profiles[i]; - if (!compare_profiles(&target, candidate)) - continue; - - instance = elem_instance(ref, candidate->provider_name); - if (instance == NULL) - goto out; - - inst_list_add(list, instance); - } - + if (STREQ(id, profiles[i]->reg_id)) { + s = elem_instances(ref, info, list, profiles[i]); + if ((s.rc != CMPI_RC_OK)) + goto error; + break; + } + } + + error: + free(id); out: return s; } @@ -152,74 +132,62 @@ static CMPIStatus elem_to_prof(const CMP CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; char *classname; - char *provider_name; struct reg_prof *candidate; int i; - classname = cu_get_str_path(ref, "CreationClassName"); + classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't get class name from element."); - goto error1; - } - - provider_name = class_base_name(classname); - if (provider_name == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't get provider name."); - goto error2; + "Can't get class name."); + goto out; } for (i = 0; profiles[i] != NULL; i++) { candidate = profiles[i]; - if (!STREQC(candidate->provider_name, provider_name)) + if (!STREQC(candidate->provider_name, classname)) continue; - instance = reg_prof_instance(_BROKER, ref, candidate); + instance = reg_prof_instance(_BROKER, + "/root/interop", + NULL, + candidate); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Can't create profile instance."); - goto error3; + goto error; } inst_list_add(list, instance); } - error3: - free(provider_name); - error2: + error: free(classname); - error1: - return s; -} - -static CMPIInstance *make_ref(const CMPIObjectPath *ref, - const CMPIInstance *inst, + out: + return s; +} + +static CMPIInstance *make_ref(const CMPIObjectPath *source_op, + const CMPIInstance *target_inst, struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->target_class); - - refinst = get_typed_instance(_BROKER, - base, - NAMESPACE(ref)); - if (refinst != NULL) { - CMPIObjectPath *instop; - - instop = CMGetObjectPath(inst, NULL); - - CMSetProperty(refinst, assoc->source_prop, - (CMPIValue *)ref, CMPI_ref); - CMSetProperty(refinst, assoc->target_prop, - (CMPIValue *)instop, CMPI_ref); - } - - free(base); - - return refinst; + CMPIInstance *assoc_inst; + + assoc_inst = get_typed_instance(_BROKER, + "ElementConformsToProfile", + NAMESPACE(source_op)); + + if (!CMIsNullObject(assoc_inst)) { + CMPIObjectPath *target_op; + target_op = CMGetObjectPath(target_inst, NULL); + + CMSetProperty(assoc_inst, assoc->source_prop, + (CMPIValue *)&(source_op), CMPI_ref); + CMSetProperty(assoc_inst, assoc->target_prop, + (CMPIValue *)&(target_op), CMPI_ref); + } + + return assoc_inst; } struct std_assoc forward = { diff -r b14cdc8c5e90 -r 94b0d9a380ab src/Virt_ElementConformsToProfile.h --- a/src/Virt_ElementConformsToProfile.h Thu Nov 01 12:07:44 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright IBM Corp. 2007 - * - * Authors: - * Heidi Eckhart - * Jay Gagnon - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#define COMPARE_OPT_STR(t, c, field) \ - if (t->field && \ - !STREQC(t->field, c->field)) \ - return false; \ - -#define COMPARE_OPT_NUM(t, c, field) \ - if (t->field && \ - t->field != c->field) \ - return false; \ - -/* - * Local Variables: - * mode: C - * c-set-style: "K&R" - * tab-width: 8 - * c-basic-offset: 8 - * indent-tabs-mode: nil - * End: - */ From heidieck at linux.vnet.ibm.com Thu Nov 1 10:17:24 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:17:24 +0200 Subject: [Libvirt-cim] [PATCH 1 of 2] Enhance RegisteredProfile to support getInstance and gets static ID In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1193915264 -3600 # Node ID b14cdc8c5e904694b025850856a238cf7a4f93db # Parent 50cd94057045e93e7978797b0c204731191e6909 Enhance RegisteredProfile to support getInstance and gets static ID Signed-off-by: Heidi Eckhart diff -r 50cd94057045 -r b14cdc8c5e90 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Thu Nov 01 11:07:40 2007 +0100 +++ b/src/Virt_RegisteredProfile.c Thu Nov 01 12:07:44 2007 +0100 @@ -38,39 +38,22 @@ const static CMPIBroker *_BROKER; -static bool reg_prof_set_id(CMPIInstance *instance, - struct reg_prof *profile) -{ - char *id; - - if (asprintf(&id, "%s_%s", profile->reg_name, - profile->reg_version) == -1) - id = NULL; - - if(id) - CMSetProperty(instance, "InstanceID", - (CMPIValue *)id, CMPI_chars); - - return id != NULL; -} - CMPIInstance *reg_prof_instance(const CMPIBroker *broker, - const CMPIObjectPath *ref, + const char *namespace, + const char **properties, struct reg_prof *profile) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; CMPIInstance *instance = NULL; char *classname; classname = get_typed_class("RegisteredProfile"); if (classname == NULL) { - //TRACE(1, "Can't assemble classname."); - printf("Can't assemble classname.\n"); - goto out; - } - - op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s); + goto out; + } + + op = CMNewObjectPath(broker, namespace, classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; @@ -78,10 +61,15 @@ CMPIInstance *reg_prof_instance(const CM if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - reg_prof_set_id(instance, profile); - - CMSetProperty(instance, "CreationClassName", - (CMPIValue *)classname, CMPI_chars); + if (properties) { + s = CMSetPropertyFilter(instance, properties, NULL); + if (s.rc != CMPI_RC_OK) { + goto out; + } + } + + CMSetProperty(instance, "InstanceID", + (CMPIValue *)profile->reg_id, CMPI_chars); CMSetProperty(instance, "RegisteredOrganization", (CMPIValue *)&profile->reg_org, CMPI_uint16); @@ -103,27 +91,20 @@ static CMPIStatus enum_profs(const CMPIO const char **properties, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *instance; int i; - CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIInstance *instance; for (i = 0; profiles[i] != NULL; i++) { - instance = reg_prof_instance(_BROKER, ref, profiles[i]); + instance = reg_prof_instance(_BROKER, + NAMESPACE(ref), + properties, + profiles[i]); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Can't create profile instance."); goto out; } - - if (properties) { - s = CMSetPropertyFilter(instance, properties, NULL); - if (s.rc != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Property filter failed."); - goto out; - } - } if (names_only) cu_return_instance_name(results, instance); @@ -132,6 +113,44 @@ static CMPIStatus enum_profs(const CMPIO } out: + return s; +} + +static CMPIStatus get_prof(const CMPIObjectPath *ref, + const CMPIResult *results, + const char **properties) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *instance = NULL; + char* id; + int i; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); + return s; + } + + for (i = 0; profiles[i] != NULL; i++) { + if(STREQ(id, profiles[i]->reg_id)) { + instance = reg_prof_instance(_BROKER, + NAMESPACE(ref), + properties, + profiles[i]); + break; + } + } + + if(instance) + CMReturnInstance(results, instance); + else + CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); + + + free(id); + return s; } @@ -152,7 +171,15 @@ static CMPIStatus EnumInstances(CMPIInst return enum_profs(reference, results, properties, false); } -DEFAULT_GI(); +static CMPIStatus GetInstance(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const char **properties) +{ + return get_prof(reference, results, properties); +} + DEFAULT_CI(); DEFAULT_MI(); DEFAULT_DI(); diff -r 50cd94057045 -r b14cdc8c5e90 src/Virt_RegisteredProfile.h --- a/src/Virt_RegisteredProfile.h Thu Nov 01 11:07:40 2007 +0100 +++ b/src/Virt_RegisteredProfile.h Thu Nov 01 12:07:44 2007 +0100 @@ -22,8 +22,9 @@ #define __VIRT_REGISTERED_PROFILE_H CMPIInstance *reg_prof_instance(const CMPIBroker *broker, - const CMPIObjectPath *ref, - struct reg_prof *profile); + const char *namespace, + const char **properties, + struct reg_prof *profile); #endif diff -r 50cd94057045 -r b14cdc8c5e90 src/profiles.h --- a/src/profiles.h Thu Nov 01 11:07:40 2007 +0100 +++ b/src/profiles.h Thu Nov 01 12:07:44 2007 +0100 @@ -20,6 +20,7 @@ */ struct reg_prof { uint16_t reg_org; // Valid: 1 = Other, 2 = DMTF + char *reg_id; char *reg_name; char *reg_version; int ad_types; @@ -28,49 +29,27 @@ struct reg_prof { char *provider_name; }; -struct reg_prof Processor = { +struct reg_prof SystemVirtualization = { .reg_org = 2, - .reg_name = "Processor Profile", - .reg_version = "2.15", - .provider_name = "Processor" + .reg_id = "DSP1042-1.0.0a", + .reg_name = "System Virtualization Profile", + .reg_version = "1.0.0a", + .provider_name = "HostSystem" }; -struct reg_prof LogicalDisk = { +struct reg_prof VirtualSystem = { .reg_org = 2, - .reg_name = "Logical Disk Profile", - .reg_version = "2.15", - .provider_name = "LogicalDisk" -}; - -struct reg_prof NetworkPort = { - .reg_org = 2, - .reg_name = "Network Port Profile", - .reg_version = "2.15", - .provider_name = "NetworkPort" -}; - -struct reg_prof ComputerSystem = { - .reg_org = 2, - .reg_name = "Computer System Profile", - .reg_version = "2.15", + .reg_id = "DSP1057-1.0.0a", + .reg_name = "Virtual System Profile", + .reg_version = "1.0.0a", .provider_name = "ComputerSystem" }; -struct reg_prof SVP = { - .reg_org = 2, - .reg_name = "System Virtualization Profile", - .reg_version = "2.15", - .provider_name = "VirtualSystemManagementService" -}; - // Make sure to add pointer to your reg_prof struct here. struct reg_prof *profiles[] = { - &Processor, - &LogicalDisk, - &NetworkPort, - &ComputerSystem, - &SVP, + &SystemVirtualization, + &VirtualSystem, NULL }; From heidieck at linux.vnet.ibm.com Thu Nov 1 11:39:21 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:39:21 +0100 Subject: [Libvirt-cim] [PATCH 2 of 2] Adoption of changes in RegisteredProfile to association ElementConformsToProfile; ECTP uses upcalls to retrieve ManagedElements and minor bug fixes In-Reply-To: <47289C14.1010509@linux.vnet.ibm.com> References: <0ce33a5e92a12929eb73.1193829785@localhost.localdomain> <47289C14.1010509@linux.vnet.ibm.com> Message-ID: <4729BAE9.4050908@linux.vnet.ibm.com> Jay Gagnon wrote: > I'm good with most of this, although a little confused about one thing. > I've had the wrong idea about how ECTP was supposed to work in the past, > so I wouldn't be surprised if I'm just confused again, but I'm afraid I > don't understand why you changed the prof_to_elem behavior. I had it so > that we would return an essentially empty instance of the provider that > matched that profile, as I thought the idea was that the client would > check the CreationClassName and know that this provider implements the > profile they wanted. You appear to be finding the appropriate provider > and invoking its EnumInstances method. I'm not sure why. Also, won't > this present a problem for profiles that don't have EnumInstances? > The DMTF specification defines the following behavior for ECTP, if traversed from an instance of RegisteredProfile to the instance(s) of the profile's scoping class. The result of this request is the list of all instances of the scoping class - which means an EnumInstances on the scoping class. So using an upcall to the EnumInstances function of the scoping class enables a generic implementation of the ECTP provider. What you have been talking about is client logic - but its definitely not the clients responsibility to select the appropriate instances of the profile's scoping class. This knowledge is anchored in the ECTP association. A scoping class always needs to implemented the EnumInstances function. And if there should once be the case that this did not happen then this is either a bug in the specification or in the code ;). -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Thu Nov 1 11:43:11 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:43:11 +0100 Subject: [Libvirt-cim] [PATCH] Fix a crash when std_invokemethod handlers return nonzero In-Reply-To: References: Message-ID: <4729BBCF.9060507@linux.vnet.ibm.com> Kaitlin Rupert wrote: > > >Fix a crash when std_invokemethod handlers return nonzero > > Not much to say. Looks good. +1. > I agree ;). -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From lizg at cn.ibm.com Thu Nov 1 11:45:03 2007 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Thu, 01 Nov 2007 19:45:03 +0800 Subject: [Libvirt-cim] [PATCH] Fix qualifier warning in ComputerSystemIndication Message-ID: <2ccfeb1d4b8636a445ac.1193917503@zeit.cn.ibm.com> # HG changeset patch # User Zhengang Li # Date 1193917483 -28800 # Node ID 2ccfeb1d4b8636a445ac2b834c8be152cb1e20de # Parent d349e62b888f0dda3577ff0e55f4dbe7681a5d57 Fix qualifier warning in ComputerSystemIndication The "char *" cast for "type" param of _lifecycle_indication() is unnecessary, because get_typed_instance()'s 2nd param is also "const char *", and no other reference for "type" in this function. Signed-off-by: Zhengang Li diff -r d349e62b888f -r 2ccfeb1d4b86 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Wed Oct 31 17:04:17 2007 -0700 +++ b/src/Virt_ComputerSystemIndication.c Thu Nov 01 19:44:43 2007 +0800 @@ -65,7 +65,7 @@ static bool _lifecycle_indication(const static bool _lifecycle_indication(const CMPIBroker *broker, const CMPIContext *ctx, const CMPIObjectPath *newsystem, - char *type) + const char *type) { CMPIObjectPath *ind_op; CMPIInstance *ind; @@ -171,7 +171,7 @@ static bool async_ind(CMPIContext *conte free(type_cn); - return _lifecycle_indication(_BROKER, context, op, (char *)type_name); + return _lifecycle_indication(_BROKER, context, op, type_name); } static CMPI_THREAD_RETURN lifecycle_thread(void *params) From heidieck at linux.vnet.ibm.com Thu Nov 1 11:45:57 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:45:57 +0100 Subject: [Libvirt-cim] [PATCH] Fix VSMS instance code to refuse to return an instance if ref is invalid In-Reply-To: References: Message-ID: <4729BC75.8010507@linux.vnet.ibm.com> looks good ... +1 -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Thu Nov 1 11:49:55 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 12:49:55 +0100 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil Message-ID: <4729BD63.8000108@linux.vnet.ibm.com> Is there an automated process that informs the list each time an update was made to the libvirt.org/hg/libvirt-cim and libvirt.org/hg/libcmpiutil repositories. If not already there, this would be great to have. thanks ... Heidi -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From veillard at redhat.com Thu Nov 1 12:23:26 2007 From: veillard at redhat.com (Daniel Veillard) Date: Thu, 1 Nov 2007 08:23:26 -0400 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil In-Reply-To: <4729BD63.8000108@linux.vnet.ibm.com> References: <4729BD63.8000108@linux.vnet.ibm.com> Message-ID: <20071101122325.GB25921@redhat.com> On Thu, Nov 01, 2007 at 12:49:55PM +0100, Heidi Eckhart wrote: > Is there an automated process that informs the list each time an update > was made to the libvirt.org/hg/libvirt-cim and > libvirt.org/hg/libcmpiutil repositories. If not already there, this > would be great to have. hum, I don't know how to do this with mercurial. I assume it's possible though maybe checking the changelog http://libvirt.org/hg/libvirt-cim/log is sufficient and would reduce automated traffic. Also there is an RSS feed for those who use this kind of sources, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Thu Nov 1 13:34:45 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 06:34:45 -0700 Subject: [Libvirt-cim] [PATCH] Add some starter web content In-Reply-To: <4729951C.3080801@redhat.com> (Daniel Veillard's message of "Thu, 01 Nov 2007 09:58:04 +0100") References: <4729951C.3080801@redhat.com> Message-ID: <87r6jam6mi.fsf@theine.beaverton.ibm.com> DV> It will be easier to review and update once it's online, so let's DV> commit it, thanks :-) Done :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 14:11:43 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:11:43 -0700 Subject: [Libvirt-cim] [PATCH] fix trivial libcmpiutil compilation issue In-Reply-To: <20071101100702.GA25921@redhat.com> (Daniel Veillard's message of "Thu, 1 Nov 2007 06:07:02 -0400") References: <20071101100702.GA25921@redhat.com> Message-ID: <87ve8mys0w.fsf@theine.beaverton.ibm.com> DV> # HG changeset patch DV> # User Daniel Veillard DV> # Date 1193910954 -3600 DV> # Node ID 5e54246e74833caed8f5176f8bd5bb9e28b60299 DV> # Parent 05b01d03f0b801afe266d8d012bc464be6a2d165 DV> Fix a trivial compilation problem, DV> the variable declaration is at the wrong place. Applied, thanks! You might be the first person to try building without HAVE_EOPARSER defined :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 14:23:10 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:23:10 -0700 Subject: [Libvirt-cim] [PATCH] Provider registration script does not uninstall classes correctly for Pegasus In-Reply-To: <1d63d3271f9037ec0699.1193911914@localhost.localdomain> (Heidi Eckhart's message of "Thu, 01 Nov 2007 11:11:54 +0200") References: <1d63d3271f9037ec0699.1193911914@localhost.localdomain> Message-ID: <87mytyyrht.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1193911654 -3600 HE> # Node ID 1d63d3271f9037ec0699808fec54bd5083aea849 HE> # Parent a44ff1bcb3942783ac939d843dfbe04efe677166 HE> Provider registration script does not uninstall classes correctly HE> for Pegasus I'll assume you know what you're doing here and just apply this :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 14:24:16 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:24:16 -0700 Subject: [Libvirt-cim] [PATCH] Make RASD not dependent on ResourceType key In-Reply-To: <4729A712.2030207@linux.vnet.ibm.com> (Heidi Eckhart's message of "Thu, 01 Nov 2007 11:14:42 +0100") References: <07b9be7502efdeead8b1.1193673967@localhost.localdomain> <472713B2.3000207@linux.vnet.ibm.com> <878x5ku3sl.fsf@theine.beaverton.ibm.com> <47284863.10703@linux.vnet.ibm.com> <87bqafpflv.fsf@theine.beaverton.ibm.com> <4729A712.2030207@linux.vnet.ibm.com> Message-ID: <87ir4myrfz.fsf@theine.beaverton.ibm.com> HE> Thank you for this hint. I've encountered the same problem, which HE> was caused by a bug in provider_register's uninstall process for HE> Pegasus. The fix went out to the mailing list some minutes ago. Okay, I haven't tried it yet, but if it solves my pegasus problem, we can remove register_base.sh from the tree. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 14:27:33 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:27:33 -0700 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <4729AA6F.3030405@linux.vnet.ibm.com> (Zhengang Li's message of "Thu, 01 Nov 2007 18:29:03 +0800") References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <47284C35.2040703@linux.vnet.ibm.com> <877il3pfc6.fsf@theine.beaverton.ibm.com> <4729AA6F.3030405@linux.vnet.ibm.com> Message-ID: <87ejfayrai.fsf@theine.beaverton.ibm.com> ZL> I can see the log spamming "Thread.cpp" and "ThreadPool.cpp". I assume ZL> it's using threads. A threads machine should look like this: % cimconfig -cl | grep -i force forceProviderProcesses=false If you don't have a value, set it to true: % cimconfig -p -s forceProviderProcesses=true and see if you still get the deadlock. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 14:31:11 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:31:11 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Enhance RegisteredProfile to support getInstance and gets static ID In-Reply-To: <4729B233.2090504@linux.vnet.ibm.com> (Heidi Eckhart's message of "Thu, 01 Nov 2007 12:02:11 +0100") References: <47289A97.9090002@linux.vnet.ibm.com> <4729B233.2090504@linux.vnet.ibm.com> Message-ID: <87abpyyr4g.fsf@theine.beaverton.ibm.com> HE> Instances of RegisteredProfile are connected via ECTP to the HE> scoping class instance of the corresponding Profile. This means: HE> the scoping class of the System Virtualization Profile is the HE> CIM_System class, in our case the class KVM/Xen_HostSystem. The HE> class VirtualSystemManagementService is part of the profile, but HE> not the scoping class. This means we need a HostedService class before the SVP profile will be useful, right? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Thu Nov 1 14:38:01 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 01 Nov 2007 10:38:01 -0400 Subject: [Libvirt-cim] [PATCH 2 of 2] Adoption of changes in RegisteredProfile to association ElementConformsToProfile; ECTP uses upcalls to retrieve ManagedElements and minor bug fixes In-Reply-To: <4729BAE9.4050908@linux.vnet.ibm.com> References: <0ce33a5e92a12929eb73.1193829785@localhost.localdomain> <47289C14.1010509@linux.vnet.ibm.com> <4729BAE9.4050908@linux.vnet.ibm.com> Message-ID: <4729E4C9.6020709@linux.vnet.ibm.com> Heidi Eckhart wrote: > Jay Gagnon wrote: >> I'm good with most of this, although a little confused about one >> thing. I've had the wrong idea about how ECTP was supposed to work in >> the past, >> so I wouldn't be surprised if I'm just confused again, but I'm afraid I >> don't understand why you changed the prof_to_elem behavior. I had it so >> that we would return an essentially empty instance of the provider that >> matched that profile, as I thought the idea was that the client would >> check the CreationClassName and know that this provider implements the >> profile they wanted. You appear to be finding the appropriate provider >> and invoking its EnumInstances method. I'm not sure why. Also, won't >> this present a problem for profiles that don't have EnumInstances? >> > The DMTF specification defines the following behavior for ECTP, if > traversed from an instance of RegisteredProfile to the instance(s) of > the profile's scoping class. The result of this request is the list of > all instances of the scoping class - which means an EnumInstances on > the scoping class. So using an upcall to the EnumInstances function of > the scoping class enables a generic implementation of the ECTP > provider. What you have been talking about is client logic - but its > definitely not the clients responsibility to select the appropriate > instances of the profile's scoping class. This knowledge is anchored > in the ECTP association. > A scoping class always needs to implemented the EnumInstances > function. And if there should once be the case that this did not > happen then this is either a bug in the specification or in the code ;). > Understood. That's fine. My tendency to think like a client seems to have bitten me again. :) -- -Jay From danms at us.ibm.com Thu Nov 1 14:42:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:42:09 -0700 Subject: [Libvirt-cim] [PATCH] Fix qualifier warning in ComputerSystemIndication In-Reply-To: <2ccfeb1d4b8636a445ac.1193917503@zeit.cn.ibm.com> (lizg@cn.ibm.com's message of "Thu, 01 Nov 2007 19:45:03 +0800") References: <2ccfeb1d4b8636a445ac.1193917503@zeit.cn.ibm.com> Message-ID: <87640myqm6.fsf@theine.beaverton.ibm.com> ZL> # HG changeset patch ZL> # User Zhengang Li ZL> # Date 1193917483 -28800 ZL> # Node ID 2ccfeb1d4b8636a445ac2b834c8be152cb1e20de ZL> # Parent d349e62b888f0dda3577ff0e55f4dbe7681a5d57 ZL> Fix qualifier warning in ComputerSystemIndication ZL> The "char *" cast for "type" param of _lifecycle_indication() is ZL> unnecessary, because get_typed_instance()'s 2nd param is also ZL> "const char *", and no other reference for "type" in this ZL> function. I'm not sure why that was there in the first place :) Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 14:55:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 07:55:12 -0700 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil In-Reply-To: <20071101122325.GB25921@redhat.com> (Daniel Veillard's message of "Thu, 1 Nov 2007 08:23:26 -0400") References: <4729BD63.8000108@linux.vnet.ibm.com> <20071101122325.GB25921@redhat.com> Message-ID: <87y7dixbfz.fsf@theine.beaverton.ibm.com> DV> hum, I don't know how to do this with mercurial. I assume it's DV> possible though maybe checking the changelog It's relatively easy... I can set it up if you're okay with it. DV> reduce automated traffic. Do others want this as well? It can generate a lot of traffic on the list. I use the RSS feeds myself, which I find to be sufficient. Heidi, would the RSS feeds work for you? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Thu Nov 1 15:10:49 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 01 Nov 2007 11:10:49 -0400 Subject: [Libvirt-cim] [PATCH] Registration of ElementConformsToProfile for two namespaces causes errors with Pegasus In-Reply-To: References: Message-ID: <4729EC79.3040105@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1193911569 -3600 > # Node ID a44ff1bcb3942783ac939d843dfbe04efe677166 > # Parent bf5ad6924b99903d68d019a7c5faaa2f5a5d1ef9 > Registration of ElementConformsToProfile for two namespaces causes errors with Pegasus > Signed-off-by: Heidi Eckhart > > > Cool, thanks. Sorry we have to be such sticklers on the DCO thing. :) -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 1 15:51:59 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 01 Nov 2007 11:51:59 -0400 Subject: [Libvirt-cim] [PATCH 0 of 2] Updates to RegisteredProfile and ElementConformsToProfile In-Reply-To: References: Message-ID: <4729F61F.8090707@linux.vnet.ibm.com> Alright I think this set is ready for inclusion. +1 Thanks for the work and all that explanation, Heidi. :) -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 1 16:03:43 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 01 Nov 2007 12:03:43 -0400 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil In-Reply-To: <87y7dixbfz.fsf@theine.beaverton.ibm.com> References: <4729BD63.8000108@linux.vnet.ibm.com> <20071101122325.GB25921@redhat.com> <87y7dixbfz.fsf@theine.beaverton.ibm.com> Message-ID: <4729F8DF.6030507@linux.vnet.ibm.com> Dan Smith wrote: > DV> hum, I don't know how to do this with mercurial. I assume it's > DV> possible though maybe checking the changelog > > It's relatively easy... I can set it up if you're okay with it. > > DV> reduce automated traffic. > > Do others want this as well? It can generate a lot of traffic on the > list. I use the RSS feeds myself, which I find to be sufficient. > > Heidi, would the RSS feeds work for you? > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim I'm fine with the feeds, but other lists that do this don't seem to get out of hand traffic-wise, so I will not complain about either. -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 1 17:55:47 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 01 Nov 2007 13:55:47 -0400 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output Message-ID: <66e4bd0fd892e9771976.1193939747@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1193939694 14400 # Node ID 66e4bd0fd892e97719769b5ad3128ed2ccbfc514 # Parent 308064b52d99dcfff6315a309cc8aa66cb55f556 Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. Signed-off-by: Jay Gagnon diff -r 308064b52d99 -r 66e4bd0fd892 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 01 13:48:50 2007 -0400 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 01 13:54:54 2007 -0400 @@ -51,12 +51,10 @@ static bool rasd_prop_copy_value(struct { bool rc = true; - CU_DEBUG("Copying '%s'.\n", src.field); + CU_DEBUG("Copying '%s'.", src.field); if (src.type & CMPI_string) { - CU_DEBUG("String type.\n"); dest->value = (CMPIValue *)strdup((char *)src.value); } else if (src.type & CMPI_INTEGER) { - CU_DEBUG("Integer type.\n"); dest->value = malloc(sizeof(CMPIValue)); memcpy(dest->value, src.value, sizeof(CMPIValue)); } else { @@ -74,7 +72,6 @@ static bool dup_rasd_prop_list(struct sd *dest = NULL; for (i = 0, count = 1; src[i].field != NULL; i++, count++) { - CU_DEBUG("count: %d, i: %d. reallocing.\n", count, i); *dest = realloc(*dest, count * sizeof(struct sdc_rasd_prop)); (*dest)[i].field = strdup(src[i].field); ret = rasd_prop_copy_value(src[i], &(*dest)[i]); @@ -82,7 +79,6 @@ static bool dup_rasd_prop_list(struct sd } /* Make sure to terminate the list. */ - CU_DEBUG("Terminating list. count: %d, i: %d\n", count, i); *dest = realloc(*dest, count * sizeof(struct sdc_rasd_prop)); (*dest)[i] = (struct sdc_rasd_prop)PROP_END; @@ -386,16 +382,16 @@ static CMPIInstance *sdc_rasd_inst(const CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16); for (i = 0; prop_list[i].field != NULL; i++) { - CU_DEBUG("Setting property '%s'.\n", prop_list[i].field); + CU_DEBUG("Setting property '%s'.", prop_list[i].field); CMSetProperty(inst, prop_list[i].field, prop_list[i].value, prop_list[i].type); - CU_DEBUG("Set.\n"); - } - - CU_DEBUG("freeing prop_list.\n"); + CU_DEBUG("Set."); + } + + CU_DEBUG("freeing prop_list."); free_rasd_prop_list(prop_list); out: - CU_DEBUG("Returning inst.\n"); + CU_DEBUG("Returning inst."); return inst; } @@ -422,17 +418,17 @@ static CMPIStatus sdc_rasds_for_type(con CU_DEBUG("Problem getting inst."); goto out; } - CU_DEBUG("Got inst.\n"); + CU_DEBUG("Got inst."); if (inst != NULL) { inst_list_add(list, inst); - CU_DEBUG("Added inst.\n"); + CU_DEBUG("Added inst."); } else { - CU_DEBUG("Inst is null, not added.\n"); + CU_DEBUG("Inst is null, not added."); } } } else { - CU_DEBUG("Unsupported type.\n"); + CU_DEBUG("Unsupported type."); CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unsupported device type."); } @@ -449,7 +445,7 @@ static CMPIStatus alloc_cap_to_rasd(cons int ret; uint16_t type; - CU_DEBUG("Getting ResourceType.\n"); + CU_DEBUG("Getting ResourceType."); ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != 1) { @@ -458,7 +454,7 @@ static CMPIStatus alloc_cap_to_rasd(cons goto out; } - CU_DEBUG("ResourceType: %hi.\n", type); + CU_DEBUG("ResourceType: %hi.", type); s = sdc_rasds_for_type(ref, list, type); From heidieck at linux.vnet.ibm.com Thu Nov 1 19:05:11 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 01 Nov 2007 20:05:11 +0100 Subject: [Libvirt-cim] [PATCH] Provider registration script does not uninstall classes correctly for Pegasus In-Reply-To: <87mytyyrht.fsf@theine.beaverton.ibm.com> References: <1d63d3271f9037ec0699.1193911914@localhost.localdomain> <87mytyyrht.fsf@theine.beaverton.ibm.com> Message-ID: <472A2367.6040105@linux.vnet.ibm.com> Dan Smith wrote: > HE> # HG changeset patch > HE> # User Heidi Eckhart > HE> # Date 1193911654 -3600 > HE> # Node ID 1d63d3271f9037ec0699808fec54bd5083aea849 > HE> # Parent a44ff1bcb3942783ac939d843dfbe04efe677166 > HE> Provider registration script does not uninstall classes correctly > HE> for Pegasus > > I'll assume you know what you're doing here and just apply this :) > hope so ;) -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Thu Nov 1 23:27:16 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 16:27:16 -0700 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <66e4bd0fd892e9771976.1193939747@wulfgar> (Jay Gagnon's message of "Thu, 01 Nov 2007 13:55:47 -0400") References: <66e4bd0fd892e9771976.1193939747@wulfgar> Message-ID: <87d4uty2az.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1193939694 14400 JG> # Node ID 66e4bd0fd892e97719769b5ad3128ed2ccbfc514 JG> # Parent 308064b52d99dcfff6315a309cc8aa66cb55f556 JG> Remove newline characters from CU_DEBUG calls now that the newline JG> is automatic. Also remove a few debug messages that are no longer JG> necessary and clutter output. Looks fine to me. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 1 23:31:31 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 16:31:31 -0700 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output References: <66e4bd0fd892e9771976.1193939747@wulfgar> Message-ID: <871wb9y23w.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1193939694 14400 JG> # Node ID 66e4bd0fd892e97719769b5ad3128ed2ccbfc514 JG> # Parent 308064b52d99dcfff6315a309cc8aa66cb55f556 JG> Remove newline characters from CU_DEBUG calls now that the newline JG> is automatic. Also remove a few debug messages that are no longer JG> necessary and clutter output. Er, actually, this doesn't apply on top of the current tip. Here is the reject: *************** static CMPIStatus sdc_rasds_for_type(con *** 296,312 **** CU_DEBUG("Problem getting inst."); goto out; } - CU_DEBUG("Got inst.\n"); if (inst != NULL) { inst_list_add(list, inst); - CU_DEBUG("Added inst.\n"); } else { - CU_DEBUG("Inst is null, not added.\n"); } } } else { - CU_DEBUG("Unsupported type.\n"); CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unsupported device type."); } --- 292,308 ---- CU_DEBUG("Problem getting inst."); goto out; } + CU_DEBUG("Got inst."); if (inst != NULL) { inst_list_add(list, inst); + CU_DEBUG("Added inst."); } else { + CU_DEBUG("Inst is null, not added."); } } } else { + CU_DEBUG("Unsupported type."); CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unsupported device type."); } -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 2 00:19:33 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 00:19:33 -0000 Subject: [Libvirt-cim] [PATCH] Fix externally-visible name of type_from_classname() Message-ID: # HG changeset patch # User Dan Smith # Date 1424173382 28800 # Node ID f922cb6a051d0d4bf0186bb755627e5df981997f # Parent e385d591fa6f8bbe135434117a16039d5693f5b4 Fix externally-visible name of type_from_classname() Signed-off-by: Dan Smith diff -r e385d591fa6f -r f922cb6a051d src/Virt_Device.c --- a/src/Virt_Device.c Tue Oct 30 09:39:29 2007 -0700 +++ b/src/Virt_Device.c Tue Feb 17 03:43:02 2015 -0800 @@ -247,7 +247,7 @@ static CMPIInstance *device_instance(con return instance; } -int type_from_classname(const char *classname) +int device_type_from_classname(const char *classname) { if (strstr(classname, "NetworkPort")) return VIRT_DEV_NET; @@ -321,7 +321,7 @@ static int dom_list_devices(virConnectPt int i; int type; - type = type_from_classname(CLASSNAME(ref)); + type = device_type_from_classname(CLASSNAME(ref)); ndom = get_domain_list(conn, &doms); if (ndom == 0) @@ -458,8 +458,11 @@ static CMPIStatus get_device(const CMPIO CMPIStatus s; virConnectPtr conn; CMPIInstance *inst; + const char *cn; - conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); + cn = CLASSNAME(reference); + + conn = connect_by_classname(_BROKER, cn, &s); if (!conn) return s; @@ -467,7 +470,7 @@ static CMPIStatus get_device(const CMPIO conn, devid, NAMESPACE(reference), - type_from_classname(CLASSNAME(reference))); + device_type_from_classname(cn)); if (inst) { CMReturnInstance(results, inst); CMSetStatus(&s, CMPI_RC_OK); diff -r e385d591fa6f -r f922cb6a051d src/Virt_Device.h --- a/src/Virt_Device.h Tue Oct 30 09:39:29 2007 -0700 +++ b/src/Virt_Device.h Tue Feb 17 03:43:02 2015 -0800 @@ -56,7 +56,7 @@ CMPIInstance *instance_from_devid(const const char *ns, int type); -int type_from_classname(const char *classname); +int device_type_from_classname(const char *classname); #endif diff -r e385d591fa6f -r f922cb6a051d src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Tue Oct 30 09:39:29 2007 -0700 +++ b/src/Virt_SettingsDefineState.c Tue Feb 17 03:43:02 2015 -0800 @@ -148,7 +148,7 @@ static CMPIInstance *_get_typed_device(c conn, id, ns, - type_from_classname(typestr)); + device_type_from_classname(typestr)); out: virConnectClose(conn); diff -r e385d591fa6f -r f922cb6a051d src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Tue Oct 30 09:39:29 2007 -0700 +++ b/src/Virt_SystemDevice.c Tue Feb 17 03:43:02 2015 -0800 @@ -171,7 +171,7 @@ static CMPIStatus sys_to_dev(const CMPIO if (info->result_class) { int type; - type = type_from_classname(info->result_class); + type = device_type_from_classname(info->result_class); ret = get_dom_devices(host, list, type, NAMESPACE(ref)); } else { From danms at us.ibm.com Fri Nov 2 00:19:46 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 00:19:46 -0000 Subject: [Libvirt-cim] [PATCH] Update SettingsDefineState for disks Message-ID: # HG changeset patch # User Dan Smith # Date 1424173483 28800 # Node ID a292dd2d0e1fc7e0e5d7d85afe67aae5fa7fa6ed # Parent f922cb6a051d0d4bf0186bb755627e5df981997f Update SettingsDefineState for disks Signed-off-by: Dan Smith diff -r f922cb6a051d -r a292dd2d0e1f src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Tue Feb 17 03:43:02 2015 -0800 +++ b/src/Virt_SettingsDefineState.c Tue Feb 17 03:44:43 2015 -0800 @@ -98,7 +98,7 @@ static CMPIStatus dev_to_rasd(const CMPI ret = rasds_for_domain(_BROKER, name, - CIM_RASD_TYPE_DISK, + device_type_from_classname(CLASSNAME(ref)), NAMESPACE(ref), &rasds); From danms at us.ibm.com Fri Nov 2 00:19:47 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 00:19:47 -0000 Subject: [Libvirt-cim] [PATCH] Fix incorrect use of InstanceID instead of DeviceID in SDS Message-ID: # HG changeset patch # User Dan Smith # Date 1424173566 28800 # Node ID e1cc2a3bbeffbb0b6ec390c68a0b0cb3d39a6f22 # Parent a292dd2d0e1fc7e0e5d7d85afe67aae5fa7fa6ed Fix incorrect use of InstanceID instead of DeviceID in SDS Signed-off-by: Dan Smith diff -r a292dd2d0e1f -r e1cc2a3bbeff src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Tue Feb 17 03:44:43 2015 -0800 +++ b/src/Virt_SettingsDefineState.c Tue Feb 17 03:46:06 2015 -0800 @@ -80,11 +80,11 @@ static CMPIStatus dev_to_rasd(const CMPI inst_list_init(&rasds); - id = cu_get_str_path(ref, "InstanceID"); + id = cu_get_str_path(ref, "DeviceID"); if (id == NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Missing InstanceID"); + "Missing DeviceID"); goto out; } @@ -92,7 +92,7 @@ static CMPIStatus dev_to_rasd(const CMPI if (!ret) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Invalid InstanceID"); + "Invalid DeviceID"); goto out; } From berrange at redhat.com Fri Nov 2 00:46:35 2007 From: berrange at redhat.com (Daniel P. Berrange) Date: Fri, 2 Nov 2007 00:46:35 +0000 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> Message-ID: <20071102004635.GC12051@redhat.com> On Sat, Feb 14, 2015 at 12:10:01PM -0800, Dan Smith wrote: Please fix the clock on your computer, or tell me how your time machine works ;-P Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=| From danms at us.ibm.com Fri Nov 2 01:21:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 01 Nov 2007 18:21:15 -0700 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <20071102004635.GC12051@redhat.com> (Daniel P. Berrange's message of "Fri, 2 Nov 2007 00:46:35 +0000") References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <20071102004635.GC12051@redhat.com> Message-ID: <873avpwigk.fsf@theine.beaverton.ibm.com> DB> Please fix the clock on your computer, or tell me how your time DB> machine works ;-P I know, I sent that from patchbomb inside a VM, which I normally don't do. Needless to say, the clock had drifted just a bit. Sorry about that :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From heidieck at linux.vnet.ibm.com Fri Nov 2 08:31:34 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 02 Nov 2007 09:31:34 +0100 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil In-Reply-To: <87y7dixbfz.fsf@theine.beaverton.ibm.com> References: <4729BD63.8000108@linux.vnet.ibm.com> <20071101122325.GB25921@redhat.com> <87y7dixbfz.fsf@theine.beaverton.ibm.com> Message-ID: <472AE066.5030404@linux.vnet.ibm.com> Dan Smith wrote: > Heidi, would the RSS feeds work for you? > What are the RSS feeds and how can I use them ? -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 2 08:03:41 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 02 Nov 2007 10:03:41 +0200 Subject: [Libvirt-cim] [PATCH] Consolidation of ResourceAllocationSettingData Message-ID: <233f09c15c1194a9814c.1193994221@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1193994073 -3600 # Node ID 233f09c15c1194a9814cb339f5cd70b5b1e27932 # Parent d0a5fd9a1b73ed456ee179ce54b51d57fad1adeb Consolidation of ResourceAllocationSettingData Signed-off-by: Heidi Eckhart diff -r d0a5fd9a1b73 -r 233f09c15c11 Makefile.am --- a/Makefile.am Thu Nov 01 12:15:08 2007 +0100 +++ b/Makefile.am Fri Nov 02 10:01:13 2007 +0100 @@ -71,12 +71,8 @@ INTEROP_REGS = \ schema/RegisteredProfile.registration \ schema/ElementConformsToProfile.registration -EXTRA_BASE_MOFS = \ - schema/Xen_ResourceAllocationSettingData.mof \ - schema/KVM_ResourceAllocationSettingData.mof - pkgdata_DATA = $(MOFS) $(REGS) -pkgdata_SCRIPTS = provider-register.sh register_base.sh +pkgdata_SCRIPTS = provider-register.sh EXTRA_DIST = schema $(pkgdata_DATA) $(pkgdata_SCRIPTS) \ libvirt-cim.spec.in libvirt-cim.spec \ @@ -85,7 +81,6 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk # Un/Register the providers and class definitions from/to the current CIMOM. # @CIMSERVER@ is set by the configure script postinstall: - sh register_base.sh @CIMSERVER@ $(EXTRA_BASE_MOFS) sh provider-register.sh -v -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) sh provider-register.sh -v -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) diff -r d0a5fd9a1b73 -r 233f09c15c11 register_base.sh --- a/register_base.sh Thu Nov 01 12:15:08 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -#!/bin/bash -# -# A script to register base classes with the CIMOM -# -# Copyright IBM Corp. 2007 -# Author: Dan Smith -# -# Usage: -# -# $ register_base.sh (sfcb|pegasus) [MOF...] -# -# FIXME: Need to make pegasus location and namespace variable - -CIMOM=$1 - -if [ -z "$CIMOM" ]; then - echo "Usage: $0 (pegasus|sfcb)" - exit 1 -fi - -shift - -if [ "$CIMOM" = "pegasus" ]; then - for i in $*; do - cimmofl -W -uc -aEV -R/var/lib/Pegasus -n /root/ibmsd $i - done -elif [ "$CIMOM" = "sfcb" ]; then - for i in $*; do - sfcbstage -n /root/ibmsd $i - done -else - echo "Unknown CIMOM type: $CIMOM" -fi diff -r d0a5fd9a1b73 -r 233f09c15c11 schema/KVM_ResourceAllocationSettingData.mof --- a/schema/KVM_ResourceAllocationSettingData.mof Thu Nov 01 12:15:08 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -// Copyright IBM Corp. 2007 -class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - -}; diff -r d0a5fd9a1b73 -r 233f09c15c11 schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Thu Nov 01 12:15:08 2007 +0100 +++ b/schema/ResourceAllocationSettingData.mof Fri Nov 02 10:01:13 2007 +0100 @@ -1,4 +1,12 @@ // Copyright IBM Corp. 2007 +class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { + +}; + +class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { + +}; + [Description ("Xen virtual disk configuration")] class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData{ diff -r d0a5fd9a1b73 -r 233f09c15c11 schema/Xen_ResourceAllocationSettingData.mof --- a/schema/Xen_ResourceAllocationSettingData.mof Thu Nov 01 12:15:08 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -// Copyright IBM Corp. 2007 -class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - -}; From zli at linux.vnet.ibm.com Fri Nov 2 09:15:35 2007 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Fri, 02 Nov 2007 17:15:35 +0800 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <87ejfayrai.fsf@theine.beaverton.ibm.com> References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <47284C35.2040703@linux.vnet.ibm.com> <877il3pfc6.fsf@theine.beaverton.ibm.com> <4729AA6F.3030405@linux.vnet.ibm.com> <87ejfayrai.fsf@theine.beaverton.ibm.com> Message-ID: <472AEAB7.8020301@linux.vnet.ibm.com> Dan Smith wrote: > ZL> I can see the log spamming "Thread.cpp" and "ThreadPool.cpp". I assume > ZL> it's using threads. > > A threads machine should look like this: > > % cimconfig -cl | grep -i force > forceProviderProcesses=false > > If you don't have a value, set it to true: > > % cimconfig -p -s forceProviderProcesses=true > > and see if you still get the deadlock. cimconfig -c -l | grep -i force forceProviderProcesses=true Shall I try the threads machine? -- - Zhengang From heidieck at linux.vnet.ibm.com Fri Nov 2 09:32:10 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 02 Nov 2007 10:32:10 +0100 Subject: [Libvirt-cim] [PATCH] Consolidation of ResourceAllocationSettingData In-Reply-To: <233f09c15c1194a9814c.1193994221@localhost.localdomain> References: <233f09c15c1194a9814c.1193994221@localhost.localdomain> Message-ID: <472AEE9A.3050002@linux.vnet.ibm.com> Dan, please can you apply this patch ? Its the second part of the fix for the postinstall/preuninstall process with Pegasus. Thanks. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 2 09:52:48 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 02 Nov 2007 10:52:48 +0100 Subject: [Libvirt-cim] [PATCH] Fix externally-visible name of type_from_classname() In-Reply-To: References: Message-ID: <472AF370.6050500@linux.vnet.ibm.com> Dan Smith wrote: > @@ -458,8 +458,11 @@ static CMPIStatus get_device(const CMPIO > CMPIStatus s; > virConnectPtr conn; > CMPIInstance *inst; > + const char *cn; > > - conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); > + cn = CLASSNAME(reference); > + > + conn = connect_by_classname(_BROKER, cn, &s); > What is your intention by breaking this one-liner into three lines ? > if (!conn) > return s; > I had problems to apply this patch to the latest version from the external libvirt-cim repository. But I checked it and all changes have been applied. Works for me ... +1 (tested on KVM) -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 2 09:53:06 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 02 Nov 2007 10:53:06 +0100 Subject: [Libvirt-cim] [PATCH] Update SettingsDefineState for disks In-Reply-To: References: Message-ID: <472AF382.1010504@linux.vnet.ibm.com> works for me ... +1 -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 2 09:53:45 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 02 Nov 2007 10:53:45 +0100 Subject: [Libvirt-cim] [PATCH] Fix incorrect use of InstanceID instead of DeviceID in SDS In-Reply-To: References: Message-ID: <472AF3A9.2020704@linux.vnet.ibm.com> works for me ... +1 :) good catch :) -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Fri Nov 2 13:39:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 06:39:00 -0700 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil References: <4729BD63.8000108@linux.vnet.ibm.com> <20071101122325.GB25921@redhat.com> <87y7dixbfz.fsf@theine.beaverton.ibm.com> <472AE066.5030404@linux.vnet.ibm.com> Message-ID: <87mytwvkaz.fsf@theine.beaverton.ibm.com> HE> What are the RSS feeds and how can I use them ? RSS feeds are sort of like newsgroups, but much smaller, and contained to a single XML file. I think you're using thunderbird, which can consume RSS feeds as if it were a mail box. All you need to do is add the following URL as an RSS feed: http://libvirt.org/hg/libvirt-cim/rss-log -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 2 13:58:42 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 06:58:42 -0700 Subject: [Libvirt-cim] [PATCH] Consolidation of ResourceAllocationSettingData In-Reply-To: <233f09c15c1194a9814c.1193994221@localhost.localdomain> (Heidi Eckhart's message of "Fri, 02 Nov 2007 10:03:41 +0200") References: <233f09c15c1194a9814c.1193994221@localhost.localdomain> Message-ID: <87ejf8vje5.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1193994073 -3600 HE> # Node ID 233f09c15c1194a9814cb339f5cd70b5b1e27932 HE> # Parent d0a5fd9a1b73ed456ee179ce54b51d57fad1adeb HE> Consolidation of ResourceAllocationSettingData Okay, this looks to have solved my problem, so I'll apply. Thanks a lot Heidi! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 2 14:02:40 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 07:02:40 -0700 Subject: [Libvirt-cim] [PATCH] Fix externally-visible name of type_from_classname() In-Reply-To: <472AF370.6050500@linux.vnet.ibm.com> (Heidi Eckhart's message of "Fri, 02 Nov 2007 10:52:48 +0100") References: <472AF370.6050500@linux.vnet.ibm.com> Message-ID: <87abpwvj7j.fsf@theine.beaverton.ibm.com> HE> What is your intention by breaking this one-liner into three lines ? Because when I went to make this change: @@ -467,7 +470,7 @@ static CMPIStatus get_device(const CMPIO conn, devid, NAMESPACE(reference), - type_from_classname(CLASSNAME(reference))); + device_type_from_classname(cn)); the line would wrap. By consolidating all the CLASSNAME() calls into a const char * (which is what I should have done in the first place) I avoided wrapping that line :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 2 14:18:11 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 07:18:11 -0700 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <472AEAB7.8020301@linux.vnet.ibm.com> (Zhengang Li's message of "Fri, 02 Nov 2007 17:15:35 +0800") References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <47284C35.2040703@linux.vnet.ibm.com> <877il3pfc6.fsf@theine.beaverton.ibm.com> <4729AA6F.3030405@linux.vnet.ibm.com> <87ejfayrai.fsf@theine.beaverton.ibm.com> <472AEAB7.8020301@linux.vnet.ibm.com> Message-ID: <87640kviho.fsf@theine.beaverton.ibm.com> ZL> cimconfig -c -l | grep -i force ZL> forceProviderProcesses=true Hmm, interesting, that's how mine is configured. ZL> Shall I try the threads machine? Sure, it might be interesting for a data point. I'll have to dig into the indication signaling and see if I can reproduce and figure out why it's doing that. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 2 17:28:37 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 10:28:37 -0700 Subject: [Libvirt-cim] [PATCH] Fix enum_domains() to generate a correct ObjectPath for returned Instances Message-ID: # HG changeset patch # User Dan Smith # Date 1194024510 25200 # Node ID d48584b1c90c499dea3940c1718ef0e97ae5ef9e # Parent 854d848bae0b56420e483ac7522775b6b3080aaa Fix enum_domains() to generate a correct ObjectPath for returned Instances This fixes the fact that HostedDependency is returning ComputerSystem instances with the wrong class name. - Modified enum_domains() to take a namespace instead of an object path and actually create the correct OP for the instances - Removed an unnecessary parameter from instance_from_dom() Signed-off-by: Dan Smith diff -r 854d848bae0b -r d48584b1c90c src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 02 07:03:04 2007 -0700 +++ b/src/Virt_ComputerSystem.c Fri Nov 02 10:28:30 2007 -0700 @@ -239,8 +239,7 @@ static int set_creation_class(CMPIInstan /* Populate an instance with information from a domain */ static int instance_from_dom(const CMPIBroker *broker, virDomainPtr dom, - CMPIInstance *instance, - const CMPIObjectPath *reference) + CMPIInstance *instance) { if (!set_name_from_dom(dom, instance)) { /* Print trace error */ @@ -291,7 +290,7 @@ CMPIInstance *instance_from_name(const C if (instance == NULL) goto out; - if (!instance_from_dom(broker, dom, instance, op)) + if (!instance_from_dom(broker, dom, instance)) instance = NULL; out: @@ -303,7 +302,7 @@ CMPIInstance *instance_from_name(const C /* Enumerate domains on the given connection, return results */ int enum_domains(const CMPIBroker *broker, virConnectPtr conn, - const CMPIObjectPath *op, + const char *ns, struct inst_list *instlist) { virDomainPtr *list = NULL; @@ -315,14 +314,13 @@ int enum_domains(const CMPIBroker *broke goto out; for (i = 0; i < count; i++) { - CMPIStatus s; CMPIInstance *inst; - inst = CMNewInstance(broker, op, &s); - if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(inst))) + inst = get_typed_instance(broker, "ComputerSystem", ns); + if (inst == NULL) goto end; - if (instance_from_dom(broker, list[i], inst, op)) + if (instance_from_dom(broker, list[i], inst)) inst_list_add(instlist, inst); end: @@ -351,7 +349,7 @@ static CMPIStatus return_enum_domains(co return s; inst_list_init(&list); - ret = enum_domains(_BROKER, conn, reference, &list); + ret = enum_domains(_BROKER, conn, NAMESPACE(reference), &list); if (!ret) { CMSetStatus(&s, CMPI_RC_ERR_FAILED); goto out; diff -r 854d848bae0b -r d48584b1c90c src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Fri Nov 02 07:03:04 2007 -0700 +++ b/src/Virt_ComputerSystem.h Fri Nov 02 10:28:30 2007 -0700 @@ -49,7 +49,7 @@ CMPIInstance *instance_from_name(const C */ int enum_domains(const CMPIBroker *broker, virConnectPtr conn, - const CMPIObjectPath *op, + const char *ns, struct inst_list *instlist); diff -r 854d848bae0b -r d48584b1c90c src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Fri Nov 02 07:03:04 2007 -0700 +++ b/src/Virt_HostedDependency.c Fri Nov 02 10:28:30 2007 -0700 @@ -62,7 +62,7 @@ static CMPIStatus host_to_vs(const CMPIO if (conn == NULL) return s; - ret = enum_domains(_BROKER, conn, ref, list); + ret = enum_domains(_BROKER, conn, NAMESPACE(ref), list); if (ret) { CMSetStatus(&s, CMPI_RC_OK); } else { From kaitlin at linux.vnet.ibm.com Fri Nov 2 20:40:16 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 02 Nov 2007 13:40:16 -0700 Subject: [Libvirt-cim] [PATCH] Fix enum_domains() to generate a correct ObjectPath for returned Instances In-Reply-To: References: Message-ID: <472B8B30.6080505@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194024510 25200 > # Node ID d48584b1c90c499dea3940c1718ef0e97ae5ef9e > # Parent 854d848bae0b56420e483ac7522775b6b3080aaa > Fix enum_domains() to generate a correct ObjectPath for returned Instances > > This fixes the fact that HostedDependency is returning ComputerSystem > instances with the wrong class name. > > - Modified enum_domains() to take a namespace instead of an object path and > actually create the correct OP for the instances > - Removed an unnecessary parameter from instance_from_dom() > Nice fix - HostedDependency now returns a correctly formatted Xen_ComputerSystem instance on my system. And good catch on the extra param for instance_from_dom(). +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 2 22:29:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 15:29:48 -0700 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() Message-ID: <0df048ad2e99c8eda6c8.1194042588@theine> # HG changeset patch # User Dan Smith # Date 1194042578 25200 # Node ID 0df048ad2e99c8eda6c843f148168a9fa0161399 # Parent 05b01d03f0b801afe266d8d012bc464be6a2d165 Add cu_compare_ref() This provides a generic way to easily compare a given ref against an instance, which should be useful in GetInstance functions for making sure the returned instance matches what was asked. Signed-off-by: Dan Smith diff -r 05b01d03f0b8 -r 0df048ad2e99 instance_util.c --- a/instance_util.c Sun Feb 15 22:01:53 2015 -0800 +++ b/instance_util.c Fri Nov 02 15:29:38 2007 -0700 @@ -19,6 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include "libcmpiutil.h" @@ -68,6 +69,59 @@ unsigned int cu_return_instance_names(co return c; } +static bool _compare_data(const CMPIData *a, const CMPIData *b) +{ + if (a->type != b->type) + return false; + + if (a->type & CMPI_string) { + const char *as = CMGetCharPtr(a->value.string); + const char *bs = CMGetCharPtr(b->value.string); + + return STREQ(as, bs); + } else if (a->type & CMPI_INTEGER) { + return memcmp(&a->value, &b->value, sizeof(a->value)) == 0; + } + + CU_DEBUG("Unhandled CMPI type: `%i'", a->type); + + return false; +} + +const struct cu_property *cu_compare_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst, + const struct cu_property *props) +{ + const struct cu_property *p = NULL; + int i; + CMPIStatus s; + + for (i = 0; props[i].name != NULL; i++) { + CMPIData kd, pd; + + p = &props[i]; + + kd = CMGetKey(ref, p->name, &s); + if (s.rc != CMPI_RC_OK) { + if (p->required) + goto out; + else + continue; + } + + pd = CMGetProperty(inst, p->name, &s); + if (s.rc != CMPI_RC_OK) + goto out; + + if (!_compare_data(&kd, &pd)) + goto out; + } + + p = NULL; + out: + return p; +} + /* * Local Variables: * mode: C diff -r 05b01d03f0b8 -r 0df048ad2e99 libcmpiutil.h --- a/libcmpiutil.h Sun Feb 15 22:01:53 2015 -0800 +++ b/libcmpiutil.h Fri Nov 02 15:29:38 2007 -0700 @@ -336,6 +336,27 @@ void inst_list_free(struct inst_list *li * @returns nonzero on success, zero on failure */ int inst_list_add(struct inst_list *list, CMPIInstance *inst); + +struct cu_property { + const char *name; + bool required; +}; + +/** + * Compare key values in a reference to properties in an instance, + * making sure they are identical. If props identifies a particular + * key as not required, then absence in the object path will not + * result in failure of this test. + * + * @param ref The ObjectPath to examine + * @param inst The Instance to compare + * @param props A NULL-terminated list of properties to compare + * @returns A pointer to the property structure of the first + * non-matching property, or NULL if all match + */ +const struct cu_property *cu_compare_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst, + const struct cu_property *props); #define DEFAULT_EIN(pn) \ static CMPIStatus pn##EnumInstanceNames(CMPIInstanceMI *self, \ From danms at us.ibm.com Fri Nov 2 22:31:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 15:31:20 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Move two classes to cu_compare_ref() Message-ID: The first patch removes the internal reference key checking from VSMS in favor of the libcmpiutil generic one. The second makes ComputerSystem do similar checking. If this looks good to people, we'll want to do this for (probably) all of the instance providers. From danms at us.ibm.com Fri Nov 2 22:31:22 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 15:31:22 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Make ComputerSystem.GetInstance() check its reference properly In-Reply-To: Message-ID: <8ddace706d4a00e30975.1194042682@theine> # HG changeset patch # User Dan Smith # Date 1194042669 25200 # Node ID 8ddace706d4a00e3097553e734dd1842aca0a97a # Parent 6e04d2c0c3a88a4bb991438f9ea02a1ad4596820 Make ComputerSystem.GetInstance() check its reference properly Signed-off-by: Dan Smith diff -r 6e04d2c0c3a8 -r 8ddace706d4a src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 02 15:31:08 2007 -0700 +++ b/src/Virt_ComputerSystem.c Fri Nov 02 15:31:09 2007 -0700 @@ -377,6 +377,12 @@ static CMPIStatus get_domain(const CMPIO CMPIInstance *inst[2] = {NULL, NULL}; CMPIStatus s; virConnectPtr conn = NULL; + const struct cu_property *prop; + static struct cu_property props[] = { + {"CreationClassName", 0}, + {"Name", 1}, + {NULL, 0} + }; conn = lv_connect(_BROKER, &s); if (conn == NULL) @@ -387,6 +393,14 @@ static CMPIStatus get_domain(const CMPIO cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unable to find `%s'", name); + goto out; + } + + prop = cu_compare_ref(reference, inst[0], props); + if (prop != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such instance (%s)", prop->name); goto out; } From danms at us.ibm.com Fri Nov 2 22:31:21 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 15:31:21 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Make VSMS.GetInstance use the standardized ref checker in libcmpiutil In-Reply-To: Message-ID: <6e04d2c0c3a88a4bb991.1194042681@theine> # HG changeset patch # User Dan Smith # Date 1194042668 25200 # Node ID 6e04d2c0c3a88a4bb991438f9ea02a1ad4596820 # Parent d48584b1c90c499dea3940c1718ef0e97ae5ef9e Make VSMS.GetInstance use the standardized ref checker in libcmpiutil Signed-off-by: Dan Smith diff -r d48584b1c90c -r 6e04d2c0c3a8 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Nov 02 10:28:30 2007 -0700 +++ b/src/Virt_VirtualSystemManagementService.c Fri Nov 02 15:31:08 2007 -0700 @@ -1022,32 +1022,6 @@ static CMPIStatus EnumInstances(CMPIInst return return_vsms(reference, results, 0); } -static int compare_prop(const CMPIObjectPath *ref, - const CMPIInstance *inst, - const char *name, - int mandatory) -{ - char *prop = NULL; - char *key = NULL; - int rc = 0; - - key = cu_get_str_path(ref, name); - if (key == NULL) { - rc = !mandatory; - goto out; - } - - if (cu_get_str_prop(inst, name, &prop) != CMPI_RC_OK) - goto out; - - rc = STREQ(key, prop); - out: - free(prop); - free(key); - - return rc; -} - static CMPIStatus GetInstance(CMPIInstanceMI *self, const CMPIContext *context, const CMPIResult *results, @@ -1056,19 +1030,25 @@ static CMPIStatus GetInstance(CMPIInstan { CMPIInstance *inst; CMPIStatus s; + const struct cu_property *prop; + static struct cu_property props[] = { + {"CreationClassName", 0}, + {"SystemName", 0}, + {"SystemCreationClassName", 0}, + {"Name", 1}, + {NULL, 0} + }; s = _get_vsms(ref, &inst, 0); if (s.rc != CMPI_RC_OK) return s; - if (!compare_prop(ref, inst, "CreationClassName", 0) || - !compare_prop(ref, inst, "SystemName", 0) || - !compare_prop(ref, inst, "Name", 1) || - !compare_prop(ref, inst, "SystemCreationClassName", 0)) + prop = cu_compare_ref(ref, inst, props); + if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, - "No such instance"); - else { + "No such instance (%s)", prop->name); + } else { CMSetStatus(&s, CMPI_RC_OK); CMReturnInstance(results, inst); } From kaitlin at linux.vnet.ibm.com Fri Nov 2 23:38:01 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 02 Nov 2007 16:38:01 -0700 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() In-Reply-To: <0df048ad2e99c8eda6c8.1194042588@theine> References: <0df048ad2e99c8eda6c8.1194042588@theine> Message-ID: <472BB4D9.8040605@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194042578 25200 > # Node ID 0df048ad2e99c8eda6c843f148168a9fa0161399 > # Parent 05b01d03f0b801afe266d8d012bc464be6a2d165 > Add cu_compare_ref() > > This provides a generic way to easily compare a given ref against an instance, > which should be useful in GetInstance functions for making sure the returned > instance matches what was asked. > > +const struct cu_property *cu_compare_ref(const CMPIObjectPath *ref, > + const CMPIInstance *inst, > + const struct cu_property *props) > > This looks good. Only minor issue is that you don't return the status, but I the other cu_<> functions behave the same way. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 2 23:43:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 02 Nov 2007 16:43:06 -0700 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() In-Reply-To: <472BB4D9.8040605@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Fri, 02 Nov 2007 16:38:01 -0700") References: <0df048ad2e99c8eda6c8.1194042588@theine> <472BB4D9.8040605@linux.vnet.ibm.com> Message-ID: <87ir4ktdrp.fsf@theine.beaverton.ibm.com> KR> This looks good. Only minor issue is that you don't return the KR> status, but I the other cu_<> functions behave the same way. +1 I don't return a CMPIStatus, but I do return a pointer to the caller's cu_property struct that didn't pass the check, which they can use to set a CMPIStatus if they wish (see my subsequent patches to libvirt-cim). I did it this way to avoid having to pass around a CMPIBroker, and so that the caller has more control over the status value. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 2 23:51:45 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 02 Nov 2007 16:51:45 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Move two classes to cu_compare_ref() In-Reply-To: References: Message-ID: <472BB811.6050609@linux.vnet.ibm.com> Dan Smith wrote: > The first patch removes the internal reference key checking from VSMS > in favor of the libcmpiutil generic one. The second makes ComputerSystem > do similar checking. If this looks good to people, we'll want to do this > for (probably) all of the instance providers. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Both of these look fine to me (including the error handling =) +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From heidieck at linux.vnet.ibm.com Mon Nov 5 09:07:32 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 05 Nov 2007 10:07:32 +0100 Subject: [Libvirt-cim] Automatic information of updates to libvirt-cim and libcmpiutil In-Reply-To: <87mytwvkaz.fsf@theine.beaverton.ibm.com> References: <4729BD63.8000108@linux.vnet.ibm.com> <20071101122325.GB25921@redhat.com> <87y7dixbfz.fsf@theine.beaverton.ibm.com> <472AE066.5030404@linux.vnet.ibm.com> <87mytwvkaz.fsf@theine.beaverton.ibm.com> Message-ID: <472EDD54.8060708@linux.vnet.ibm.com> Dan Smith wrote: > HE> What are the RSS feeds and how can I use them ? > > RSS feeds are sort of like newsgroups, but much smaller, and contained > to a single XML file. I think you're using thunderbird, which can > consume RSS feeds as if it were a mail box. All you need to do is add > the following URL as an RSS feed: > > http://libvirt.org/hg/libvirt-cim/rss-log > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim Great, that is what I was looking for :). Thanks. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Mon Nov 5 09:59:37 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 05 Nov 2007 10:59:37 +0100 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() In-Reply-To: <0df048ad2e99c8eda6c8.1194042588@theine> References: <0df048ad2e99c8eda6c8.1194042588@theine> Message-ID: <472EE989.9050508@linux.vnet.ibm.com> Dan Smith wrote: > +static bool _compare_data(const CMPIData *a, const CMPIData *b) > +{ > + if (a->type != b->type) > + return false; > + > + if (a->type & CMPI_string) { > + const char *as = CMGetCharPtr(a->value.string); > + const char *bs = CMGetCharPtr(b->value.string); > + > + return STREQ(as, bs); > I suggest to use STREQC to become more flexible to the requesters case usage decision. > + > +const struct cu_property *cu_compare_ref(const CMPIObjectPath *ref, > + const CMPIInstance *inst, > + const struct cu_property *props) > +{ > + const struct cu_property *p = NULL; > + int i; > + CMPIStatus s; > + > + for (i = 0; props[i].name != NULL; i++) { > + CMPIData kd, pd; > + > + p = &props[i]; > + > + kd = CMGetKey(ref, p->name, &s); > + if (s.rc != CMPI_RC_OK) { > + if (p->required) > + goto out; > + else > + continue; > + } > I fear these lines include a possible crash scenario. For the case that CMGetKey() failed, kd is NULL, but p->required is false - it continues. Later _compare_data() does not check the CMPIData pointer against NULL. > + > + pd = CMGetProperty(inst, p->name, &s); > + if (s.rc != CMPI_RC_OK) > + goto out; > + > + if (!_compare_data(&kd, &pd)) > + goto out; > + } > + > + p = NULL; > + out: > + return p; > +} > Other than that I have a conceptual question. In this implementation the provider is responsible for defining the list of key properties and has the freedom to mark the properties to be required or not. CIM itself does not give a provider this level of freedom. All key properties of an object path (class) have to be set. And an instance is only then the requested instance, if all key properties fit to the values known to the provider. Otherwise the client requested another instance. The required flag is a very interesting approach, but we should remove it, to avoid misbehavior of providers. A freedom that is not given, can not be used ;). I would also think, that it is not necessary to let the provider define the list of all key properties. As I said - the list of key properties is fix and given with the class definition. The CIMOM checks if all key properties are set and refuses requests with NULL value key properties. A provider does not has to handle this. Now CMPI offers macros to implement a generic approach to iterate over the list of key properties without the knowledge of certain names: CMGetKeyCount() to retrieve the number of key properties iterate over the number of key properties and CMGetKeyAt() to retrieve the key properties at this index Now my suggestion is to implement this generic approach for cu_compare_ref() and remove the props list from the input parameter list. What do you think ? -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From veillard at redhat.com Mon Nov 5 10:34:26 2007 From: veillard at redhat.com (Daniel Veillard) Date: Mon, 5 Nov 2007 05:34:26 -0500 Subject: [Libvirt-cim] [PATCH] fix trivial libcmpiutil compilation issue In-Reply-To: <87ve8mys0w.fsf@theine.beaverton.ibm.com> References: <20071101100702.GA25921@redhat.com> <87ve8mys0w.fsf@theine.beaverton.ibm.com> Message-ID: <20071105103426.GC25581@redhat.com> On Thu, Nov 01, 2007 at 07:11:43AM -0700, Dan Smith wrote: > DV> # HG changeset patch > DV> # User Daniel Veillard > DV> # Date 1193910954 -3600 > DV> # Node ID 5e54246e74833caed8f5176f8bd5bb9e28b60299 > DV> # Parent 05b01d03f0b801afe266d8d012bc464be6a2d165 > DV> Fix a trivial compilation problem, > DV> the variable declaration is at the wrong place. > > Applied, thanks! > > You might be the first person to try building without HAVE_EOPARSER > defined :) well I was compiling on a RHEL-4 box :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From veillard at redhat.com Mon Nov 5 10:52:44 2007 From: veillard at redhat.com (Daniel Veillard) Date: Mon, 5 Nov 2007 05:52:44 -0500 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <873avpwigk.fsf@theine.beaverton.ibm.com> References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <20071102004635.GC12051@redhat.com> <873avpwigk.fsf@theine.beaverton.ibm.com> Message-ID: <20071105105244.GE25581@redhat.com> On Thu, Nov 01, 2007 at 06:21:15PM -0700, Dan Smith wrote: > DB> Please fix the clock on your computer, or tell me how your time > DB> machine works ;-P > > I know, I sent that from patchbomb inside a VM, which I normally don't > do. Needless to say, the clock had drifted just a bit. > > Sorry about that :) Virtualization of time is the next step, I'm sure it's gonna make a huge hit ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From heidieck at linux.vnet.ibm.com Mon Nov 5 10:40:45 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 05 Nov 2007 12:40:45 +0200 Subject: [Libvirt-cim] [PATCH] Fix non-DMTF-conform property values on RegisteredProfile Message-ID: <86babdd4b732e6b1203a.1194262845@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1194262833 -3600 # Node ID 86babdd4b732e6b1203acab9372cf42970032cbf # Parent 8ddace706d4a00e3097553e734dd1842aca0a97a Fix non-DMTF-conform property values on RegisteredProfile Signed-off-by: Heidi Eckhart diff -r 8ddace706d4a -r 86babdd4b732 src/profiles.h --- a/src/profiles.h Fri Nov 02 15:31:09 2007 -0700 +++ b/src/profiles.h Mon Nov 05 12:40:33 2007 +0100 @@ -31,15 +31,15 @@ struct reg_prof { struct reg_prof SystemVirtualization = { .reg_org = 2, - .reg_id = "DSP1042-1.0.0a", - .reg_name = "System Virtualization Profile", - .reg_version = "1.0.0a", + .reg_id = "CIM:DSP1042-SystemVirtualization-1.0.0", + .reg_name = "System Virtualization", + .reg_version = "1.0.0", .provider_name = "HostSystem" }; struct reg_prof VirtualSystem = { .reg_org = 2, - .reg_id = "DSP1057-1.0.0a", + .reg_id = "CIM:DSP1057-VirtualSystem-1.0.0a", .reg_name = "Virtual System Profile", .reg_version = "1.0.0a", .provider_name = "ComputerSystem" From heidieck at linux.vnet.ibm.com Mon Nov 5 13:34:15 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 05 Nov 2007 14:34:15 +0100 Subject: [Libvirt-cim] Namespace of association ElementCapabilities Message-ID: <472F1BD7.3040005@linux.vnet.ibm.com> The association ElementCapabilities seems to be registered to the wrong namespace ? Shouldn't it be root/ibmsd ? Xen_ElementCapabilities root/interop Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association KVM_ElementCapabilities root/interop KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Mon Nov 5 13:53:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 05 Nov 2007 05:53:28 -0800 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() In-Reply-To: <472EE989.9050508@linux.vnet.ibm.com> (Heidi Eckhart's message of "Mon, 05 Nov 2007 10:59:37 +0100") References: <0df048ad2e99c8eda6c8.1194042588@theine> <472EE989.9050508@linux.vnet.ibm.com> Message-ID: <87bqa8u7c7.fsf@theine.beaverton.ibm.com> HE> I suggest to use STREQC to become more flexible to the requesters HE> case usage decision. Okay, good idea. >> + for (i = 0; props[i].name != NULL; i++) { >> + CMPIData kd, pd; >> + >> + p = &props[i]; >> + >> + kd = CMGetKey(ref, p->name, &s); >> + if (s.rc != CMPI_RC_OK) { >> + if (p->required) >> + goto out; >> + else >> + continue; >> + } >> HE> I fear these lines include a possible crash scenario. For the case HE> that CMGetKey() failed, kd is NULL, but p->required is false - it HE> continues. Later _compare_data() does not check the CMPIData HE> pointer against NULL. But continue goes to the next iteration of the for loop, where we'll either end, or reset kd to the next key value. I don't think there is a crash here. HE> Other than that I have a conceptual question. In this HE> implementation the provider is responsible for defining the list HE> of key properties and has the freedom to mark the properties to be HE> required or not. CIM itself does not give a provider this level of HE> freedom. All key properties of an object path (class) have to be HE> set. And an instance is only then the requested instance, if all HE> key properties fit to the values known to the provider. Otherwise HE> the client requested another instance. The required flag is a very HE> interesting approach, but we should remove it, to avoid HE> misbehavior of providers. A freedom that is not given, can not be HE> used ;). I know what you're saying, and I agree with you on a basic level. However, if one of the key properties is unique enough to identify an instance among all others, and the other keys are not specified (it would be different if they were specified and wrong) what practical sense does it make for us to check them? It makes testing harder, for sure. I think that the practical use of not checking meaningless keys is a reasonable optimization over the CIM spec, but I'm fine with either of the following three solutions: 1. Leaving it the way I have it, bending the spec intelligently 2. Modifying libcmpiutil to have a compile-time flag for relaxed key checking (for testing, debug, etc) 3. Removing the feature altogether and making all keys checked all the time Thoughts? HE> I would also think, that it is not necessary to let the provider HE> define the list of all key properties. As I said - the list of key HE> properties is fix and given with the class definition. Yes, but if you want some to be optional and some not (as I originally intended), then you need to provide a list of those that you care about. Perhaps this should have been a list of required keys, and let the routine check the other keys implicitly. HE> The CIMOM checks if all key properties are set and refuses HE> requests with NULL value key properties. A provider does not has HE> to handle this. That's not true, at least in the GetInstance case. I can do a GetInstance of, say, VSMS with only Name set. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Mon Nov 5 14:22:52 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 05 Nov 2007 09:22:52 -0500 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <871wb9y23w.fsf@theine.beaverton.ibm.com> References: <66e4bd0fd892e9771976.1193939747@wulfgar> <871wb9y23w.fsf@theine.beaverton.ibm.com> Message-ID: <472F273C.7090701@linux.vnet.ibm.com> Dan Smith wrote: > JG> # HG changeset patch > JG> # User Jay Gagnon > JG> # Date 1193939694 14400 > JG> # Node ID 66e4bd0fd892e97719769b5ad3128ed2ccbfc514 > JG> # Parent 308064b52d99dcfff6315a309cc8aa66cb55f556 > JG> Remove newline characters from CU_DEBUG calls now that the newline > JG> is automatic. Also remove a few debug messages that are no longer > JG> necessary and clutter output. > > Er, actually, this doesn't apply on top of the current tip. Here is > the reject: > Oops. I'll make sure my tree is up to date and resend. -- -Jay From grendel at linux.vnet.ibm.com Mon Nov 5 14:53:15 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 05 Nov 2007 09:53:15 -0500 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <472F273C.7090701@linux.vnet.ibm.com> References: <66e4bd0fd892e9771976.1193939747@wulfgar> <871wb9y23w.fsf@theine.beaverton.ibm.com> <472F273C.7090701@linux.vnet.ibm.com> Message-ID: <472F2E5B.5000503@linux.vnet.ibm.com> Jay Gagnon wrote: > Dan Smith wrote: > >> JG> # HG changeset patch >> JG> # User Jay Gagnon >> JG> # Date 1193939694 14400 >> JG> # Node ID 66e4bd0fd892e97719769b5ad3128ed2ccbfc514 >> JG> # Parent 308064b52d99dcfff6315a309cc8aa66cb55f556 >> JG> Remove newline characters from CU_DEBUG calls now that the newline >> JG> is automatic. Also remove a few debug messages that are no longer >> JG> necessary and clutter output. >> >> Er, actually, this doesn't apply on top of the current tip. Here is >> the reject: >> >> > Oops. I'll make sure my tree is up to date and resend. > > > Odd, I updated the tree and pushed the patch back on. Even after a qrefresh it still shows the changes that are getting rejected... Want me to resend just for kicks and see if it applies? The line numbers seem to have changed quite a bit so maybe it was just rejecting because it exceeded a fuzz tolerance. -- -Jay From danms at us.ibm.com Mon Nov 5 14:58:53 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 05 Nov 2007 06:58:53 -0800 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <472F2E5B.5000503@linux.vnet.ibm.com> (Jay Gagnon's message of "Mon, 05 Nov 2007 09:53:15 -0500") References: <66e4bd0fd892e9771976.1193939747@wulfgar> <871wb9y23w.fsf@theine.beaverton.ibm.com> <472F273C.7090701@linux.vnet.ibm.com> <472F2E5B.5000503@linux.vnet.ibm.com> Message-ID: <87y7dcspqq.fsf@theine.beaverton.ibm.com> JG> Odd, I updated the tree and pushed the patch back on. Even after JG> a qrefresh it still shows the changes that are getting rejected... Hmm, weird. JG> Want me to resend just for kicks and see if it applies? The line JG> numbers seem to have changed quite a bit so maybe it was just JG> rejecting because it exceeded a fuzz tolerance. Yeah, sure. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 5 13:59:32 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 05 Nov 2007 06:59:32 -0700 Subject: [Libvirt-cim] [PATCH] Replace #include of libvirt.h in ComputerSystem Message-ID: # HG changeset patch # User Dan Smith # Date 1194274759 28800 # Node ID fa10054ee62b6f5bb7fc3f832464e4d6caf6f274 # Parent 8ddace706d4a00e3097553e734dd1842aca0a97a Replace #include of libvirt.h in ComputerSystem Signed-off-by: Dan Smith diff -r 8ddace706d4a -r fa10054ee62b src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 02 15:31:09 2007 -0700 +++ b/src/Virt_ComputerSystem.c Mon Nov 05 06:59:19 2007 -0800 @@ -28,6 +28,8 @@ #include #include +#include + #include "cs_util.h" #include "libcmpiutil.h" #include "misc_util.h" From grendel at linux.vnet.ibm.com Mon Nov 5 15:14:00 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 05 Nov 2007 10:14:00 -0500 Subject: [Libvirt-cim] Namespace of association ElementCapabilities In-Reply-To: <472F1BD7.3040005@linux.vnet.ibm.com> References: <472F1BD7.3040005@linux.vnet.ibm.com> Message-ID: <472F3338.60307@linux.vnet.ibm.com> Heidi Eckhart wrote: > The association ElementCapabilities seems to be registered to the > wrong namespace ? Shouldn't it be root/ibmsd ? > > Xen_ElementCapabilities root/interop Xen_ElementCapabilitiesProvider > Virt_ElementCapabilities association > KVM_ElementCapabilities root/interop KVM_ElementCapabilitiesProvider > Virt_ElementCapabilities association > Yea, I would imagine it should be. Somebody probably just copied an existing file and didn't realize it was an interop one. -- -Jay From grendel at linux.vnet.ibm.com Mon Nov 5 15:17:27 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 05 Nov 2007 10:17:27 -0500 Subject: [Libvirt-cim] [PATCH] Replace #include of libvirt.h in ComputerSystem In-Reply-To: References: Message-ID: <472F3407.4010805@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194274759 28800 > # Node ID fa10054ee62b6f5bb7fc3f832464e4d6caf6f274 > # Parent 8ddace706d4a00e3097553e734dd1842aca0a97a > Replace #include of libvirt.h in ComputerSystem > > Signed-off-by: Dan Smith > > diff -r 8ddace706d4a -r fa10054ee62b src/Virt_ComputerSystem.c > --- a/src/Virt_ComputerSystem.c Fri Nov 02 15:31:09 2007 -0700 > +++ b/src/Virt_ComputerSystem.c Mon Nov 05 06:59:19 2007 -0800 > @@ -28,6 +28,8 @@ > #include > #include > > +#include > + > #include "cs_util.h" > #include "libcmpiutil.h" > #include "misc_util.h" > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Nice change of pace to see a patch I can read without scrolling four pages. :-P +1 -- -Jay From grendel at linux.vnet.ibm.com Mon Nov 5 14:39:10 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 05 Nov 2007 10:39:10 -0400 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output Message-ID: <81dadd293027c2b7f544.1194277150@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194274337 18000 # Node ID 81dadd293027c2b7f5448f81847966a467acca46 # Parent c085e6e20b40d6dd3cde7809b2681be53f6b4dea Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. Signed-off-by: Jay Gagnon diff -r c085e6e20b40 -r 81dadd293027 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 05 09:23:11 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Nov 05 09:52:17 2007 -0500 @@ -53,12 +53,10 @@ static bool rasd_prop_copy_value(struct { bool rc = true; - CU_DEBUG("Copying '%s'.\n", src.field); + CU_DEBUG("Copying '%s'.", src.field); if (src.type & CMPI_string) { - CU_DEBUG("String type.\n"); dest->value = (CMPIValue *)strdup((char *)src.value); } else if (src.type & CMPI_INTEGER) { - CU_DEBUG("Integer type.\n"); dest->value = malloc(sizeof(CMPIValue)); memcpy(dest->value, src.value, sizeof(CMPIValue)); } else { @@ -76,7 +74,6 @@ static bool dup_rasd_prop_list(struct sd *dest = NULL; for (i = 0, count = 1; src[i].field != NULL; i++, count++) { - CU_DEBUG("count: %d, i: %d. reallocing.\n", count, i); *dest = realloc(*dest, count * sizeof(struct sdc_rasd_prop)); (*dest)[i].field = strdup(src[i].field); ret = rasd_prop_copy_value(src[i], &(*dest)[i]); @@ -84,7 +81,6 @@ static bool dup_rasd_prop_list(struct sd } /* Make sure to terminate the list. */ - CU_DEBUG("Terminating list. count: %d, i: %d\n", count, i); *dest = realloc(*dest, count * sizeof(struct sdc_rasd_prop)); (*dest)[i] = (struct sdc_rasd_prop)PROP_END; @@ -501,16 +497,16 @@ static CMPIInstance *sdc_rasd_inst(const CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16); for (i = 0; prop_list[i].field != NULL; i++) { - CU_DEBUG("Setting property '%s'.\n", prop_list[i].field); + CU_DEBUG("Setting property '%s'.", prop_list[i].field); CMSetProperty(inst, prop_list[i].field, prop_list[i].value, prop_list[i].type); - CU_DEBUG("Set.\n"); - } - - CU_DEBUG("freeing prop_list.\n"); + CU_DEBUG("Set."); + } + + CU_DEBUG("freeing prop_list."); free_rasd_prop_list(prop_list); out: - CU_DEBUG("Returning inst.\n"); + CU_DEBUG("Returning inst."); return inst; } @@ -537,17 +533,17 @@ static CMPIStatus sdc_rasds_for_type(con CU_DEBUG("Problem getting inst."); goto out; } - CU_DEBUG("Got inst.\n"); + CU_DEBUG("Got inst."); if (inst != NULL) { inst_list_add(list, inst); - CU_DEBUG("Added inst.\n"); + CU_DEBUG("Added inst."); } else { - CU_DEBUG("Inst is null, not added.\n"); + CU_DEBUG("Inst is null, not added."); } } } else { - CU_DEBUG("Unsupported type.\n"); + CU_DEBUG("Unsupported type."); CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unsupported device type."); } @@ -564,7 +560,7 @@ static CMPIStatus alloc_cap_to_rasd(cons int ret; uint16_t type; - CU_DEBUG("Getting ResourceType.\n"); + CU_DEBUG("Getting ResourceType."); ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != 1) { @@ -573,7 +569,7 @@ static CMPIStatus alloc_cap_to_rasd(cons goto out; } - CU_DEBUG("ResourceType: %hi.\n", type); + CU_DEBUG("ResourceType: %hi.", type); s = sdc_rasds_for_type(ref, list, type); From danms at us.ibm.com Mon Nov 5 16:26:43 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 05 Nov 2007 09:26:43 -0700 Subject: [Libvirt-cim] [PATCH] Make ResourcePoolConfigurationService return errors when appropriate Message-ID: <0ae96e2255c9d6b095b3.1194283603@theine> # HG changeset patch # User Dan Smith # Date 1194283579 28800 # Node ID 0ae96e2255c9d6b095b3cbdcbb247621a8abd91a # Parent fa10054ee62b6f5bb7fc3f832464e4d6caf6f274 Make ResourcePoolConfigurationService return errors when appropriate and fix up some other general error-handling around the needed changes. This includes a use of the (now controversial) cu_compare_ref() function, so I won't commit this until we come to a decision about it, but the act of checking the reference is something we need to do here, no matter how it shakes out. Signed-off-by: Dan Smith diff -r fa10054ee62b -r 0ae96e2255c9 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Mon Nov 05 06:59:19 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationService.c Mon Nov 05 09:26:19 2007 -0800 @@ -89,7 +89,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -static CMPIInstance *rpcs_instance(const CMPIObjectPath *reference) +static CMPIStatus rpcs_instance(const CMPIObjectPath *reference, + CMPIInstance **_inst) { CMPIInstance *inst; CMPIInstance *host; @@ -98,28 +99,47 @@ static CMPIInstance *rpcs_instance(const s = get_host_cs(_BROKER, reference, &host); if (s.rc != CMPI_RC_OK) - return NULL; + goto out; inst = get_typed_instance(_BROKER, "ResourcePoolConfigurationService", NAMESPACE(reference)); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get " + "ResourcePoolConfigurationService instance"); + goto out; + } CMSetProperty(inst, "Name", (CMPIValue *)"RPCS", CMPI_chars); prop = CMGetProperty(host, "CreationClassName", &s); - if (s.rc != CMPI_RC_OK) - return NULL; + if (s.rc != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get CreationClassName from HostSystem"); + goto out; + } + CMSetProperty(inst, "SystemCreationClassName", (CMPIValue *)&prop.value.string, CMPI_string); prop = CMGetProperty(host, "Name", NULL); - if (s.rc != CMPI_RC_OK) - return NULL; + if (s.rc != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get Name from HostSystem"); + goto out; + } + CMSetProperty(inst, "SystemName", (CMPIValue *)&prop.value.string, CMPI_string); - return inst; + *_inst = inst; + out: + return s; } static CMPIStatus GetInstance(CMPIInstanceMI *self, @@ -129,12 +149,30 @@ static CMPIStatus GetInstance(CMPIInstan const char **properties) { CMPIInstance *inst; - - inst = rpcs_instance(reference); - - CMReturnInstance(results, inst); - - return (CMPIStatus){CMPI_RC_OK, NULL}; + CMPIStatus s; + const struct cu_property *prop; + static struct cu_property props[] = { + {"CreationClassName", 0}, + {"SystemCreationClassName", 0}, + {"SystemName", 0}, + {"Name", 1}, + {NULL, 0} + }; + + s = rpcs_instance(reference, &inst); + if (s.rc != CMPI_RC_OK) + return s; + + prop = cu_compare_ref(reference, inst, props); + if (prop != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such instance (%s)", prop->name); + } else { + CMReturnInstance(results, inst); + } + + return s; } static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self, @@ -143,12 +181,13 @@ static CMPIStatus EnumInstanceNames(CMPI const CMPIObjectPath *reference) { CMPIInstance *inst; - - inst = rpcs_instance(reference); - - cu_return_instance_name(results, inst); - - return (CMPIStatus){CMPI_RC_OK, NULL}; + CMPIStatus s; + + s = rpcs_instance(reference, &inst); + if (s.rc == CMPI_RC_OK) + cu_return_instance_name(results, inst); + + return s; } static CMPIStatus EnumInstances(CMPIInstanceMI *self, @@ -159,12 +198,13 @@ static CMPIStatus EnumInstances(CMPIInst { CMPIInstance *inst; - - inst = rpcs_instance(reference); - - CMReturnInstance(results, inst); - - return (CMPIStatus){CMPI_RC_OK, NULL}; + CMPIStatus s; + + s = rpcs_instance(reference, &inst); + if (s.rc == CMPI_RC_OK) + CMReturnInstance(results, inst); + + return s; } From kaitlin at linux.vnet.ibm.com Mon Nov 5 18:13:13 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 05 Nov 2007 10:13:13 -0800 Subject: [Libvirt-cim] [PATCH] Fix non-DMTF-conform property values on RegisteredProfile In-Reply-To: <86babdd4b732e6b1203a.1194262845@localhost.localdomain> References: <86babdd4b732e6b1203a.1194262845@localhost.localdomain> Message-ID: <472F5D39.3070005@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1194262833 -3600 > # Node ID 86babdd4b732e6b1203acab9372cf42970032cbf > # Parent 8ddace706d4a00e3097553e734dd1842aca0a97a > Fix non-DMTF-conform property values on RegisteredProfile > > Signed-off-by: Heidi Eckhart > This looks good. Both conform to the mof and the struct for System Virtualization matches the SVP. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Mon Nov 5 19:32:30 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 05 Nov 2007 11:32:30 -0800 Subject: [Libvirt-cim] [PATCH] Fixes improper formatting in ElementAllocatedFromPool.mof. This was causing an error during the postinstall with Pegasus, which prevented the mof from being added to the repository correctly Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1194289946 28800 # Node ID ffb35bc02f07812cee133ebab999d8b463d51d03 # Parent e8577c608398eeb0812342dc942a4788116d4515 Fixes improper formatting in ElementAllocatedFromPool.mof. This was causing an error during the postinstall with Pegasus, which prevented the mof from being added to the repository correctly. Signed-off-by: Kaitlin Rupert diff -r e8577c608398 -r ffb35bc02f07 schema/ElementAllocatedFromPool.mof --- a/schema/ElementAllocatedFromPool.mof Mon Nov 05 12:40:33 2007 +0100 +++ b/schema/ElementAllocatedFromPool.mof Mon Nov 05 11:12:26 2007 -0800 @@ -1,5 +1,7 @@ // Copyright IBM Corp. 2007 -Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { +[Association] +class Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { }; -KVM_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { +[Association] +class KVM_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { }; From danms at us.ibm.com Mon Nov 5 19:41:41 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 05 Nov 2007 11:41:41 -0800 Subject: [Libvirt-cim] [PATCH] Fixes improper formatting in ElementAllocatedFromPool.mof. This was causing an error during the postinstall with Pegasus, which prevented the mof from being added to the repository correctly In-Reply-To: (Kaitlin Rupert's message of "Mon, 05 Nov 2007 11:32:30 -0800") References: Message-ID: <87640gscne.fsf@theine.beaverton.ibm.com> KR> -Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { KR> +[Association] KR> +class Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { Whoops, this would be my fault I think. Did I really forget "class" in front of the class name? That was dumb. Interesting that sfcb seems to be okay with it. Thanks :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Mon Nov 5 20:17:04 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 05 Nov 2007 15:17:04 -0500 Subject: [Libvirt-cim] [PATCH] Make ResourcePoolConfigurationService return errors when appropriate In-Reply-To: <0ae96e2255c9d6b095b3.1194283603@theine> References: <0ae96e2255c9d6b095b3.1194283603@theine> Message-ID: <472F7A40.5070702@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194283579 28800 > # Node ID 0ae96e2255c9d6b095b3cbdcbb247621a8abd91a > # Parent fa10054ee62b6f5bb7fc3f832464e4d6caf6f274 > Make ResourcePoolConfigurationService return errors when appropriate > and fix up some other general error-handling around the needed changes. > > This includes a use of the (now controversial) cu_compare_ref() function, > so I won't commit this until we come to a decision about it, but the > act of checking the reference is something we need to do here, no matter > how it shakes out. > > Signed-off-by: Dan Smith > > > I'll stay out of the cu_compare_ref() discussion for now, but pretending for the moment that it ends up meeting approval one way or another, this is a fine use of it. +1 -- -Jay From kaitlin at linux.vnet.ibm.com Mon Nov 5 20:39:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 05 Nov 2007 12:39:49 -0800 Subject: [Libvirt-cim] [PATCH] Make ResourcePoolConfigurationService return errors when appropriate In-Reply-To: <472F7A40.5070702@linux.vnet.ibm.com> References: <0ae96e2255c9d6b095b3.1194283603@theine> <472F7A40.5070702@linux.vnet.ibm.com> Message-ID: <472F7F95.4010304@linux.vnet.ibm.com> Jay Gagnon wrote: > Dan Smith wrote: > >> # HG changeset patch >> # User Dan Smith >> # Date 1194283579 28800 >> # Node ID 0ae96e2255c9d6b095b3cbdcbb247621a8abd91a >> # Parent fa10054ee62b6f5bb7fc3f832464e4d6caf6f274 >> Make ResourcePoolConfigurationService return errors when appropriate >> and fix up some other general error-handling around the needed changes. >> > I'll stay out of the cu_compare_ref() discussion for now, but pretending > for the moment that it ends up meeting approval one way or another, this > is a fine use of it. +1 > I agree - thanks for fixing how the return status is handled in rpcs_instance(). =) +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 6 01:54:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 05 Nov 2007 17:54:56 -0800 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() In-Reply-To: <87bqa8u7c7.fsf@theine.beaverton.ibm.com> (Dan Smith's message of "Mon, 05 Nov 2007 05:53:28 -0800") References: <0df048ad2e99c8eda6c8.1194042588@theine> <472EE989.9050508@linux.vnet.ibm.com> <87bqa8u7c7.fsf@theine.beaverton.ibm.com> Message-ID: <871wb4rvdb.fsf@theine.beaverton.ibm.com> DS> I'm fine with either of the following three solutions: DS> 1. Leaving it the way I have it, bending the spec intelligently DS> 2. Modifying libcmpiutil to have a compile-time flag for relaxed key DS> checking (for testing, debug, etc) DS> 3. Removing the feature altogether and making all keys checked all DS> the time DS> Thoughts? So, after some experimentation, I have determined that neither Pegasus nor SFCB set the key properties in an ObjectPath if they are not set by the client. The following works on both: % wbemcli gi 'http://root:password at localhost/root/ibmsd:Xen_VirtualSystemManagementService.Name="Management Service"' This means that Pegasus does not require all keys (as specified in the schema for a given class) to be set. If I loop through the keys in the GetInstance handler case of above, only "Name" is set. I don't get the other three keys of CIM_Service set. If this level of checking is required for strict adherence, I really think the CIMOMs should be checking that the keys are specified and we should be making sure that keys match properties. So, my suggestion would be to either leave it the way it is, or remove the properties paramter and just check that whatever keys were specified match the associated properties. Anyone else have an opinion, based on this updated information? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Nov 6 02:14:55 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 05 Nov 2007 18:14:55 -0800 Subject: [Libvirt-cim] [PATCH] Add cu_compare_ref() In-Reply-To: <871wb4rvdb.fsf@theine.beaverton.ibm.com> References: <0df048ad2e99c8eda6c8.1194042588@theine> <472EE989.9050508@linux.vnet.ibm.com> <87bqa8u7c7.fsf@theine.beaverton.ibm.com> <871wb4rvdb.fsf@theine.beaverton.ibm.com> Message-ID: <472FCE1F.1020908@linux.vnet.ibm.com> Dan Smith wrote: > So, after some experimentation, I have determined that neither Pegasus > nor SFCB set the key properties in an ObjectPath if they are not set > by the client. The following works on both: > > % wbemcli gi 'http://root:password at localhost/root/ibmsd:Xen_VirtualSystemManagementService.Name="Management Service"' > This also worked for me using Pegaus. > This means that Pegasus does not require all keys (as specified in the > schema for a given class) to be set. > > If I loop through the keys in the GetInstance handler case of above, > only "Name" is set. I don't get the other three keys of CIM_Service > set. > Is there someplace that spells out exactly how the keys should be used? My only understanding of them is that the keys - as a set - should be unique per instance. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From zli at linux.vnet.ibm.com Tue Nov 6 08:44:01 2007 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Tue, 06 Nov 2007 16:44:01 +0800 Subject: [Libvirt-cim] [PATCH] Fix the XML we generate for an incoming system to include the block In-Reply-To: <87640kviho.fsf@theine.beaverton.ibm.com> References: <5789eadba6e6f7182249.1423944601@s10sp1sfcb> <47284C35.2040703@linux.vnet.ibm.com> <877il3pfc6.fsf@theine.beaverton.ibm.com> <4729AA6F.3030405@linux.vnet.ibm.com> <87ejfayrai.fsf@theine.beaverton.ibm.com> <472AEAB7.8020301@linux.vnet.ibm.com> <87640kviho.fsf@theine.beaverton.ibm.com> Message-ID: <47302951.3030204@linux.vnet.ibm.com> Dan Smith wrote: > ZL> cimconfig -c -l | grep -i force > ZL> forceProviderProcesses=true > > Hmm, interesting, that's how mine is configured. > > ZL> Shall I try the threads machine? > > Sure, it might be interesting for a data point. I'll have to dig into Samething happened. Segmentation fault. > the indication signaling and see if I can reproduce and figure out > why it's doing that. -- - Zhengang From danms at us.ibm.com Wed Nov 7 15:40:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 08:40:56 -0700 Subject: [Libvirt-cim] [PATCH] Change cu_compare_ref() to be a little lighter-weight Message-ID: <926009fc62a0080bcf93.1194453656@theine> # HG changeset patch # User Dan Smith # Date 1194453648 28800 # Node ID 926009fc62a0080bcf93aaddf098b074ce71a096 # Parent 404c4803b1b542676c4d283226a7cc3b7f3ab58d Change cu_compare_ref() to be a little lighter-weight Now, we just check the keys that were provided by the client (or the CIMOM if that ever starts to happen). We will have already checked the required keys to actually do the lookup in the provider, which serves the "required" key purpose. Changes to libvirt-cim to follow shortly... Signed-off-by: Dan Smith diff -r 404c4803b1b5 -r 926009fc62a0 instance_util.c --- a/instance_util.c Fri Nov 02 15:29:38 2007 -0700 +++ b/instance_util.c Wed Nov 07 08:40:48 2007 -0800 @@ -88,38 +88,48 @@ static bool _compare_data(const CMPIData return false; } -const struct cu_property *cu_compare_ref(const CMPIObjectPath *ref, - const CMPIInstance *inst, - const struct cu_property *props) +const char *cu_compare_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst) { - const struct cu_property *p = NULL; int i; CMPIStatus s; + int count; + const char *prop = NULL; - for (i = 0; props[i].name != NULL; i++) { + count = CMGetKeyCount(ref, &s); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Unable to get key count"); + return NULL; + } + + for (i = 0; i < count; i++) { CMPIData kd, pd; + CMPIString *str; - p = &props[i]; - - kd = CMGetKey(ref, p->name, &s); + kd = CMGetKeyAt(ref, i, &str, &s); if (s.rc != CMPI_RC_OK) { - if (p->required) - goto out; - else - continue; + CU_DEBUG("Failed to get key %i", i); + goto out; } - pd = CMGetProperty(inst, p->name, &s); - if (s.rc != CMPI_RC_OK) + prop = CMGetCharPtr(str); + CU_DEBUG("Comparing key `%s'", prop); + + pd = CMGetProperty(inst, prop, &s); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Failed to get property `%s'", prop); goto out; + } - if (!_compare_data(&kd, &pd)) + if (!_compare_data(&kd, &pd)) { + CU_DEBUG("No data match for `%s'", prop); goto out; + } } - p = NULL; + prop = NULL; out: - return p; + return prop; } /* diff -r 404c4803b1b5 -r 926009fc62a0 libcmpiutil.h --- a/libcmpiutil.h Fri Nov 02 15:29:38 2007 -0700 +++ b/libcmpiutil.h Wed Nov 07 08:40:48 2007 -0800 @@ -337,26 +337,17 @@ void inst_list_free(struct inst_list *li */ int inst_list_add(struct inst_list *list, CMPIInstance *inst); -struct cu_property { - const char *name; - bool required; -}; - /** * Compare key values in a reference to properties in an instance, - * making sure they are identical. If props identifies a particular - * key as not required, then absence in the object path will not - * result in failure of this test. + * making sure they are identical. * * @param ref The ObjectPath to examine * @param inst The Instance to compare - * @param props A NULL-terminated list of properties to compare - * @returns A pointer to the property structure of the first - * non-matching property, or NULL if all match - */ -const struct cu_property *cu_compare_ref(const CMPIObjectPath *ref, - const CMPIInstance *inst, - const struct cu_property *props); + * @returns A pointer to the name of the first non-matching property, + * or NULL if all match + */ +const char *cu_compare_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst); #define DEFAULT_EIN(pn) \ static CMPIStatus pn##EnumInstanceNames(CMPIInstanceMI *self, \ From danms at us.ibm.com Wed Nov 7 15:41:50 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 08:41:50 -0700 Subject: [Libvirt-cim] [PATCH] Update CS and VSMS for compare_ref changes Message-ID: <55d37343f11204b02dde.1194453710@theine> # HG changeset patch # User Dan Smith # Date 1194453696 28800 # Node ID 55d37343f11204b02dde1df910001e8021a5afc5 # Parent 704edab17bc7ceac8a0d59285cf7bfb3c900b188 Update CS and VSMS for compare_ref changes Signed-off-by: Dan Smith diff -r 704edab17bc7 -r 55d37343f112 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Nov 05 11:12:26 2007 -0800 +++ b/src/Virt_ComputerSystem.c Wed Nov 07 08:41:36 2007 -0800 @@ -379,12 +379,7 @@ static CMPIStatus get_domain(const CMPIO CMPIInstance *inst[2] = {NULL, NULL}; CMPIStatus s; virConnectPtr conn = NULL; - const struct cu_property *prop; - static struct cu_property props[] = { - {"CreationClassName", 0}, - {"Name", 1}, - {NULL, 0} - }; + const char *prop = NULL; conn = lv_connect(_BROKER, &s); if (conn == NULL) @@ -398,11 +393,11 @@ static CMPIStatus get_domain(const CMPIO goto out; } - prop = cu_compare_ref(reference, inst[0], props); + prop = cu_compare_ref(reference, inst[0]); if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, - "No such instance (%s)", prop->name); + "No such instance (%s)", prop); goto out; } diff -r 704edab17bc7 -r 55d37343f112 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 05 11:12:26 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Wed Nov 07 08:41:36 2007 -0800 @@ -1030,24 +1030,17 @@ static CMPIStatus GetInstance(CMPIInstan { CMPIInstance *inst; CMPIStatus s; - const struct cu_property *prop; - static struct cu_property props[] = { - {"CreationClassName", 0}, - {"SystemName", 0}, - {"SystemCreationClassName", 0}, - {"Name", 1}, - {NULL, 0} - }; + const char *prop; s = _get_vsms(ref, &inst, 0); if (s.rc != CMPI_RC_OK) return s; - prop = cu_compare_ref(ref, inst, props); + prop = cu_compare_ref(ref, inst); if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, - "No such instance (%s)", prop->name); + "No such instance (%s)", prop); } else { CMSetStatus(&s, CMPI_RC_OK); CMReturnInstance(results, inst); From danms at us.ibm.com Wed Nov 7 15:54:38 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 08:54:38 -0700 Subject: [Libvirt-cim] [PATCH] Make ResourcePoolConfigurationService return errors when appropriate Message-ID: <2626820d78b2d7056409.1194454478@theine> # HG changeset patch # User Dan Smith # Date 1194454371 28800 # Node ID 2626820d78b2d70564096dcacf6a2f1b2bc726e1 # Parent 55d37343f11204b02dde1df910001e8021a5afc5 Make ResourcePoolConfigurationService return errors when appropriate and fix up some other general error-handling around the needed changes. Signed-off-by: Dan Smith diff -r 55d37343f112 -r 2626820d78b2 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Wed Nov 07 08:41:36 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationService.c Wed Nov 07 08:52:51 2007 -0800 @@ -89,7 +89,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -static CMPIInstance *rpcs_instance(const CMPIObjectPath *reference) +static CMPIStatus rpcs_instance(const CMPIObjectPath *reference, + CMPIInstance **_inst) { CMPIInstance *inst; CMPIInstance *host; @@ -98,28 +99,47 @@ static CMPIInstance *rpcs_instance(const s = get_host_cs(_BROKER, reference, &host); if (s.rc != CMPI_RC_OK) - return NULL; + goto out; inst = get_typed_instance(_BROKER, "ResourcePoolConfigurationService", NAMESPACE(reference)); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get " + "ResourcePoolConfigurationService instance"); + goto out; + } CMSetProperty(inst, "Name", (CMPIValue *)"RPCS", CMPI_chars); prop = CMGetProperty(host, "CreationClassName", &s); - if (s.rc != CMPI_RC_OK) - return NULL; + if (s.rc != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get CreationClassName from HostSystem"); + goto out; + } + CMSetProperty(inst, "SystemCreationClassName", (CMPIValue *)&prop.value.string, CMPI_string); prop = CMGetProperty(host, "Name", NULL); - if (s.rc != CMPI_RC_OK) - return NULL; + if (s.rc != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get Name from HostSystem"); + goto out; + } + CMSetProperty(inst, "SystemName", (CMPIValue *)&prop.value.string, CMPI_string); - return inst; + *_inst = inst; + out: + return s; } static CMPIStatus GetInstance(CMPIInstanceMI *self, @@ -129,12 +149,23 @@ static CMPIStatus GetInstance(CMPIInstan const char **properties) { CMPIInstance *inst; - - inst = rpcs_instance(reference); - - CMReturnInstance(results, inst); - - return (CMPIStatus){CMPI_RC_OK, NULL}; + CMPIStatus s; + const char *prop = NULL; + + s = rpcs_instance(reference, &inst); + if (s.rc != CMPI_RC_OK) + return s; + + prop = cu_compare_ref(reference, inst); + if (prop != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such instance (%s)", prop); + } else { + CMReturnInstance(results, inst); + } + + return s; } static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self, @@ -143,12 +174,13 @@ static CMPIStatus EnumInstanceNames(CMPI const CMPIObjectPath *reference) { CMPIInstance *inst; - - inst = rpcs_instance(reference); - - cu_return_instance_name(results, inst); - - return (CMPIStatus){CMPI_RC_OK, NULL}; + CMPIStatus s; + + s = rpcs_instance(reference, &inst); + if (s.rc == CMPI_RC_OK) + cu_return_instance_name(results, inst); + + return s; } static CMPIStatus EnumInstances(CMPIInstanceMI *self, @@ -159,12 +191,13 @@ static CMPIStatus EnumInstances(CMPIInst { CMPIInstance *inst; - - inst = rpcs_instance(reference); - - CMReturnInstance(results, inst); - - return (CMPIStatus){CMPI_RC_OK, NULL}; + CMPIStatus s; + + s = rpcs_instance(reference, &inst); + if (s.rc == CMPI_RC_OK) + CMReturnInstance(results, inst); + + return s; } From danms at us.ibm.com Wed Nov 7 16:02:29 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 09:02:29 -0700 Subject: [Libvirt-cim] [PATCH 4 of 5] Don't regenerate a UUID if one already exists In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1194454630 28800 # Node ID e1c63130f720d975822d7c8e3c8ed35c8e18dd15 # Parent 03b92d27d21ea95b552642326fb4c357e643f989 Don't regenerate a UUID if one already exists Signed-off-by: Dan Smith diff -r 03b92d27d21e -r e1c63130f720 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Wed Nov 07 08:57:05 2007 -0800 +++ b/libxkutil/xmlgen.c Wed Nov 07 08:57:10 2007 -0800 @@ -317,8 +317,14 @@ char *system_to_xml(struct domain *domin uint8_t uuid[16]; char uuidstr[37]; - uuid_generate(uuid); - uuid_unparse(uuid, uuidstr); + if (dominfo->uuid) { + strcpy(uuidstr, dominfo->uuid); + CU_DEBUG("Using existing UUID: %s"); + } else { + CU_DEBUG("New UUID"); + uuid_generate(uuid); + uuid_unparse(uuid, uuidstr); + } concat_devxml(&devxml, dominfo->dev_net, dominfo->dev_net_ct); concat_devxml(&devxml, dominfo->dev_disk, dominfo->dev_disk_ct); From danms at us.ibm.com Wed Nov 7 16:02:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 09:02:26 -0700 Subject: [Libvirt-cim] [PATCH 1 of 5] Add device attach/detach support to device_parsing In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1194454604 28800 # Node ID b9eaad2ace9b71f7c6cb9feb3b6ea630050e3e0f # Parent 2626820d78b2d70564096dcacf6a2f1b2bc726e1 Add device attach/detach support to device_parsing Signed-off-by: Dan Smith diff -r 2626820d78b2 -r b9eaad2ace9b libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Wed Nov 07 08:52:51 2007 -0800 +++ b/libxkutil/device_parsing.c Wed Nov 07 08:56:44 2007 -0800 @@ -31,6 +31,7 @@ #include #include "device_parsing.h" +#include "xmlgen.h" #include "../src/svpc_types.h" #define DISK_XPATH (xmlChar *)"/domain/devices/disk" @@ -614,6 +615,60 @@ void cleanup_dominfo(struct domain **dom *dominfo = NULL; } +static int change_device(virDomainPtr dom, + struct virt_device *dev, + bool attach) +{ + char *xml = NULL; + int ret = 0; + int (*func)(virDomainPtr, char *); + + if (attach) + func = virDomainAttachDevice; + else + func = virDomainDetachDevice; + + xml = device_to_xml(dev); + if (xml == NULL) { + CU_DEBUG("Failed to get XML for device `%s'", dev->id); + goto out; + } + + if (func(dom, xml) != 0) { + CU_DEBUG("Failed to dynamically change device:"); + CU_DEBUG("%s", xml); + goto out; + } + + ret = 1; + out: + free(xml); + + return ret; + +} + +int attach_device(virDomainPtr dom, struct virt_device *dev) +{ + if ((dev->type == VIRT_DEV_NET) || + (dev->type == VIRT_DEV_DISK)) + return change_device(dom, dev, true); + + CU_DEBUG("Unhandled device type %i", dev->type); + + return 0; +} + +int detach_device(virDomainPtr dom, struct virt_device *dev) +{ + if ((dev->type == VIRT_DEV_NET) || + (dev->type == VIRT_DEV_DISK)) + return change_device(dom, dev, false); + + CU_DEBUG("Unhandled device type %i", dev->type); + + return 0; +} /* * Local Variables: diff -r 2626820d78b2 -r b9eaad2ace9b libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Wed Nov 07 08:52:51 2007 -0800 +++ b/libxkutil/device_parsing.h Wed Nov 07 08:56:44 2007 -0800 @@ -111,6 +111,9 @@ char *get_fq_devid(char *host, char *_de char *get_fq_devid(char *host, char *_devid); int parse_fq_devid(char *devid, char **host, char **device); +int attach_device(virDomainPtr dom, struct virt_device *dev); +int detach_device(virDomainPtr dom, struct virt_device *dev); + #endif /* diff -r 2626820d78b2 -r b9eaad2ace9b libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Wed Nov 07 08:52:51 2007 -0800 +++ b/libxkutil/xmlgen.c Wed Nov 07 08:56:44 2007 -0800 @@ -192,7 +192,7 @@ static char *mem_to_xml(struct mem_devic return xml; } -static char *device_to_xml(struct virt_device *dev) +char *device_to_xml(struct virt_device *dev) { switch (dev->type) { case VIRT_DEV_NET: diff -r 2626820d78b2 -r b9eaad2ace9b libxkutil/xmlgen.h --- a/libxkutil/xmlgen.h Wed Nov 07 08:52:51 2007 -0800 +++ b/libxkutil/xmlgen.h Wed Nov 07 08:56:44 2007 -0800 @@ -31,5 +31,6 @@ struct kv { }; char *system_to_xml(struct domain *dominfo); +char *device_to_xml(struct virt_device *dev); #endif From danms at us.ibm.com Wed Nov 7 16:02:27 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 09:02:27 -0700 Subject: [Libvirt-cim] [PATCH 2 of 5] Add domain_online() helper function In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1194454618 28800 # Node ID e7bab3523bd443fe7aaeaf30a7cc97bb312e988d # Parent b9eaad2ace9b71f7c6cb9feb3b6ea630050e3e0f Add domain_online() helper function to return true if a domain is running or blocked. Signed-off-by: Dan Smith diff -r b9eaad2ace9b -r e7bab3523bd4 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Nov 07 08:56:44 2007 -0800 +++ b/libxkutil/misc_util.c Wed Nov 07 08:56:58 2007 -0800 @@ -360,6 +360,17 @@ bool provider_is_responsible(const CMPIB return rc; } +bool domain_online(virDomainPtr dom) +{ + virDomainInfo info; + + if (virDomainGetInfo(dom, &info) != 0) + return false; + + return (info.state == VIR_DOMAIN_BLOCKED) || + (info.state == VIR_DOMAIN_RUNNING); +} + /* * Local Variables: diff -r b9eaad2ace9b -r e7bab3523bd4 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Nov 07 08:56:44 2007 -0800 +++ b/libxkutil/misc_util.h Wed Nov 07 08:56:58 2007 -0800 @@ -82,6 +82,7 @@ char *get_key_from_ref_arg(const CMPIArg char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key); bool domain_exists(virConnectPtr conn, const char *name); +bool domain_online(virDomainPtr dom); uint64_t allocated_memory(virConnectPtr conn); From danms at us.ibm.com Wed Nov 7 16:02:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 09:02:25 -0700 Subject: [Libvirt-cim] [PATCH 0 of 5] VSMS Dynamic Devices Message-ID: This set adds dynamic attach/detach support to device_parsing, as well as some other tweaks necessary for the changes to VSMS to work. This makes VSMS dynamically attach/detach devices if the domain is running. Currently this only works for Network and Disk devices, but adding processor and memory support in the attach functions should be easy. From danms at us.ibm.com Wed Nov 7 16:02:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 09:02:30 -0700 Subject: [Libvirt-cim] [PATCH 5 of 5] Make VSMS call the appropriate dynamic device functions In-Reply-To: Message-ID: <92ed39296eb881deddc2.1194454950@theine> # HG changeset patch # User Dan Smith # Date 1194454866 28800 # Node ID 92ed39296eb881deddc2d34fa9ee0524aefc1a53 # Parent e1c63130f720d975822d7c8e3c8ed35c8e18dd15 Make VSMS call the appropriate dynamic device functions Signed-off-by: Dan Smith diff -r e1c63130f720 -r 92ed39296eb8 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Nov 07 08:57:10 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Wed Nov 07 09:01:06 2007 -0800 @@ -563,6 +563,59 @@ static struct virt_device **find_list(st return list; } +static CMPIStatus _resource_dynamic(struct domain *dominfo, + struct virt_device *dev, + bool attach) +{ + CMPIStatus s; + virConnectPtr conn; + virDomainPtr dom; + int (*func)(virDomainPtr, struct virt_device *); + + if (attach) + func = attach_device; + else + func = detach_device; + + conn = lv_connect(_BROKER, &s); + if (conn == NULL) { + CU_DEBUG("Failed to connect"); + return s; + } + + dom = virDomainLookupByName(conn, dominfo->name); + if (dom == NULL) { + CU_DEBUG("Failed to lookup VS `%s'", dominfo->name); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "Virtual System `%s' not found", dominfo->name); + goto out; + } + + if (!domain_online(dom)) { + CU_DEBUG("VS `%s' not online; skipping dynamic update", + dominfo->name); + CMSetStatus(&s, CMPI_RC_OK); + goto out; + } + + CU_DEBUG("Doing dynamic device update for `%s'", dominfo->name); + + if (func(dom, dev) == 0) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to %s device", + attach ? "attach" : "detach"); + } else { + CMSetStatus(&s, CMPI_RC_OK); + } + out: + virDomainFree(dom); + virConnectClose(conn); + + return s; +} + static CMPIStatus resource_del(struct domain *dominfo, CMPIInstance *rasd, uint16_t type, @@ -593,8 +646,8 @@ static CMPIStatus resource_del(struct do struct virt_device *dev = &list[i]; if (STREQ(dev->id, devid)) { + s = _resource_dynamic(dominfo, dev, false); dev->type = VIRT_DEV_UNKNOWN; - CMSetStatus(&s, CMPI_RC_OK); break; } } @@ -611,6 +664,7 @@ static CMPIStatus resource_add(struct do CMPIStatus s; struct virt_device **_list; struct virt_device *list; + struct virt_device *dev; int *count; _list = find_list(dominfo, type, &count); @@ -643,12 +697,19 @@ static CMPIStatus resource_add(struct do *_list = list; memset(&list[*count], 0, sizeof(list[*count])); - list[*count].type = type; - list[*count].id = strdup(devid); - rasd_to_vdev(rasd, &list[*count]); + dev = &list[*count]; + + dev->type = type; + dev->id = strdup(devid); + rasd_to_vdev(rasd, dev); + + s = _resource_dynamic(dominfo, dev, true); + if (s.rc != CMPI_RC_OK) + goto out; + + CMSetStatus(&s, CMPI_RC_OK); (*count)++; - CMSetStatus(&s, CMPI_RC_OK); out: return s; } @@ -728,6 +789,10 @@ static CMPIStatus _update_resources_for( } s = func(dominfo, rasd, type, devid); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Resource transform function failed"); + goto out; + } xml = system_to_xml(dominfo); if (xml != NULL) { From danms at us.ibm.com Wed Nov 7 16:02:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 09:02:28 -0700 Subject: [Libvirt-cim] [PATCH 3 of 5] Remove ":disk" from target device in disk XML In-Reply-To: Message-ID: <03b92d27d21ea95b5526.1194454948@theine> # HG changeset patch # User Dan Smith # Date 1194454625 28800 # Node ID 03b92d27d21ea95b552642326fb4c357e643f989 # Parent e7bab3523bd443fe7aaeaf30a7cc97bb312e988d Remove ":disk" from target device in disk XML as it doesn't seem to be necessary for regular disk devices, and it causes virDetachDevice() to fail. Signed-off-by: Dan Smith diff -r e7bab3523bd4 -r 03b92d27d21e libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Wed Nov 07 08:56:58 2007 -0800 +++ b/libxkutil/xmlgen.c Wed Nov 07 08:57:05 2007 -0800 @@ -103,7 +103,7 @@ static char *disk_block_xml(const char * "\n" " \n" " \n" - " \n" + " \n" "\n", path, vdev); @@ -122,7 +122,7 @@ static char *disk_file_xml(const char *p "\n" " \n" " \n" - " \n" + " \n" "\n", path, vdev); From kaitlin at linux.vnet.ibm.com Wed Nov 7 17:44:08 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 07 Nov 2007 09:44:08 -0800 Subject: [Libvirt-cim] [PATCH] Change cu_compare_ref() to be a little lighter-weight In-Reply-To: <926009fc62a0080bcf93.1194453656@theine> References: <926009fc62a0080bcf93.1194453656@theine> Message-ID: <4731F968.8090003@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194453648 28800 > # Node ID 926009fc62a0080bcf93aaddf098b074ce71a096 > # Parent 404c4803b1b542676c4d283226a7cc3b7f3ab58d > Change cu_compare_ref() to be a little lighter-weight > Now, we just check the keys that were provided by the client (or the CIMOM > if that ever starts to happen). We will have already checked the required > keys to actually do the lookup in the provider, which serves the "required" > key purpose. Changes to libvirt-cim to follow shortly... > > Signed-off-by: Dan Smith > I think this is a good compromise - looks good. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 7 19:42:25 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 07 Nov 2007 11:42:25 -0800 Subject: [Libvirt-cim] [PATCH] Make ResourcePoolConfigurationService return errors when appropriate In-Reply-To: <2626820d78b2d7056409.1194454478@theine> References: <2626820d78b2d7056409.1194454478@theine> Message-ID: <47321521.2050902@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194454371 28800 > # Node ID 2626820d78b2d70564096dcacf6a2f1b2bc726e1 > # Parent 55d37343f11204b02dde1df910001e8021a5afc5 > Make ResourcePoolConfigurationService return errors when appropriate > and fix up some other general error-handling around the needed changes. > > Signed-off-by: Dan Smith > Corresponds to the cu_compare_ref() changes. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 7 19:39:53 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 07 Nov 2007 11:39:53 -0800 Subject: [Libvirt-cim] [PATCH] Update CS and VSMS for compare_ref changes In-Reply-To: <55d37343f11204b02dde.1194453710@theine> References: <55d37343f11204b02dde.1194453710@theine> Message-ID: <47321489.9090307@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194453696 28800 > # Node ID 55d37343f11204b02dde1df910001e8021a5afc5 > # Parent 704edab17bc7ceac8a0d59285cf7bfb3c900b188 > Update CS and VSMS for compare_ref changes > > Signed-off-by: Dan Smith > > - prop = cu_compare_ref(ref, inst, props); > + prop = cu_compare_ref(ref, inst); > if (prop != NULL) { > cu_statusf(_BROKER, &s, > CMPI_RC_ERR_NOT_FOUND, > - "No such instance (%s)", prop->name); > + "No such instance (%s)", prop); > } else { > CMSetStatus(&s, CMPI_RC_OK); > CMReturnInstance(results, inst); > > I realized I already ack'ed the cu_compare_ref(), but here I realized that you're returning prop from cu_compare_ref(). prop is only meaningful when it's NULL - that is, in the case of an error. Otherwise, you're just returning the last prop in the list. Would a status value be more useful? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Wed Nov 7 20:41:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 12:41:58 -0800 Subject: [Libvirt-cim] [PATCH] Update CS and VSMS for compare_ref changes In-Reply-To: <47321489.9090307@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 07 Nov 2007 11:39:53 -0800") References: <55d37343f11204b02dde.1194453710@theine> <47321489.9090307@linux.vnet.ibm.com> Message-ID: <87lk99u6sp.fsf@theine.beaverton.ibm.com> KR> I realized I already ack'ed the cu_compare_ref(), but here I KR> realized that you're returning prop from cu_compare_ref(). prop KR> is only meaningful when it's NULL - that is, in the case of an KR> error. Otherwise, you're just returning the last prop in the KR> list. Would a status value be more useful? No, we're returning the first property name that failed the test, NULL if they all passed. This, as in the case of this patch, lets the provider do what it wishes for reporting. Right now, I put that in the status message we send back to the client. I want a rich error message potential without having to pass a broker pointer around, which is why I did it this way. If you use this function to compare a reference to an instance for something other than a GetInstance scenario, you might be interested in just the name of the property that failed, and not just a CMPIStatus you could return to the client. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Nov 7 21:37:51 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 07 Nov 2007 13:37:51 -0800 Subject: [Libvirt-cim] [PATCH] Add association results filtering Message-ID: <5959f8f0e5e87540fb7d.1194471471@kyon> # HG changeset patch # User Kaitlin Rupert # Date 1194471308 28800 # Node ID 5959f8f0e5e87540fb7da0bc5a0365388112452b # Parent 404c4803b1b542676c4d283226a7cc3b7f3ab58d Add association results filtering. This adds result filtering so that an association only returns instances that match the result class specified during the query. Such an example is the following: HostedService needs to return VSMS and RPCS instances when queried using CIM_ManagedElement as the result class. However, if CIM_VSMS is specified as the result class, then only the VSMS instance needs to be returned. Signed-off-by: Kaitlin Rupert diff -r 404c4803b1b5 -r 5959f8f0e5e8 std_association.c --- a/std_association.c Fri Nov 02 15:29:38 2007 -0700 +++ b/std_association.c Wed Nov 07 13:35:08 2007 -0800 @@ -47,6 +47,17 @@ void set_reference(struct std_assoc *ass (CMPIValue *)&target, CMPI_ref); } +static bool match_op(const CMPIBroker *broker, + CMPIObjectPath *op, + const char *filter_class) +{ + if ((filter_class == NULL) || + CMClassPathIsA(broker, op, filter_class, NULL)) + return true; + else + return false; +} + static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, @@ -58,10 +69,55 @@ static bool match_class(const CMPIBroker if ((test_class == NULL) || (comp_class == NULL) || - CMClassPathIsA(broker, rop, comp_class, NULL)) + match_op(broker, rop, comp_class)) return true; else return false; +} + +static CMPIStatus filter_results(struct inst_list *list, + char *ns, + const char *filter_class, + const CMPIBroker *broker) +{ + struct inst_list result_list; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *op; + int i, c = 0; + + inst_list_init(&result_list); + + for (i = 0; list->list[i] != NULL; i++) { + op = CMGetObjectPath(list->list[i], &s); + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) + goto out; + + s = CMSetNameSpace(op, ns); + if (s.rc != CMPI_RC_OK) + goto out; + + if (!match_op(broker, op, filter_class)) + continue; + + inst_list_add(&result_list, list->list[i]); + c++; + } + + inst_list_free(list); + if (list->list != NULL) { + CU_DEBUG("\tinst_list_free failed.\n"); + goto out; + } + + inst_list_init(list); + + for (i = 0; i <= c; i++) + inst_list_add(list, result_list.list[i]); + +out: + inst_list_free(&result_list); + + return s; } static struct std_assoc * @@ -142,6 +198,20 @@ static CMPIStatus do_assoc(struct std_as goto out; } else { CU_DEBUG("\thandler returned CMPI_RC_OK.\n"); + } + + if (list.list == NULL) { + CU_DEBUG("\tlist is empty.\n"); + goto out; + } + + s = filter_results(&list, + NAMESPACE(ref), + info->result_class, + ctx->brkr); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("\tfilter_results did not return CMPI_RC_OK.\n"); + goto out; } if (list.list == NULL) { From kaitlin at linux.vnet.ibm.com Thu Nov 8 01:38:14 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 07 Nov 2007 17:38:14 -0800 Subject: [Libvirt-cim] [PATCH 4 of 5] Don't regenerate a UUID if one already exists In-Reply-To: References: Message-ID: <47326886.4060300@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194454630 28800 > # Node ID e1c63130f720d975822d7c8e3c8ed35c8e18dd15 > # Parent 03b92d27d21ea95b552642326fb4c357e643f989 > Don't regenerate a UUID if one already exists > > Signed-off-by: Dan Smith > Seems reasonable to me. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Thu Nov 8 02:04:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 19:04:58 -0700 Subject: [Libvirt-cim] [PATCH] Fix stdi_trigger_indication for Pegasus Message-ID: # HG changeset patch # User Dan Smith # Date 1194491086 28800 # Node ID c84928927faf099a7de17ee15321ad7f2574e979 # Parent 926009fc62a0080bcf93aaddf098b074ce71a096 Fix stdi_trigger_indication for Pegasus This fixes (for me) the DefineSystem crash on Pegasus. Signed-off-by: Dan Smith diff -r 926009fc62a0 -r c84928927faf std_indication.c --- a/std_indication.c Wed Nov 07 08:40:48 2007 -0800 +++ b/std_indication.c Wed Nov 07 19:04:46 2007 -0800 @@ -92,10 +92,30 @@ CMPIStatus stdi_trigger_indication(const CMPIObjectPath *op; CMPIStatus s; const char *method = "TriggerIndications"; + CMPIArgs *in; + CMPIArgs *out; + + in = CMNewArgs(broker, &s); + if (s.rc != CMPI_RC_OK) + return s; + + out = CMNewArgs(broker, &s); + if (s.rc != CMPI_RC_OK) + return s; op = CMNewObjectPath(broker, ns, type, &s); - CBInvokeMethod(broker, context, op, method, NULL, NULL, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) { + CU_DEBUG("Unable to create path for indication %s", + type); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to create path for indication %s", + type); + goto out; + } + CBInvokeMethod(broker, context, op, method, in, out, &s); + out: return s; } @@ -108,21 +128,26 @@ CMPIStatus stdi_raise_indication(const C CMPIObjectPath *op; CMPIStatus s; const char *method = "RaiseIndication"; - CMPIArgs *args; + CMPIArgs *argsin; + CMPIArgs *argsout; op = CMNewObjectPath(broker, ns, type, &s); if (s.rc != CMPI_RC_OK) return s; - args = CMNewArgs(broker, &s); + argsin = CMNewArgs(broker, &s); if (s.rc != CMPI_RC_OK) return s; - s = CMAddArg(args, "Indication", &ind, CMPI_instance); + argsout = CMNewArgs(broker, &s); if (s.rc != CMPI_RC_OK) return s; - CBInvokeMethod(broker, context, op, method, args, NULL, &s); + s = CMAddArg(argsin, "Indication", &ind, CMPI_instance); + if (s.rc != CMPI_RC_OK) + return s; + + CBInvokeMethod(broker, context, op, method, argsin, argsout, &s); return s; } From danms at us.ibm.com Thu Nov 8 03:26:16 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 19:26:16 -0800 Subject: [Libvirt-cim] [PATCH] Add association results filtering In-Reply-To: <5959f8f0e5e87540fb7d.1194471471@kyon> (Kaitlin Rupert's message of "Wed, 07 Nov 2007 13:37:51 -0800") References: <5959f8f0e5e87540fb7d.1194471471@kyon> Message-ID: <87pryla04n.fsf@theine.beaverton.ibm.com> KR> This adds result filtering so that an association only returns KR> instances that match the result class specified during the KR> query. Such an example is the following: I think this is a good idea. It allows our association handlers to ignore the result class (if so desired) knowing that std_association will do the result class filtering before returning to the client. Handlers could also look at the result_class field in std_assoc_info to optimize if desired or necessary. KR> + inst_list_init(&result_list); KR> + KR> + for (i = 0; list->list[i] != NULL; i++) { KR> + op = CMGetObjectPath(list->list[i], &s); KR> + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) KR> + goto out; KR> + KR> + s = CMSetNameSpace(op, ns); KR> + if (s.rc != CMPI_RC_OK) KR> + goto out; KR> + KR> + if (!match_op(broker, op, filter_class)) KR> + continue; KR> + KR> + inst_list_add(&result_list, list->list[i]); KR> + c++; KR> + } KR> + KR> + inst_list_free(list); KR> + if (list->list != NULL) { KR> + CU_DEBUG("\tinst_list_free failed.\n"); KR> + goto out; KR> + } KR> + KR> + inst_list_init(list); KR> + KR> + for (i = 0; i <= c; i++) KR> + inst_list_add(list, result_list.list[i]); Instead of filling another list, and then copying it back, why not just make a copy of the incoming list and then copy matching instances back to the original? Something like this: struct inst_list tmp_list; tmp_list = *list; inst_list_init(list); for (items in tmp_list) { if (item is resultclass) inst_list_add(list, item); } inst_list_free(tmp_list); That should work, and only copy the needed instance pointers once, instead of running through the list twice. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 8 02:32:40 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 07 Nov 2007 19:32:40 -0700 Subject: [Libvirt-cim] [PATCH] Fix some really horrible cruft in ComputerSystem Message-ID: # HG changeset patch # User Dan Smith # Date 1194492744 28800 # Node ID af241b38b17ee4b3f2c2ee94f41aafd3023240d7 # Parent 92ed39296eb881deddc2d34fa9ee0524aefc1a53 Fix some really horrible cruft in ComputerSystem Signed-off-by: Dan Smith diff -r 92ed39296eb8 -r af241b38b17e src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Nov 07 09:01:06 2007 -0800 +++ b/src/Virt_ComputerSystem.c Wed Nov 07 19:32:24 2007 -0800 @@ -376,7 +376,7 @@ static CMPIStatus get_domain(const CMPIO const CMPIResult *results, char *name) { - CMPIInstance *inst[2] = {NULL, NULL}; + CMPIInstance *inst; CMPIStatus s; virConnectPtr conn = NULL; const char *prop = NULL; @@ -385,15 +385,15 @@ static CMPIStatus get_domain(const CMPIO if (conn == NULL) return s; - inst[0] = instance_from_name(_BROKER, conn, name, reference); - if (inst[0] == NULL) { + inst = instance_from_name(_BROKER, conn, name, reference); + if (inst == NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unable to find `%s'", name); goto out; } - prop = cu_compare_ref(reference, inst[0]); + prop = cu_compare_ref(reference, inst); if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, @@ -401,10 +401,8 @@ static CMPIStatus get_domain(const CMPIO goto out; } - cu_return_instances(results, inst); - + CMReturnInstance(results, inst); CMSetStatus(&s, CMPI_RC_OK); - out: virConnectClose(conn); From grendel at linux.vnet.ibm.com Thu Nov 8 15:45:22 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 10:45:22 -0500 Subject: [Libvirt-cim] [PATCH 0 of 5] VSMS Dynamic Devices In-Reply-To: References: Message-ID: <47332F12.8030700@linux.vnet.ibm.com> Dan Smith wrote: > This set adds dynamic attach/detach support to device_parsing, as well > as some other tweaks necessary for the changes to VSMS to work. This > makes VSMS dynamically attach/detach devices if the domain is running. > Currently this only works for Network and Disk devices, but adding > processor and memory support in the attach functions should be easy. > > This series looks good. When I first read this description I figured I should settle down for some serious reading, so I suppose it says some good things about the design that all of these patches were relatively simple and small. Well done. +1 -- -Jay From kaitlin at linux.vnet.ibm.com Thu Nov 8 17:54:23 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 09:54:23 -0800 Subject: [Libvirt-cim] [PATCH 0 of 5] VSMS Dynamic Devices In-Reply-To: References: Message-ID: <47334D4F.3000006@linux.vnet.ibm.com> Dan Smith wrote: > This set adds dynamic attach/detach support to device_parsing, as well > as some other tweaks necessary for the changes to VSMS to work. This > makes VSMS dynamically attach/detach devices if the domain is running. > Currently this only works for Network and Disk devices, but adding > processor and memory support in the attach functions should be easy. > No additional comments from me. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 8 18:18:09 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 10:18:09 -0800 Subject: [Libvirt-cim] [PATCH] Fix stdi_trigger_indication for Pegasus In-Reply-To: References: Message-ID: <473352E1.20906@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194491086 28800 > # Node ID c84928927faf099a7de17ee15321ad7f2574e979 > # Parent 926009fc62a0080bcf93aaddf098b074ce71a096 > Fix stdi_trigger_indication for Pegasus > > This fixes (for me) the DefineSystem crash on Pegasus. > > Signed-off-by: Dan Smith > Pegasus doesn't handle the null arguments - nice catch. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 8 18:22:19 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 10:22:19 -0800 Subject: [Libvirt-cim] [PATCH] Fix some really horrible cruft in ComputerSystem In-Reply-To: References: Message-ID: <473353DB.7050204@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194492744 28800 > # Node ID af241b38b17ee4b3f2c2ee94f41aafd3023240d7 > # Parent 92ed39296eb881deddc2d34fa9ee0524aefc1a53 > Fix some really horrible cruft in ComputerSystem > > Signed-off-by: Dan Smith > Much cleaner. =) +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 8 18:36:01 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 10:36:01 -0800 Subject: [Libvirt-cim] [PATCH] Add association results filtering Message-ID: <66548720dc50f268b861.1194546961@kyon> # HG changeset patch # User Kaitlin Rupert # Date 1194546376 28800 # Node ID 66548720dc50f268b861d336ac295003a9a03ec9 # Parent 404c4803b1b542676c4d283226a7cc3b7f3ab58d Add association results filtering. This adds result filtering so that an association only returns instances that match the result class specified during the query. Such an example is the following: HostedService needs to return VSMS and RPCS instances when queried using CIM_ManagedElement as the result class. However, if CIM_VSMS is specified as the result class, then only the VSMS instance needs to be returned. Signed-off-by: Kaitlin Rupert diff -r 404c4803b1b5 -r 66548720dc50 std_association.c --- a/std_association.c Fri Nov 02 15:29:38 2007 -0700 +++ b/std_association.c Thu Nov 08 10:26:16 2007 -0800 @@ -47,6 +47,17 @@ void set_reference(struct std_assoc *ass (CMPIValue *)&target, CMPI_ref); } +static bool match_op(const CMPIBroker *broker, + CMPIObjectPath *op, + const char *filter_class) +{ + if ((filter_class == NULL) || + CMClassPathIsA(broker, op, filter_class, NULL)) + return true; + else + return false; +} + static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, @@ -58,10 +69,44 @@ static bool match_class(const CMPIBroker if ((test_class == NULL) || (comp_class == NULL) || - CMClassPathIsA(broker, rop, comp_class, NULL)) + match_op(broker, rop, comp_class)) return true; else return false; +} + +static CMPIStatus filter_results(struct inst_list *list, + char *ns, + const char *filter_class, + const CMPIBroker *broker) +{ + struct inst_list result_list; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *op; + int i; + + result_list = *list; + inst_list_init(list); + + for (i = 0; result_list.list[i] != NULL; i++) { + op = CMGetObjectPath(result_list.list[i], &s); + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) + goto out; + + s = CMSetNameSpace(op, ns); + if (s.rc != CMPI_RC_OK) + goto out; + + if (!match_op(broker, op, filter_class)) + continue; + + inst_list_add(list, result_list.list[i]); + } + +out: + inst_list_free(&result_list); + + return s; } static struct std_assoc * @@ -142,6 +187,20 @@ static CMPIStatus do_assoc(struct std_as goto out; } else { CU_DEBUG("\thandler returned CMPI_RC_OK.\n"); + } + + if (list.list == NULL) { + CU_DEBUG("\tlist is empty.\n"); + goto out; + } + + s = filter_results(&list, + NAMESPACE(ref), + info->result_class, + ctx->brkr); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("\tfilter_results did not return CMPI_RC_OK.\n"); + goto out; } if (list.list == NULL) { From danms at us.ibm.com Thu Nov 8 17:50:42 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 10:50:42 -0700 Subject: [Libvirt-cim] [PATCH] Fix device pool list to include Disk and Network Message-ID: # HG changeset patch # User Dan Smith # Date 1194547428 28800 # Node ID bd1b1067d106ecc1546c3b2436a43f59f8eaba15 # Parent 0dddeb4368b37821390aa7c56fdcca2db839e824 Fix device pool list to include Disk and Network This makes HostedResourcePool return all four pools instead of just Memory and Processor pools. Signed-off-by: Dan Smith diff -r 0dddeb4368b3 -r bd1b1067d106 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Thu Nov 08 09:56:43 2007 -0800 +++ b/src/Virt_DevicePool.c Thu Nov 08 10:43:48 2007 -0800 @@ -45,7 +45,11 @@ static const CMPIBroker *_BROKER; -char *device_pool_names[] = {"ProcessorPool", "MemoryPool", NULL}; +char *device_pool_names[] = {"ProcessorPool", + "MemoryPool", + "DiskPool", + "NetworkPool", + NULL}; struct disk_pool { char *tag; From grendel at linux.vnet.ibm.com Thu Nov 8 19:00:19 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 14:00:19 -0500 Subject: [Libvirt-cim] [PATCH] Fix device pool list to include Disk and Network In-Reply-To: References: Message-ID: <47335CC3.1050809@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194547428 28800 > # Node ID bd1b1067d106ecc1546c3b2436a43f59f8eaba15 > # Parent 0dddeb4368b37821390aa7c56fdcca2db839e824 > Fix device pool list to include Disk and Network > This makes HostedResourcePool return all four pools instead of > just Memory and Processor pools. > > Signed-off-by: Dan Smith > > > Good stuff. Now I'll be able to get all the information I need for SettingsDefineCapabilities. +1 -- -Jay From kaitlin at linux.vnet.ibm.com Thu Nov 8 18:28:48 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 10:28:48 -0800 Subject: [Libvirt-cim] [PATCH] Add association results filtering In-Reply-To: <87pryla04n.fsf@theine.beaverton.ibm.com> References: <5959f8f0e5e87540fb7d.1194471471@kyon> <87pryla04n.fsf@theine.beaverton.ibm.com> Message-ID: <47335560.4080308@linux.vnet.ibm.com> Dan Smith wrote: > Instead of filling another list, and then copying it back, why not > just make a copy of the incoming list and then copy matching instances > back to the original? Something like this: > > struct inst_list tmp_list; > > tmp_list = *list; > inst_list_init(list); > > for (items in tmp_list) { > if (item is resultclass) > inst_list_add(list, item); > } > > inst_list_free(tmp_list); > > That should work, and only copy the needed instance pointers once, > instead of running through the list twice. > Excellent suggestion! Thanks, this works. Will generate another patch. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Thu Nov 8 18:04:52 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 11:04:52 -0700 Subject: [Libvirt-cim] [PATCH] Make HostedResourcePool a little more discerning Message-ID: <4c736ba430524c00804b.1194548692@theine> # HG changeset patch # User Dan Smith # Date 1194548690 28800 # Node ID 4c736ba430524c00804b710b923ea0030808a893 # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 Make HostedResourcePool a little more discerning Use cu_compare_ref() to make sure the client specified the actual HostSystem instance and not a random CIM_System Signed-off-by: Dan Smith diff -r bd1b1067d106 -r 4c736ba43052 src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Thu Nov 08 10:43:48 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Thu Nov 08 11:04:50 2007 -0800 @@ -60,6 +60,21 @@ static CMPIStatus sys_to_pool(const CMPI CMPIStatus s; int i; virConnectPtr conn; + CMPIInstance *host; + const char *prop; + + s = get_host_cs(_BROKER, ref, &host); + if (s.rc != CMPI_RC_OK) + return s; + + prop = cu_compare_ref(ref, host); + if (prop != NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_NOT_FOUND, + "No such HostSystem instance (%s)", + prop); + return s; + } conn = lv_connect(_BROKER, &s); if (conn == NULL) From danms at us.ibm.com Thu Nov 8 18:13:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 11:13:20 -0700 Subject: [Libvirt-cim] [PATCH] Make cu_compare_ref() also compare the actual classname of the ref and inst Message-ID: # HG changeset patch # User Dan Smith # Date 1194548973 28800 # Node ID a55a0f630c034ac5ed76211b8459ae1e4fdc56ae # Parent 41c761dba6a6268da6fdb9a89c1cc6f959870aac Make cu_compare_ref() also compare the actual classname of the ref and inst ...and change STREQ to STREQC, per Heidi's suggestion. Signed-off-by: Dan Smith diff -r 41c761dba6a6 -r a55a0f630c03 instance_util.c --- a/instance_util.c Thu Nov 08 10:28:41 2007 -0800 +++ b/instance_util.c Thu Nov 08 11:09:33 2007 -0800 @@ -78,7 +78,7 @@ static bool _compare_data(const CMPIData const char *as = CMGetCharPtr(a->value.string); const char *bs = CMGetCharPtr(b->value.string); - return STREQ(as, bs); + return STREQC(as, bs); } else if (a->type & CMPI_INTEGER) { return memcmp(&a->value, &b->value, sizeof(a->value)) == 0; } @@ -86,6 +86,29 @@ static bool _compare_data(const CMPIData CU_DEBUG("Unhandled CMPI type: `%i'", a->type); return false; +} + +static bool _compare_classname(const CMPIObjectPath *ref, + const CMPIInstance *inst) +{ + const char *ref_cn; + const char *inst_cn; + CMPIObjectPath *op; + CMPIStatus s; + + op = CMGetObjectPath(inst, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) + return false; + + ref_cn = CLASSNAME(ref); + if (ref_cn == NULL) + return false; + + inst_cn = CLASSNAME(op); + if (inst_cn == NULL) + return false; + + return STREQC(inst_cn, ref_cn); } const char *cu_compare_ref(const CMPIObjectPath *ref, @@ -101,6 +124,9 @@ const char *cu_compare_ref(const CMPIObj CU_DEBUG("Unable to get key count"); return NULL; } + + if (!_compare_classname(ref, inst)) + return "CreationClassName"; for (i = 0; i < count; i++) { CMPIData kd, pd; From danms at us.ibm.com Thu Nov 8 19:21:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 11:21:25 -0800 Subject: [Libvirt-cim] [PATCH] Add association results filtering In-Reply-To: <66548720dc50f268b861.1194546961@kyon> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 10:36:01 -0800") References: <66548720dc50f268b861.1194546961@kyon> Message-ID: <87wssszgp6.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1194546376 28800 KR> # Node ID 66548720dc50f268b861d336ac295003a9a03ec9 KR> # Parent 404c4803b1b542676c4d283226a7cc3b7f3ab58d KR> Add association results filtering. Thanks! I tested this with HostedResourcePool, since I had it handy. Now, I can specify a result class of just, say, DiskPool and it filters appropriately. Very cool. KR> + result_list = *list; KR> + inst_list_init(list); KR> + KR> + for (i = 0; result_list.list[i] != NULL; i++) { KR> + op = CMGetObjectPath(result_list.list[i], &s); KR> + if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) KR> + goto out; KR> + KR> + s = CMSetNameSpace(op, ns); KR> + if (s.rc != CMPI_RC_OK) KR> + goto out; KR> + KR> + if (!match_op(broker, op, filter_class)) KR> + continue; KR> + KR> + inst_list_add(list, result_list.list[i]); KR> + } KR> + KR> +out: KR> + inst_list_free(&result_list); I think it's a little weird to call your temporary list "result_list" and then free it before you return. Might be a little confusing to someone reading your code without the context of this being a revision on a previous version :) I'll apply this, but I think it would be nice to get a little follow-on patch to clean up the naming at some point :-D -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 8 19:25:05 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 11:25:05 -0800 Subject: [Libvirt-cim] [PATCH] Make cu_compare_ref() also compare the actual classname of the ref and inst In-Reply-To: (Dan Smith's message of "Thu, 08 Nov 2007 11:13:20 -0700") References: Message-ID: <87sl3gzgj2.fsf@theine.beaverton.ibm.com> DS> # HG changeset patch DS> # User Dan Smith DS> # Date 1194548973 28800 DS> # Node ID a55a0f630c034ac5ed76211b8459ae1e4fdc56ae DS> # Parent 41c761dba6a6268da6fdb9a89c1cc6f959870aac DS> Make cu_compare_ref() also compare the actual classname of the ref and inst This makes cu_compare_ref() assist association providers in avoiding carefully crafted instances to fool the dispatch code. For example, in HostedResourcePool, it (now) uses cu_compare_ref() to make sure the client specified a valid HostSystem, but since ComputerSystem is a CIM_System, if you pass ComputerSystem.Name="", HostedResourcePool would validate Name and proceed. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 8 20:56:43 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 13:56:43 -0700 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt Message-ID: <90ffd19dda747eb615f1.1194559003@theine> # HG changeset patch # User Dan Smith # Date 1194558864 28800 # Node ID 90ffd19dda747eb615f12b10aa04e4f9bc978b31 # Parent 114b074cb5e710e6c3613ca89edf205bbf945d4c Change installed namespace to root/virt This one deserves some serious testing, although I was pleasantly surprised at how few instances of the namespace we had hard-coded. We could probably use a configure flag to set the namespace, but the schema files would all have to change before it would work, so I'm not sure it's worth it. Signed-off-by: Dan Smith diff -r 114b074cb5e7 -r 90ffd19dda74 Makefile.am --- a/Makefile.am Thu Nov 08 12:47:38 2007 -0800 +++ b/Makefile.am Thu Nov 08 13:54:24 2007 -0800 @@ -81,11 +81,11 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk # Un/Register the providers and class definitions from/to the current CIMOM. # @CIMSERVER@ is set by the configure script postinstall: - sh provider-register.sh -v -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) + sh provider-register.sh -v -t @CIMSERVER@ -n /root/virt -r $(REGS) -m $(MOFS) sh provider-register.sh -v -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) preuninstall: - sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) + sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/virt -r $(REGS) -m $(MOFS) sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) rpm: clean diff -r 114b074cb5e7 -r 90ffd19dda74 doc/Makefile.am --- a/doc/Makefile.am Thu Nov 08 12:47:38 2007 -0800 +++ b/doc/Makefile.am Thu Nov 08 13:54:24 2007 -0800 @@ -1,6 +1,8 @@ XSLTPROC = /usr/bin/xsltproc XSLTPROC = /usr/bin/xsltproc WEB_PAGES = index.html + +EXTRA_DIST = site.xsl libvirt-cim.html $(WEB_PAGES): libvirt-cim.html site.xsl $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html diff -r 114b074cb5e7 -r 90ffd19dda74 doc/libvirt-cim.html --- a/doc/libvirt-cim.html Thu Nov 08 12:47:38 2007 -0800 +++ b/doc/libvirt-cim.html Thu Nov 08 13:54:24 2007 -0800 @@ -73,9 +73,9 @@ $ mkdir cim216
$ cd cim216
$ unzip $PATH_TO_ZIPFILE
- $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd cimv216.mof
- $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd qualifiers.mof
- $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd qualifiers_optional.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof

To install the schema in SFCB:

diff -r 114b074cb5e7 -r 90ffd19dda74 schema/AllocationCapabilities.registration --- a/schema/AllocationCapabilities.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/AllocationCapabilities.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_AllocationCapabilities root/ibmsd Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance -KVM_AllocationCapabilities root/ibmsd Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance +Xen_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance +KVM_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ComputerSystem.registration --- a/schema/ComputerSystem.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ComputerSystem.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ComputerSystem root/ibmsd Virt_ComputerSystemProvider Virt_ComputerSystem instance method +Xen_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance method # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_ComputerSystem root/ibmsd Virt_ComputerSystemProvider Virt_ComputerSystem instance +KVM_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ComputerSystemIndication.registration --- a/schema/ComputerSystemIndication.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ComputerSystemIndication.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 -Xen_ComputerSystemCreatedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method -Xen_ComputerSystemDeletedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method -KVM_ComputerSystemCreatedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method -KVM_ComputerSystemDeletedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +Xen_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +Xen_ComputerSystemDeletedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +KVM_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +KVM_ComputerSystemDeletedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method diff -r 114b074cb5e7 -r 90ffd19dda74 schema/DiskPool.registration --- a/schema/DiskPool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/DiskPool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,2 +1,2 @@ Xen_DiskPool root/ibmsd Virt_DevicePoolP -Xen_DiskPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance -KVM_DiskPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +Xen_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance +KVM_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ElementAllocatedFromPool.registration --- a/schema/ElementAllocatedFromPool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ElementAllocatedFromPool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ElementAllocatedFromPool root/ibmsd Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association -KVM_ElementAllocatedFromPool root/ibmsd KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association \ No newline at end of file +Xen_ElementAllocatedFromPool root/virt Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association +KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association \ No newline at end of file diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ElementConformsToProfile.registration --- a/schema/ElementConformsToProfile.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ElementConformsToProfile.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,7 +1,7 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -#Xen_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association +#Xen_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association Xen_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association # Classname Namespace ProviderName ProviderModule ProviderTypes ... -#KVM_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association +#KVM_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association KVM_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association diff -r 114b074cb5e7 -r 90ffd19dda74 schema/EnabledLogicalElementCapabilities.registration --- a/schema/EnabledLogicalElementCapabilities.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/EnabledLogicalElementCapabilities.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_EnabledLogicalElementCapabilities root/ibmsd Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance +Xen_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_EnabledLogicalElementCapabilities root/ibmsd Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance +KVM_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/HostSystem.registration --- a/schema/HostSystem.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/HostSystem.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_HostSystem root/ibmsd Virt_HostSystemProvider Virt_HostSystem instance +Xen_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_HostSystem root/ibmsd Virt_HostSystemProvider Virt_HostSystem instance +KVM_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/HostedDependency.registration --- a/schema/HostedDependency.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/HostedDependency.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_HostedDependency root/ibmsd Virt_HostedDependencyProvider Virt_HostedDependency association +Xen_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_HostedDependency root/ibmsd Virt_HostedDependencyProvider Virt_HostedDependency association +KVM_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association diff -r 114b074cb5e7 -r 90ffd19dda74 schema/HostedResourcePool.registration --- a/schema/HostedResourcePool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/HostedResourcePool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_HostedResourcePool root/ibmsd Virt_HostedResourcePoolProvider Virt_HostedResourcePool association -KVM_HostedResourcePool root/ibmsd Virt_HostedResourcePoolProvider Virt_HostedResourcePool association \ No newline at end of file +Xen_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association +KVM_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association \ No newline at end of file diff -r 114b074cb5e7 -r 90ffd19dda74 schema/LogicalDisk.registration --- a/schema/LogicalDisk.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/LogicalDisk.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_LogicalDisk root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_LogicalDisk root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/Memory.registration --- a/schema/Memory.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/Memory.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_Memory root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_Memory root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_Memory root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_Memory root/virt Virt_DeviceProvider Virt_Device instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/MemoryPool.registration --- a/schema/MemoryPool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/MemoryPool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_MemoryPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +Xen_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_MemoryPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +KVM_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/NetPool.registration --- a/schema/NetPool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/NetPool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_NetworkPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance -KVM_NetworkPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance \ No newline at end of file +Xen_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance +KVM_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance \ No newline at end of file diff -r 114b074cb5e7 -r 90ffd19dda74 schema/NetworkPort.registration --- a/schema/NetworkPort.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/NetworkPort.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_NetworkPort root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_NetworkPort root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/Processor.registration --- a/schema/Processor.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/Processor.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_Processor root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_Processor root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_Processor root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_Processor root/virt Virt_DeviceProvider Virt_Device instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ProcessorPool.registration --- a/schema/ProcessorPool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ProcessorPool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ProcessorPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +Xen_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_ProcessorPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +KVM_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ResourceAllocationFromPool.registration --- a/schema/ResourceAllocationFromPool.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ResourceAllocationFromPool.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ResourceAllocationFromPool root/ibmsd Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association -KVM_ResourceAllocationFromPool root/ibmsd KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file +Xen_ResourceAllocationFromPool root/virt Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association +KVM_ResourceAllocationFromPool root/virt KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ResourceAllocationSettingData.registration --- a/schema/ResourceAllocationSettingData.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ResourceAllocationSettingData.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 -Xen_DiskResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance -Xen_NetResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance -Xen_ProcResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance -Xen_MemResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance +Xen_DiskResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance +Xen_NetResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance +Xen_ProcResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance +Xen_MemResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ResourcePoolConfigurationCapabilities.registration --- a/schema/ResourcePoolConfigurationCapabilities.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ResourcePoolConfigurationCapabilities.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ResourcePoolConfigurationCapabilities root/ibmsd Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance -KVM_ResourcePoolConfigurationCapabilities root/ibmsd Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance \ No newline at end of file +Xen_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance +KVM_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance \ No newline at end of file diff -r 114b074cb5e7 -r 90ffd19dda74 schema/ResourcePoolConfigurationService.registration --- a/schema/ResourcePoolConfigurationService.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/ResourcePoolConfigurationService.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ResourcePoolConfigurationService root/ibmsd Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method -KVM_ResourcePoolConfigurationService root/ibmsd Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method \ No newline at end of file +Xen_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method +KVM_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method \ No newline at end of file diff -r 114b074cb5e7 -r 90ffd19dda74 schema/SettingsDefineCapabilities.registration --- a/schema/SettingsDefineCapabilities.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/SettingsDefineCapabilities.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_SettingsDefineCapabilities root/ibmsd Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association -KVM_SettingsDefineCapabilities root/ibmsd KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association diff -r 114b074cb5e7 -r 90ffd19dda74 schema/SettingsDefineState.registration --- a/schema/SettingsDefineState.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/SettingsDefineState.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_SettingsDefineState root/ibmsd Xen_SettingsDefineStateProvider Virt_SettingsDefineState association -KVM_SettingsDefineState root/ibmsd KVM_SettingsDefineStateProvider Virt_SettingsDefineState association +Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association +KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association diff -r 114b074cb5e7 -r 90ffd19dda74 schema/SystemDevice.registration --- a/schema/SystemDevice.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/SystemDevice.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_SystemDevice root/ibmsd Xen_SystemDeviceProvider Virt_SystemDevice association -KVM_SystemDevice root/ibmsd KVM_SystemDeviceProvider Virt_SystemDevice association +Xen_SystemDevice root/virt Xen_SystemDeviceProvider Virt_SystemDevice association +KVM_SystemDevice root/virt KVM_SystemDeviceProvider Virt_SystemDevice association diff -r 114b074cb5e7 -r 90ffd19dda74 schema/VSSD.registration --- a/schema/VSSD.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/VSSD.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_VirtualSystemSettingData root/ibmsd Virt_VSSDProvider Virt_VSSD instance -KVM_VirtualSystemSettingData root/ibmsd Virt_VSSDProvider Virt_VSSD instance +Xen_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance +KVM_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/VSSDComponent.registration --- a/schema/VSSDComponent.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/VSSDComponent.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_VirtualSystemSettingDataComponent root/ibmsd Xen_VSSDComponentProvider Virt_VSSDComponent association -KVM_VirtualSystemSettingDataComponent root/ibmsd KVM_VSSDComponentProvider Virt_VSSDComponent association +Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association +KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association diff -r 114b074cb5e7 -r 90ffd19dda74 schema/VirtualSystemManagementCapabilities.registration --- a/schema/VirtualSystemManagementCapabilities.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/VirtualSystemManagementCapabilities.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_VirtualSystemManagementCapabilities root/ibmsd Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance +Xen_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_VirtualSystemManagementCapabilities root/ibmsd Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance +KVM_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance diff -r 114b074cb5e7 -r 90ffd19dda74 schema/VirtualSystemManagementService.registration --- a/schema/VirtualSystemManagementService.registration Thu Nov 08 12:47:38 2007 -0800 +++ b/schema/VirtualSystemManagementService.registration Thu Nov 08 13:54:24 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance -KVM_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance +Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance +KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance diff -r 114b074cb5e7 -r 90ffd19dda74 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Thu Nov 08 12:47:38 2007 -0800 +++ b/src/Virt_ComputerSystemIndication.c Thu Nov 08 13:54:24 2007 -0800 @@ -142,7 +142,7 @@ static bool async_ind(CMPIContext *conte CMPIStatus s; const char *type_name; char *type_cn = NULL; - const char *ns = "root/ibmsd"; + const char *ns = "root/virt"; /* FIXME: Hmm, need to get the namespace a better way */ diff -r 114b074cb5e7 -r 90ffd19dda74 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Thu Nov 08 12:47:38 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Thu Nov 08 13:54:24 2007 -0800 @@ -64,7 +64,7 @@ static CMPIStatus elem_instances(const C goto out; } - op = CMNewObjectPath(_BROKER, "/root/ibmsd", classname, &s); + op = CMNewObjectPath(_BROKER, "/root/virt", classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto error; From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:25 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:25 -0400 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: Message-ID: <2d09468e2de7ed919490.1194558685@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194557443 18000 # Node ID 2d09468e2de7ed9194907bfff1efbb16ba40202d # Parent 0ed8747c1dfbf14ff7f6e23ff792a35852294fa6 Add processor support to SettingsDefineCapabilities. Signed-off-by: Jay Gagnon diff -r 0ed8747c1dfb -r 2d09468e2de7 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:29:37 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:30:43 2007 -0500 @@ -26,6 +26,8 @@ #include #include +#include + #include "config.h" #include "cmpidt.h" @@ -195,6 +197,121 @@ static struct sdc_rasd_prop *mem_inc(con return rasd; } +static struct sdc_rasd_prop *proc_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_procs = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *proc_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + int cpu_num; + FILE *cpuinfo; + size_t len = 0; + char *line = NULL; + uint16_t num_procs = 0; + struct sdc_rasd_prop *rasd = NULL; + + CU_DEBUG("In proc_max()"); + + cpuinfo = fopen("/proc/cpuinfo", "r"); + if (cpuinfo == NULL) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy open cpuinfo."); + goto out; + } + + while (getline(&line, &len, cpuinfo) > 0) { + if (sscanf(line, "processor : %d", &cpu_num) == 1) { + CU_DEBUG("Line matched. num_procs++"); + num_procs++; + } + } + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + out: + free(line); + fclose(cpuinfo); + return rasd; +} + +static struct sdc_rasd_prop *proc_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_procs = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *proc_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_procs = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + static struct sdc_rasd_prop *net_min(const CMPIObjectPath *ref, CMPIStatus *s) { @@ -413,6 +530,14 @@ static struct sdc_rasd mem = { .inc = mem_inc }; +static struct sdc_rasd processor = { + .resource_type = CIM_RASD_TYPE_PROC, + .min = proc_min, + .max = proc_max, + .def = proc_def, + .inc = proc_inc +}; + static struct sdc_rasd network = { .resource_type = CIM_RASD_TYPE_NET, .min = net_min, @@ -431,6 +556,7 @@ static struct sdc_rasd disk = { static struct sdc_rasd *sdc_rasd_list[] = { &mem, + &processor, &network, &disk, NULL From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:24 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:24 -0400 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: Message-ID: <0ed8747c1dfbf14ff7f6.1194558684@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194557377 18000 # Node ID 0ed8747c1dfbf14ff7f6e23ff792a35852294fa6 # Parent 94308147bed1693443d0741de6a30c5b0f77b0f1 Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic. Signed-off-by: Jay Gagnon diff -r 94308147bed1 -r 0ed8747c1dfb src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:29:18 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:29:37 2007 -0500 @@ -195,6 +195,85 @@ static struct sdc_rasd_prop *mem_inc(con return rasd; } +static struct sdc_rasd_prop *net_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 0; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (ret) + return rasd; + else + return NULL; +} + +static struct sdc_rasd_prop *net_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 6; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (ret) + return rasd; + else + return NULL; +} +static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (ret) + return rasd; + else + return NULL; +} + +static struct sdc_rasd_prop *net_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (ret) + return rasd; + else + return NULL; +} + static struct sdc_rasd_prop *disk_min(const CMPIObjectPath *ref, CMPIStatus *s) { @@ -334,6 +413,14 @@ static struct sdc_rasd mem = { .inc = mem_inc }; +static struct sdc_rasd network = { + .resource_type = CIM_RASD_TYPE_NET, + .min = net_min, + .max = net_max, + .def = net_def, + .inc = net_inc +}; + static struct sdc_rasd disk = { .resource_type = CIM_RASD_TYPE_DISK, .min = disk_min, @@ -344,6 +431,7 @@ static struct sdc_rasd disk = { static struct sdc_rasd *sdc_rasd_list[] = { &mem, + &network, &disk, NULL }; From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:20 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:20 -0400 Subject: [Libvirt-cim] [PATCH 0 of 6] SettingsDefineCapabilities, all of it Message-ID: So this is a huge set, and I'm sorry for dumping it all at once, but I kept bouncing between the various patches as I worked on it, so sending any one out earlier probably would have backfired. This brings SettingsDefineCapabilities to a working state, as well as does all the background work. Clients should now be able to follow the chain of associations all the way from a HostSystem instance to a series of RASD instances that tell them the min, max, increment (read: granulatiry), and default values for NetworkPort, Disk, Memory, and Processor. Once this set is processed and approved I have some plans to try and make things a little more compact, as there is a reasonable amount of duplication in some places, and a couple of cases could use some polish, but with this set they should all be working, so it was about time to get it out for review. From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:23 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:23 -0400 Subject: [Libvirt-cim] [PATCH 3 of 6] Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional In-Reply-To: Message-ID: <94308147bed1693443d0.1194558683@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194557358 18000 # Node ID 94308147bed1693443d0741de6a30c5b0f77b0f1 # Parent 543a0790d8615551153950de8f2f2fe3de107cf3 Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional. Signed-off-by: Jay Gagnon diff -r 543a0790d861 -r 94308147bed1 src/Makefile.am --- a/src/Makefile.am Thu Nov 08 16:27:53 2007 -0500 +++ b/src/Makefile.am Thu Nov 08 16:29:18 2007 -0500 @@ -85,7 +85,7 @@ libVirt_AllocationCapabilities_la_LIBADD libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c -libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD +libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c diff -r 543a0790d861 -r 94308147bed1 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:27:53 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:29:18 2007 -0500 @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "config.h" @@ -37,8 +39,13 @@ #include "svpc_types.h" #include "Virt_SettingsDefineCapabilities.h" +#include "Virt_DevicePool.h" const static CMPIBroker *_BROKER; + +/* These are used in more than one place so they are defined here. */ +#define SDC_DISK_MIN 2000 +#define SDC_DISK_DEF 5000 static bool rasd_prop_copy_value(struct sdc_rasd_prop src, struct sdc_rasd_prop *dest) @@ -188,6 +195,137 @@ static struct sdc_rasd_prop *mem_inc(con return rasd; } +static struct sdc_rasd_prop *disk_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t disk_size = SDC_DISK_MIN; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *disk_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + char *inst_id; + CMPIrc prop_ret; + uint16_t free_space; + uint64_t free_64; + virConnectPtr conn; + CMPIInstance *pool_inst; + struct sdc_rasd_prop *rasd = NULL; + + inst_id = cu_get_str_path(ref, "InstanceID"); + if (inst_id == NULL) { + CMSetStatusWithChars(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); + goto out; + } + + conn = lv_connect(_BROKER, s); + if (s->rc != CMPI_RC_OK) { + CMSetStatusWithChars(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not get connection."); + goto out; + } + + /* Getting the relevant resource pool directly finds the free space + for us. It is in the Capacity field. */ + pool_inst = get_pool_by_id(_BROKER, conn, inst_id, NAMESPACE(ref)); + if (pool_inst == NULL) { + CMSetStatusWithChars(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not get pool instance."); + goto out; + } + + prop_ret = cu_get_u64_prop(pool_inst, "Capacity", &free_64); + if (prop_ret != CMPI_RC_OK) { + CMSetStatusWithChars(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not get capacity from instance."); + goto out; + } + CU_DEBUG("Got capacity from pool_inst: %lld", free_64); + + free_space = (uint16_t)free_64; + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&free_space, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + out: + free(inst_id); + return rasd; +} + +static struct sdc_rasd_prop *disk_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t disk_size = SDC_DISK_DEF; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *disk_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t disk_size = 250; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + static struct sdc_rasd mem = { .resource_type = CIM_RASD_TYPE_MEM, .min = mem_min, @@ -196,8 +334,17 @@ static struct sdc_rasd mem = { .inc = mem_inc }; +static struct sdc_rasd disk = { + .resource_type = CIM_RASD_TYPE_DISK, + .min = disk_min, + .max = disk_max, + .def = disk_def, + .inc = disk_inc +}; + static struct sdc_rasd *sdc_rasd_list[] = { &mem, + &disk, NULL }; From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:26 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:26 -0400 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: Message-ID: # HG changeset patch # User Jay Gagnon # Date 1194557532 18000 # Node ID cf0a2938ba0b9d2e7af8a5790d0e56cc7564df73 # Parent 2d09468e2de7ed9194907bfff1efbb16ba40202d Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point. Signed-off-by: Jay Gagnon diff -r 2d09468e2de7 -r cf0a2938ba0b src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Thu Nov 08 16:30:43 2007 -0500 +++ b/src/Virt_ElementCapabilities.c Thu Nov 08 16:32:12 2007 -0500 @@ -179,6 +179,50 @@ static CMPIStatus cap_to_cs(const CMPIOb return s; } +static CMPIStatus alloc_to_pool(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + /* Pool to alloc is more important. That will be done first. */ + return (CMPIStatus){CMPI_RC_OK, NULL}; +} + +static CMPIStatus pool_to_alloc(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + int ret; + char *inst_id; + uint16_t type; + CMPIInstance *inst = NULL; + CMPIStatus s = {CMPI_RC_OK}; + + inst_id = cu_get_str_path(ref, "InstanceID"); + if (inst_id == NULL) { + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); + goto out; + } + + inst = get_typed_instance(_BROKER, "AllocationCapabilities", + NAMESPACE(ref)); + CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars); + + ret = cu_get_u16_path(ref, "ResourceType", &type); + if (ret != 1) { + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + "Could not get ResourceType."); + goto out; + } + CMSetProperty(inst, "ResourceType", &type, CMPI_uint16); + + inst_list_add(list, inst); + + out: + free(inst_id); + + return s; +} static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, @@ -273,6 +317,28 @@ struct std_assoc ele_cap_to_computer_sys .assoc_class = "CIM_ElementCapabilities", .handler = cap_to_cs, + .make_ref = make_ref +}; + +struct std_assoc alloc_cap_to_resource_pool = { + .source_class = "CIM_AllocationCapabilities", + .source_prop = "Capabilities", + + .target_class = "CIM_ResourcePool", + .target_prop = "ManagedElement", + + .handler = alloc_to_pool, + .make_ref = make_ref +}; + +struct std_assoc resource_pool_to_alloc_cap = { + .source_class = "CIM_ResourcePool", + .source_prop = "ManagedElement", + + .target_class = "CIM_AllocationCapabilities", + .target_prop = "Capabilities", + + .handler = pool_to_alloc, .make_ref = make_ref }; @@ -282,6 +348,8 @@ struct std_assoc *assoc_handlers[] = { &system_to_vsm_cap, &vsm_cap_to_system, &ele_cap_to_computer_system, + &alloc_cap_to_resource_pool, + &resource_pool_to_alloc_cap, NULL }; From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:21 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:21 -0400 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: Message-ID: # HG changeset patch # User Jay Gagnon # Date 1194557266 18000 # Node ID fd6deb234772b44fe549a3513a47115a01e20f7d # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree. Signed-off-by: Jay Gagnon diff -r bd1b1067d106 -r fd6deb234772 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 10:43:48 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:27:46 2007 -0500 @@ -96,84 +96,96 @@ static bool free_rasd_prop_list(struct s return true; } -static struct sdc_rasd_prop *mem_max(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; +static struct sdc_rasd_prop *mem_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t max_vq = MAX_MEM; - struct sdc_rasd_prop max[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&max_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(max, &rasd); - if (ret) - return rasd; - else - return NULL; -} - -static struct sdc_rasd_prop *mem_min(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *mem_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t min_vq = 64; - struct sdc_rasd_prop min[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&min_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(min, &rasd); - if (ret) - return rasd; - else - return NULL; -} - -static struct sdc_rasd_prop *mem_def(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *mem_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t def_vq = 256; - struct sdc_rasd_prop def[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&def_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(def, &rasd); - if (ret) - return rasd; - else - return NULL; -} - -static struct sdc_rasd_prop *mem_inc(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *mem_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t inc_vq = 1; - struct sdc_rasd_prop inc[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&inc_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(inc, &rasd); - if (ret) - return rasd; - else - return NULL; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; } static struct sdc_rasd mem = { @@ -190,17 +202,17 @@ static struct sdc_rasd *sdc_rasd_list[] }; static CMPIInstance *sdc_rasd_inst(const CMPIBroker *broker, + CMPIStatus *s, const CMPIObjectPath *ref, struct sdc_rasd *rasd, sdc_rasd_type type) { - CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; struct sdc_rasd_prop *prop_list; int i; char *inst_id; uint16_t resource_type; - /* Defaults for the following three values are from + /* Defaults for the following are from CIM_SettingsDefineCapabilities.mof. */ uint16_t policy = SDC_POLICY_INDEPENDENT; uint16_t role = SDC_ROLE_SUPPORTED; @@ -209,43 +221,40 @@ static CMPIInstance *sdc_rasd_inst(const case SDC_RASD_MIN: if (rasd->min == NULL) goto out; - prop_list = rasd->min(); + prop_list = rasd->min(ref, s); inst_id = "Minimum"; range = SDC_RANGE_MIN; break; case SDC_RASD_MAX: if (rasd->max == NULL) goto out; - prop_list = rasd->max(); + prop_list = rasd->max(ref, s); inst_id = "Maximum"; range = SDC_RANGE_MAX; break; case SDC_RASD_INC: if (rasd->inc == NULL) goto out; - prop_list = rasd->inc(); + prop_list = rasd->inc(ref, s); inst_id = "Increment"; range = SDC_RANGE_INC; break; case SDC_RASD_DEF: if (rasd->def == NULL) goto out; - prop_list = rasd->def(); + prop_list = rasd->def(ref, s); inst_id = "Default"; role = SDC_ROLE_DEFAULT; range = SDC_RANGE_POINT; break; default: - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, + CMSetStatusWithChars(broker, s, CMPI_RC_ERR_FAILED, "Unsupported sdc_rasd type."); goto out; } - if (prop_list == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Failed to get prop_list."); + if (s->rc != CMPI_RC_OK) goto out; - } inst = get_typed_instance(broker, "ResourceAllocationSettingData", @@ -291,7 +300,11 @@ static CMPIStatus sdc_rasds_for_type(con if (rasd) { for (i = SDC_RASD_MIN; i <= SDC_RASD_INC; i++) { - inst = sdc_rasd_inst(_BROKER, ref, rasd, i); + inst = sdc_rasd_inst(_BROKER, &s, ref, rasd, i); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Problem getting inst."); + goto out; + } CU_DEBUG("Got inst.\n"); if (inst != NULL) { inst_list_add(list, inst); @@ -307,6 +320,7 @@ static CMPIStatus sdc_rasds_for_type(con "Unsupported device type."); } + out: return s; } diff -r bd1b1067d106 -r fd6deb234772 src/Virt_SettingsDefineCapabilities.h --- a/src/Virt_SettingsDefineCapabilities.h Thu Nov 08 10:43:48 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.h Thu Nov 08 16:27:46 2007 -0500 @@ -50,7 +50,8 @@ struct sdc_rasd_prop { CMPIType type; }; -typedef struct sdc_rasd_prop *(*rasd_prop_func_t)(void); +typedef struct sdc_rasd_prop *(*rasd_prop_func_t)(const CMPIObjectPath *ref, + CMPIStatus *s); struct sdc_rasd { uint16_t resource_type; From grendel at linux.vnet.ibm.com Thu Nov 8 20:51:22 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 08 Nov 2007 16:51:22 -0400 Subject: [Libvirt-cim] [PATCH 2 of 6] Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool In-Reply-To: Message-ID: <543a0790d86155511539.1194558682@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194557273 18000 # Node ID 543a0790d8615551153950de8f2f2fe3de107cf3 # Parent fd6deb234772b44fe549a3513a47115a01e20f7d Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool. Signed-off-by: Jay Gagnon diff -r fd6deb234772 -r 543a0790d861 src/Makefile.am --- a/src/Makefile.am Thu Nov 08 16:27:46 2007 -0500 +++ b/src/Makefile.am Thu Nov 08 16:27:53 2007 -0500 @@ -33,12 +33,12 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_VirtualSystemManagementCapabilities.la \ libVirt_EnabledLogicalElementCapabilities.la \ libVirt_AllocationCapabilities.la \ - libVirt_SettingsDefineCapabilities.la \ libVirt_VSSD.la \ libVirt_HostedDependency.la \ libVirt_RegisteredProfile.la \ libVirt_ElementConformsToProfile.la \ libVirt_DevicePool.la \ + libVirt_SettingsDefineCapabilities.la \ libVirt_HostedResourcePool.la \ libVirt_ElementCapabilities.la \ libVirt_ResourcePoolConfigurationService.la \ From danms at us.ibm.com Thu Nov 8 21:00:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 14:00:58 -0700 Subject: [Libvirt-cim] [PATCH] Cleanups and schema install additions to the RPM spec Message-ID: # HG changeset patch # User Dan Smith # Date 1194559255 28800 # Node ID fbc36f46718fd7390d43e61bbb35276a1ba55a6e # Parent 90ffd19dda747eb615f12b10aa04e4f9bc978b31 Cleanups and schema install additions to the RPM spec - Removed references to the register_bash.sh script - Added schema install/uninstall to scriptlets I have tested this on Fedora 8 with the bundled pegasus installation. We still need to figure out how we're going to get the CIM v2.16 Exp schema on the box, but if you do that manually (into /root/virt) before installing the RPM, it works as expected. Signed-off-by: Dan Smith diff -r 90ffd19dda74 -r fbc36f46718f libvirt-cim.spec.in --- a/libvirt-cim.spec.in Thu Nov 08 13:54:24 2007 -0800 +++ b/libvirt-cim.spec.in Thu Nov 08 14:00:55 2007 -0800 @@ -34,7 +34,7 @@ rm -fr %{buildroot} rm -fr %{buildroot} %makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi -cp provider-register.sh register_base.sh %{buildroot}%{_datadir}/libvirt-cim/ +cp provider-register.sh %{buildroot}%{_datadir}/libvirt-cim/ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la @@ -43,17 +43,34 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a %clean rm -fr %{buildroot} +%pre +%define REGISTRATION %{_datadir}/%{name}/*.registration +%define SCHEMA %{_datadir}/%{name}/*.mof +%define NAMESPACE /root/virt + +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n %{NAMESPACE} \ + -r %{REGISTRATION} -m %{SCHEMA} || true + %post /sbin/ldconfig -%postun +%{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n %{NAMESPACE} \ + -r %{REGISTRATION} -m %{SCHEMA} || true + +%preun /sbin/ldconfig + +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n %{NAMESPACE} \ + -r %{REGISTRATION} -m %{SCHEMA} || true %files %defattr(-, root, root) %doc README doc/CodingStyle doc/SubmittingPatches -%doc provider-register.sh register_base.sh +%doc provider-register.sh %{_libdir}/lib*.so* %{_libdir}/cmpi/lib*.so* %{_datadir}/libvirt-cim/*.sh From kaitlin at linux.vnet.ibm.com Thu Nov 8 22:02:46 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 14:02:46 -0800 Subject: [Libvirt-cim] [PATCH] Make HostedResourcePool a little more discerning In-Reply-To: <4c736ba430524c00804b.1194548692@theine> References: <4c736ba430524c00804b.1194548692@theine> Message-ID: <47338786.3000406@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194548690 28800 > # Node ID 4c736ba430524c00804b710b923ea0030808a893 > # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 > Make HostedResourcePool a little more discerning > Use cu_compare_ref() to make sure the client specified the actual > HostSystem instance and not a random CIM_System > Patch looks good, but wouldn't you also want to do this check for the sys_to_pool side of things as well? Or, basically, for any of the API calls that take a properties argument? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Thu Nov 8 22:10:29 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 14:10:29 -0800 Subject: [Libvirt-cim] [PATCH] Make HostedResourcePool a little more discerning References: <4c736ba430524c00804b.1194548692@theine> <47338786.3000406@linux.vnet.ibm.com> Message-ID: <87ejf0z8ve.fsf@theine.beaverton.ibm.com> KR> Patch looks good, but wouldn't you also want to do this check for KR> the sys_to_pool side of things as well? I'm not sure what you mean, this change *was* to sys_to_pool() :) KR> Or, basically, for any of the API calls that take a properties KR> argument? That brings up a good point, being that we might fail the test improperly if they specified (and we start honoring) the properties filter, so maybe we need to allow for passing a list of properties that are *excluded* from the list of properties checked. Since this is only comparing key properties, is it valid to use the property filter to exclude key properties? I could see the policy being either way really. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 8 22:18:49 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 14:18:49 -0800 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: (Jay Gagnon's message of "Thu, 08 Nov 2007 16:51:21 -0400") References: Message-ID: <87abpoz8hi.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194557266 18000 JG> # Node ID fd6deb234772b44fe549a3513a47115a01e20f7d JG> # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 JG> Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree. This one looks pretty straightforward. It looks like we could apply this one independently if we wanted to, right? A rather self-contained change, considering the size of the rest of the set. JG> + if (!ret) { JG> + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, JG> + "Could not copy RASD."); JG> + } This is a total nit, so forgive my OCD, but I think that everywhere else, the style of a cu_statusf() call is: cu_statusf(broker, status, CMPI_RC_ERR_FOO, "Error message", [opt if short, else newline], [opt]); Could I convince you to change these? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 8 22:19:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 14:19:20 -0800 Subject: [Libvirt-cim] [PATCH 2 of 6] Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool In-Reply-To: <543a0790d86155511539.1194558682@wulfgar> (Jay Gagnon's message of "Thu, 08 Nov 2007 16:51:22 -0400") References: <543a0790d86155511539.1194558682@wulfgar> Message-ID: <87640cz8gn.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194557273 18000 JG> # Node ID 543a0790d8615551153950de8f2f2fe3de107cf3 JG> # Parent fd6deb234772b44fe549a3513a47115a01e20f7d JG> Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool. +1, obviously :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 8 22:33:05 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 14:33:05 -0800 Subject: [Libvirt-cim] [PATCH 3 of 6] Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional In-Reply-To: <94308147bed1693443d0.1194558683@wulfgar> (Jay Gagnon's message of "Thu, 08 Nov 2007 16:51:23 -0400") References: <94308147bed1693443d0.1194558683@wulfgar> Message-ID: <871wb0z7tq.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194557358 18000 JG> # Node ID 94308147bed1693443d0741de6a30c5b0f77b0f1 JG> # Parent 543a0790d8615551153950de8f2f2fe3de107cf3 JG> Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional. I think this looks okay, but: JG> +#define SDC_DISK_MIN 2000 JG> +#define SDC_DISK_DEF 5000 Why not make the increment amount also parameterized as such? Seems like a valid thing to want to change. Unlikely, but valid :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Thu Nov 8 22:39:32 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 14:39:32 -0800 Subject: [Libvirt-cim] [PATCH] Make cu_compare_ref() also compare the actual classname of the ref and inst In-Reply-To: References: Message-ID: <47339024.3010505@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194548973 28800 > # Node ID a55a0f630c034ac5ed76211b8459ae1e4fdc56ae > # Parent 41c761dba6a6268da6fdb9a89c1cc6f959870aac > Make cu_compare_ref() also compare the actual classname of the ref and inst > > ...and change STREQ to STREQC, per Heidi's suggestion. > > Signed-off-by: Dan Smith Nice - this is a good check. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 9 00:09:02 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 16:09:02 -0800 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: <2d09468e2de7ed919490.1194558685@wulfgar> (Jay Gagnon's message of "Thu, 08 Nov 2007 16:51:25 -0400") References: <2d09468e2de7ed919490.1194558685@wulfgar> Message-ID: <87ir4cxotd.fsf@theine.beaverton.ibm.com> JG> + cpuinfo = fopen("/proc/cpuinfo", "r"); This should come from virNodeInfo. Also, it would be good to go ahead and split out the "how many vcpus is the max for xen?" behavior into a separate function, because it's possible that other platforms will be able to overcommit vcpus. This might be a good place to start making it clear that the behavior is platform-dependent. I think it's okay to always take the Xen default for the time being, but while you're reworking this, you might as well split it out too. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 00:24:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 16:24:12 -0800 Subject: [Libvirt-cim] [PATCH] Make HostedResourcePool a little more discerning In-Reply-To: <4733A615.2020202@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 16:13:09 -0800") References: <4c736ba430524c00804b.1194548692@theine> <47338786.3000406@linux.vnet.ibm.com> <87ejf0z8ve.fsf@theine.beaverton.ibm.com> <4733A615.2020202@linux.vnet.ibm.com> Message-ID: <87abpoxo43.fsf@theine.beaverton.ibm.com> KR> Oops, yes. I meant the pool_to_sys() side. =) Well, that is less of a problem I'd say. We don't really have the same issue of checking for a superclass where a subset of the children would be invalid parameters to the association, right? That's the root of the problem with the other direction. We could certainly look up an instance of the pool they're asking about and check their reference. I'm not sure it really matters as much as something like a GetInstance though, because the answer is always the same, no matter what pool they ask about. If someone deleted a pool between when they got a reference and when they asked about the host system for that pool, then we'd fail the association even though we already knew the answer and the answer is valid. Depends on your interpretation of CIM principles I suppose :) KR> Is there a defined CIM way for handling properties? I mostly KR> asked because I don't know much about them. I'm not sure what the policy is for property filtering and if keys can't be filtered. Something to revisit when we actually implement support for such, I'd say :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:41:31 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:41:31 -0800 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: References: Message-ID: <47339EAB.5020007@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194557266 18000 > # Node ID fd6deb234772b44fe549a3513a47115a01e20f7d > # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 > Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree. > Signed-off-by: Jay Gagnon > > diff -r bd1b1067d106 -r fd6deb234772 src/Virt_SettingsDefineCapabilities.c > --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 10:43:48 2007 -0800 > +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 08 16:27:46 2007 -0500 > @@ -96,84 +96,96 @@ static bool free_rasd_prop_list(struct s > return true; > } > > -static struct sdc_rasd_prop *mem_max(void) > -{ > - bool ret; > - struct sdc_rasd_prop *rasd; > +static struct sdc_rasd_prop *mem_max(const CMPIObjectPath *ref, > + CMPIStatus *s) > +{ > + bool ret; > + struct sdc_rasd_prop *rasd = NULL; > uint64_t max_vq = MAX_MEM; > > - struct sdc_rasd_prop max[] = { > + struct sdc_rasd_prop tmp[] = { > {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, > {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, > {"VirtualQuantity", (CMPIValue *)&max_vq, CMPI_uint64}, > PROP_END > }; > > - ret = dup_rasd_prop_list(max, &rasd); > - if (ret) > - return rasd; > - else > - return NULL; > -} > - > -static struct sdc_rasd_prop *mem_min(void) > -{ > - bool ret; > - struct sdc_rasd_prop *rasd; > + ret = dup_rasd_prop_list(tmp, &rasd); > + if (!ret) { > + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, > + "Could not copy RASD."); > + } > + > + return rasd; > +} > > Why is the ref param needed here? Is that something you'll be adding later? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:48:48 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:48:48 -0800 Subject: [Libvirt-cim] [PATCH 2 of 5] Adding support to build and install Virt_HostedService provider In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1194555199 28800 # Node ID e47094a1620c4215427afaa46faedee97bcd123a # Parent 6968bc0b3116061f68f467bc827e42ac853e2a7b Adding support to build and install Virt_HostedService provider. Also fixed the missing \ after schema/ResourceAllocationFromPool.registration in Makefile.am. Signed-off-by: Kaitlin Rupert diff -r 6968bc0b3116 -r e47094a1620c Makefile.am --- a/Makefile.am Thu Nov 08 12:51:51 2007 -0800 +++ b/Makefile.am Thu Nov 08 12:53:19 2007 -0800 @@ -29,8 +29,9 @@ MOFS = \ schema/VSSDComponent.mof \ schema/SettingsDefineState.mof \ schema/NetPool.mof \ - schema/ResourceAllocationFromPool.mof - schema/ElementAllocatedFromPool.mof + schema/ResourceAllocationFromPool.mof \ + schema/ElementAllocatedFromPool.mof \ + schema/HostedService.mof INTEROP_MOFS = \ schema/RegisteredProfile.mof \ @@ -65,7 +66,8 @@ REGS = \ schema/SettingsDefineState.registration \ schema/NetPool.registration \ schema/ResourceAllocationFromPool.registration \ - schema/ElementAllocatedFromPool.registration + schema/ElementAllocatedFromPool.registration \ + schema/HostedService.registration INTEROP_REGS = \ schema/RegisteredProfile.registration \ diff -r 6968bc0b3116 -r e47094a1620c src/Makefile.am --- a/src/Makefile.am Thu Nov 08 12:51:51 2007 -0800 +++ b/src/Makefile.am Thu Nov 08 12:53:19 2007 -0800 @@ -11,8 +11,10 @@ noinst_HEADERS = profiles.h svpc_types.h Virt_HostSystem.h \ Virt_RASD.h \ Virt_RegisteredProfile.h \ + Virt_ResourcePoolConfigurationService.h \ Virt_SettingsDefineCapabilities.h \ Virt_VirtualSystemManagementCapabilities.h \ + Virt_VirtualSystemManagementService.h \ Virt_VSSD.h XKUADD = $(top_builddir)/libxkutil/libxkutil.la @@ -46,7 +48,8 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_VSSDComponent.la \ libVirt_SettingsDefineState.la \ libVirt_ResourceAllocationFromPool.la \ - libVirt_ElementAllocatedFromPool.la + libVirt_ElementAllocatedFromPool.la \ + libVirt_HostedService.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_Device_la_SOURCES = Virt_Device.c @@ -110,3 +113,6 @@ libVirt_ResourceAllocationFromPool_la_LI libVirt_ElementAllocatedFromPool_la_SOURCES = Virt_ElementAllocatedFromPool.c libVirt_ElementAllocatedFromPool_la_LIBADD = -lVirt_DevicePool -lVirt_Device + +libVirt_HostedService_la_SOURCES = Virt_HostedService.c +libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService From danms at us.ibm.com Thu Nov 8 23:58:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 15:58:26 -0800 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: <0ed8747c1dfbf14ff7f6.1194558684@wulfgar> (Jay Gagnon's message of "Thu, 08 Nov 2007 16:51:24 -0400") References: <0ed8747c1dfbf14ff7f6.1194558684@wulfgar> Message-ID: <87mytoxpb1.fsf@theine.beaverton.ibm.com> JG> + uint16_t num_nics = 6; JG> + struct sdc_rasd_prop *rasd = NULL; JG> + JG> + struct sdc_rasd_prop tmp[] = { JG> + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, JG> + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, JG> + PROP_END JG> + }; The maximum NIC count is probably different for KVM and Xen, and I imagine this function should be intelligent in the future. Could we at least pull the '6' out to a constant like XEN_MAX_VIF or something? JG> +static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, JG> + CMPIStatus *s) JG> +{ JG> + bool ret; JG> + uint16_t num_nics = 1; JG> + struct sdc_rasd_prop *rasd = NULL; JG> + JG> + struct sdc_rasd_prop tmp[] = { JG> + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, JG> + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, JG> + PROP_END JG> + }; JG> + JG> + ret = dup_rasd_prop_list(tmp, &rasd); JG> + if (ret) JG> + return rasd; JG> + else JG> + return NULL; JG> +} JG> + JG> +static struct sdc_rasd_prop *net_inc(const CMPIObjectPath *ref, JG> + CMPIStatus *s) JG> +{ JG> + bool ret; JG> + uint16_t num_nics = 1; JG> + struct sdc_rasd_prop *rasd = NULL; JG> + JG> + struct sdc_rasd_prop tmp[] = { JG> + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, JG> + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, JG> + PROP_END JG> + }; JG> + JG> + ret = dup_rasd_prop_list(tmp, &rasd); JG> + if (ret) JG> + return rasd; JG> + else JG> + return NULL; JG> +} I think "default" and "increment" in the network case are probably safe to leave hardcoded to '1' and buried :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 00:18:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 16:18:00 -0800 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: (Jay Gagnon's message of "Thu, 08 Nov 2007 16:51:26 -0400") References: Message-ID: <87ejf0xoef.fsf@theine.beaverton.ibm.com> JG> +static CMPIStatus alloc_to_pool(const CMPIObjectPath *ref, JG> + struct std_assoc_info *info, JG> + struct inst_list *list) JG> +{ JG> + /* Pool to alloc is more important. That will be done first. */ JG> + return (CMPIStatus){CMPI_RC_OK, NULL}; JG> +} If we're going to leave this out for now, this should instead be RETURN_UNSUPPORTED(). However, since the InstanceID of a pool and an AllocationCapabilities are the same, isn't this behavior the same as below? If you set the below function to be the handler for the alloc_to_pool case, won't it behave as expected? JG> +static CMPIStatus pool_to_alloc(const CMPIObjectPath *ref, JG> + struct std_assoc_info *info, JG> + struct inst_list *list) JG> +{ JG> + int ret; JG> + char *inst_id; JG> + uint16_t type; JG> + CMPIInstance *inst = NULL; JG> + CMPIStatus s = {CMPI_RC_OK}; JG> + JG> + inst_id = cu_get_str_path(ref, "InstanceID"); JG> + if (inst_id == NULL) { JG> + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, JG> + "Could not get InstanceID."); JG> + goto out; JG> + } JG> + JG> + inst = get_typed_instance(_BROKER, "AllocationCapabilities", JG> + NAMESPACE(ref)); JG> + CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars); JG> + JG> + ret = cu_get_u16_path(ref, "ResourceType", &type); JG> + if (ret != 1) { JG> + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, JG> + "Could not get ResourceType."); JG> + goto out; JG> + } JG> + CMSetProperty(inst, "ResourceType", &type, CMPI_uint16); JG> + JG> + inst_list_add(list, inst); JG> + JG> + out: JG> + free(inst_id); JG> + JG> + return s; JG> +} This brings up an idea. Maybe it would be helpful for libcmpiutil to have a function that copies a value from a ref to an instance, or from an instance to an instance. This would assume that they're the same type, of course, but the above would be much shorter if we had something like: cu_copy_key(&ref, &inst, "InstanceID"); cu_copy_key(&ref, &inst, "ResourceType"); Right? I know there are a couple other places where we need to do that, so it might be worth knocking something up. Should be trivial and easy. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:48:51 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:48:51 -0800 Subject: [Libvirt-cim] [PATCH 5 of 5] Fix _get_vsms() call so other providers can call it In-Reply-To: Message-ID: <1fc24e24237efa5ea495.1194565731@kyon> # HG changeset patch # User Kaitlin Rupert # Date 1194558013 28800 # Node ID 1fc24e24237efa5ea495b48c2beb8bb10afc2270 # Parent 34e8e0d331e42f42545342dd765d35ee66aabd56 Fix _get_vsms() call so other providers can call it. Remove static from _get_vsms(), rename function, add support for a broker from another provider, and add the function declartion to a header file. This will allow other providers to call this function as needed. Signed-off-by: Kaitlin Rupert diff -r 34e8e0d331e4 -r 1fc24e24237e src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Thu Nov 08 13:40:08 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Thu Nov 08 13:40:13 2007 -0800 @@ -41,6 +41,7 @@ #include "std_indication.h" #include "misc_util.h" +#include "Virt_VirtualSystemManagementService.h" #include "Virt_ComputerSystem.h" #include "Virt_ComputerSystemIndication.h" #include "Virt_RASD.h" @@ -992,25 +993,26 @@ STDIM_MethodMIStub(, Virt_VirtualSystemM STDIM_MethodMIStub(, Virt_VirtualSystemManagementService, _BROKER, CMNoHook, my_handlers); -static CMPIStatus _get_vsms(const CMPIObjectPath *reference, - CMPIInstance **_inst, - int name_only) +CMPIStatus get_vsms(const CMPIObjectPath *reference, + CMPIInstance **_inst, + const CMPIBroker *broker, + int name_only) { CMPIStatus s; CMPIInstance *inst; CMPIInstance *host; char *val = NULL; - s = get_host_cs(_BROKER, reference, &host); + s = get_host_cs(broker, reference, &host); if (s.rc != CMPI_RC_OK) goto out; - inst = get_typed_instance(_BROKER, + inst = get_typed_instance(broker, "VirtualSystemManagementService", NAMESPACE(reference)); if (inst == NULL) { CU_DEBUG("Failed to get typed instance"); - cu_statusf(_BROKER, &s, + cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Failed to create instance"); goto out; @@ -1020,7 +1022,7 @@ static CMPIStatus _get_vsms(const CMPIOb (CMPIValue *)"Management Service", CMPI_chars); if (cu_get_str_prop(host, "Name", &val) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, + cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Unable to get name of System"); goto out; @@ -1031,7 +1033,7 @@ static CMPIStatus _get_vsms(const CMPIOb free(val); if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, + cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Unable to get creation class of system"); goto out; @@ -1055,7 +1057,7 @@ static CMPIStatus return_vsms(const CMPI CMPIInstance *inst; CMPIStatus s; - s = _get_vsms(reference, &inst, name_only); + s = get_vsms(reference, &inst, _BROKER, name_only); if (s.rc != CMPI_RC_OK) goto out; @@ -1097,7 +1099,7 @@ static CMPIStatus GetInstance(CMPIInstan CMPIStatus s; const char *prop; - s = _get_vsms(ref, &inst, 0); + s = get_vsms(ref, &inst, _BROKER, 0); if (s.rc != CMPI_RC_OK) return s; diff -r 34e8e0d331e4 -r 1fc24e24237e src/Virt_VirtualSystemManagementService.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_VirtualSystemManagementService.h Thu Nov 08 13:40:13 2007 -0800 @@ -0,0 +1,25 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Kaitlin Rupert + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +CMPIStatus get_vsms(const CMPIObjectPath *reference, + CMPIInstance **_inst, + const CMPIBroker *broker, + int name_only); From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:48:50 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:48:50 -0800 Subject: [Libvirt-cim] [PATCH 4 of 5] Fix rpcs_instance() call so other providers can call it In-Reply-To: Message-ID: <34e8e0d331e42f425453.1194565730@kyon> # HG changeset patch # User Kaitlin Rupert # Date 1194558008 28800 # Node ID 34e8e0d331e42f42545342dd765d35ee66aabd56 # Parent 151bc006918bfcce761944dbe2397191a535a2dc Fix rpcs_instance() call so other providers can call it. Remove static from rpcs_instance(), add support for a broker from another provider, and add the function declartion to a header file. This will allow other providers to call this function as needed. Signed-off-by: Kaitlin Rupert diff -r 151bc006918b -r 34e8e0d331e4 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Thu Nov 08 12:55:39 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationService.c Thu Nov 08 13:40:08 2007 -0800 @@ -28,6 +28,7 @@ #include "misc_util.h" #include "Virt_HostSystem.h" +#include "Virt_ResourcePoolConfigurationService.h" const static CMPIBroker *_BROKER; @@ -89,23 +90,24 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -static CMPIStatus rpcs_instance(const CMPIObjectPath *reference, - CMPIInstance **_inst) +CMPIStatus rpcs_instance(const CMPIObjectPath *reference, + CMPIInstance **_inst, + const CMPIBroker *broker) { CMPIInstance *inst; CMPIInstance *host; CMPIStatus s; CMPIData prop; - s = get_host_cs(_BROKER, reference, &host); + s = get_host_cs(broker, reference, &host); if (s.rc != CMPI_RC_OK) goto out; - inst = get_typed_instance(_BROKER, + inst = get_typed_instance(broker, "ResourcePoolConfigurationService", NAMESPACE(reference)); if (inst == NULL) { - cu_statusf(_BROKER, &s, + cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Unable to get " "ResourcePoolConfigurationService instance"); @@ -117,7 +119,7 @@ static CMPIStatus rpcs_instance(const CM prop = CMGetProperty(host, "CreationClassName", &s); if (s.rc != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, + cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Unable to get CreationClassName from HostSystem"); goto out; @@ -128,7 +130,7 @@ static CMPIStatus rpcs_instance(const CM prop = CMGetProperty(host, "Name", NULL); if (s.rc != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, + cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Unable to get Name from HostSystem"); goto out; @@ -152,7 +154,7 @@ static CMPIStatus GetInstance(CMPIInstan CMPIStatus s; const char *prop = NULL; - s = rpcs_instance(reference, &inst); + s = rpcs_instance(reference, &inst, _BROKER); if (s.rc != CMPI_RC_OK) return s; @@ -176,7 +178,7 @@ static CMPIStatus EnumInstanceNames(CMPI CMPIInstance *inst; CMPIStatus s; - s = rpcs_instance(reference, &inst); + s = rpcs_instance(reference, &inst, _BROKER); if (s.rc == CMPI_RC_OK) cu_return_instance_name(results, inst); @@ -193,7 +195,7 @@ static CMPIStatus EnumInstances(CMPIInst CMPIInstance *inst; CMPIStatus s; - s = rpcs_instance(reference, &inst); + s = rpcs_instance(reference, &inst, _BROKER); if (s.rc == CMPI_RC_OK) CMReturnInstance(results, inst); diff -r 151bc006918b -r 34e8e0d331e4 src/Virt_ResourcePoolConfigurationService.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_ResourcePoolConfigurationService.h Thu Nov 08 13:40:08 2007 -0800 @@ -0,0 +1,24 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Kaitlin Rupert + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +CMPIStatus rpcs_instance(const CMPIObjectPath *reference, + CMPIInstance **_inst, + const CMPIBroker *broker); From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:48:47 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:48:47 -0800 Subject: [Libvirt-cim] [PATCH 1 of 5] Add new HostedService association provider In-Reply-To: Message-ID: <6968bc0b3116061f68f4.1194565727@kyon> # HG changeset patch # User Kaitlin Rupert # Date 1194555111 28800 # Node ID 6968bc0b3116061f68f467bc827e42ac853e2a7b # Parent 4e195b6654d5fcdbc51252617f64ae7ce7079778 Add new HostedService association provider. This association supports: HostSystem -> RPCS, VSMS. RPCS -> HostSystem VSMS -> HostSystem Signed-off-by: Kaitlin Rupert diff -r 4e195b6654d5 -r 6968bc0b3116 src/Virt_HostedService.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_HostedService.c Thu Nov 08 12:51:51 2007 -0800 @@ -0,0 +1,174 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Kaitlin Rupert + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include + +#include +#include +#include + +#include "libcmpiutil.h" +#include "std_association.h" +#include "misc_util.h" + +#include "Virt_HostSystem.h" +#include "Virt_VirtualSystemManagementService.h" +#include "Virt_ResourcePoolConfigurationService.h" + +const static CMPIBroker *_BROKER; + +static CMPIStatus service_to_host(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s; + CMPIInstance *instance; + + s = get_host_cs(_BROKER, ref, &instance); + if (s.rc == CMPI_RC_OK) + inst_list_add(list, instance); + + return s; +} + +static CMPIStatus host_to_service(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst; + + s = rpcs_instance(ref, &inst, _BROKER); + if (s.rc != CMPI_RC_OK) + return s; + if (!CMIsNullObject(inst)) + inst_list_add(list, inst); + + s = get_vsms(ref, &inst, _BROKER, 0); + if (s.rc != CMPI_RC_OK) + return s; + if (!CMIsNullObject(inst)) + inst_list_add(list, inst); + + return s; +} + +static CMPIInstance *make_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst, + struct std_assoc_info *info, + struct std_assoc *assoc) +{ + CMPIInstance *refinst = NULL; + char *base; + + base = class_base_name(assoc->assoc_class); + if (base == NULL) + goto out; + + refinst = get_typed_instance(_BROKER, + base, + NAMESPACE(ref)); + + if (refinst != NULL) { + CMPIObjectPath *instop; + + instop = CMGetObjectPath(inst, NULL); + + set_reference(assoc, refinst, ref, instop); + } + +out: + return refinst; +} + +static struct std_assoc xen_host_to_service = { + .source_class = "Xen_HostSystem", + .source_prop = "Antecedent", + + .target_class = "CIM_ManagedElement", + .target_prop = "Dependent", + + .assoc_class = "CIM_HostedService", + + .handler = host_to_service, + .make_ref = make_ref +}; + +static struct std_assoc xen_service_to_host = { + .source_class = "CIM_Service", + .source_prop = "Dependent", + + .target_class = "CIM_ManagedElement", + .target_prop = "Antecedent", + + .assoc_class = "CIM_HostedService", + + .handler = service_to_host, + .make_ref = make_ref +}; + +static struct std_assoc kvm_host_to_service = { + .source_class = "KVM_HostSystem", + .source_prop = "Antecedent", + + .target_class = "CIM_Service", + .target_prop = "Dependent", + + .assoc_class = "CIM_HostedService", + + .handler = host_to_service, + .make_ref = make_ref +}; + +static struct std_assoc kvm_service_to_host = { + .source_class = "CIM_Service", + .source_prop = "Dependent", + + .target_class = "KVM_ComputerSystem", + .target_prop = "Antecedent", + + .assoc_class = "CIM_HostedService", + + .handler = service_to_host, + .make_ref = make_ref +}; + +static struct std_assoc *handlers[] = { + &xen_host_to_service, + &xen_service_to_host, + &kvm_host_to_service, + &kvm_service_to_host, + NULL +}; + +STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, CMNoHook, handlers); + +/* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:48:46 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:48:46 -0800 Subject: [Libvirt-cim] [PATCH 0 of 5] Adding support for the HostedService association provider. Message-ID: This patch set adds support for the HostedService association. This include changes needed in the VSMS and RPCS providers so that their internal get instance functions could be called. From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:48:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:48:49 -0800 Subject: [Libvirt-cim] [PATCH 3 of 5] Add a new mof and registration file for the HostedService provider In-Reply-To: Message-ID: <151bc006918bfcce7619.1194565729@kyon> # HG changeset patch # User Kaitlin Rupert # Date 1194555339 28800 # Node ID 151bc006918bfcce761944dbe2397191a535a2dc # Parent e47094a1620c4215427afaa46faedee97bcd123a Add a new mof and registration file for the HostedService provider. Signed-off-by: Kaitlin Rupert diff -r e47094a1620c -r 151bc006918b schema/HostedService.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/HostedService.mof Thu Nov 08 12:55:39 2007 -0800 @@ -0,0 +1,6 @@ +// Copyright IBM Corp. 2007 +class Xen_HostedService : CIM_HostedService { +}; + +class KVM_HostedService : CIM_HostedService { +}; diff -r e47094a1620c -r 151bc006918b schema/HostedService.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/HostedService.registration Thu Nov 08 12:55:39 2007 -0800 @@ -0,0 +1,4 @@ +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes ... +Xen_HostedService root/ibmsd Xen_HostedServiceProvider Virt_HostedService association +KVM_HostedService root/ibmsd KVM_HostedServiceProvider Virt_HostedService association From kaitlin at linux.vnet.ibm.com Thu Nov 8 23:59:40 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 08 Nov 2007 15:59:40 -0800 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: References: Message-ID: <4733A2EC.5040406@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194557532 18000 > # Node ID cf0a2938ba0b9d2e7af8a5790d0e56cc7564df73 > # Parent 2d09468e2de7ed9194907bfff1efbb16ba40202d > Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point. > Signed-off-by: Jay Gagnon > > + > + inst = get_typed_instance(_BROKER, "AllocationCapabilities", > + NAMESPACE(ref)); > + CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars); > + > + ret = cu_get_u16_path(ref, "ResourceType", &type); > + if (ret != 1) { > + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, > + "Could not get ResourceType."); > + goto out; > + } > + CMSetProperty(inst, "ResourceType", &type, CMPI_uint16); > + > + inst_list_add(list, inst); > + > + out: > + free(inst_id); > + > + return s; > +} > > Just a nit-picky thing here... why not call the AllocCapabilities function that setups the instance? I think using the same InstanceID for the AllocCapa as the pool might not always return the correct instance because AllocCapa uses /0 as the InstanceID. But something like the NetworkingPool returns "NetworkPool/xenbr0". So you'll be creating an instance with "NetworkPool/xenbr0" as the InstanceID, which would conflict with what EnumInstances from AllocCapa would return. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 9 01:05:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:05:28 -0800 Subject: [Libvirt-cim] [PATCH 4 of 5] Fix rpcs_instance() call so other providers can call it In-Reply-To: <34e8e0d331e42f425453.1194565730@kyon> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 15:48:50 -0800") References: <34e8e0d331e42f425453.1194565730@kyon> Message-ID: <87640cxm7b.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1194558008 28800 KR> # Node ID 34e8e0d331e42f42545342dd765d35ee66aabd56 KR> # Parent 151bc006918bfcce761944dbe2397191a535a2dc KR> Fix rpcs_instance() call so other providers can call it. Applied, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 01:11:37 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:11:37 -0800 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: <4733A2EC.5040406@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 15:59:40 -0800") References: <4733A2EC.5040406@linux.vnet.ibm.com> Message-ID: <871wb0xlx2.fsf@theine.beaverton.ibm.com> KR> Just a nit-picky thing here... why not call the AllocCapabilities KR> function that setups the instance? I think using the same KR> InstanceID for the AllocCapa as the pool might not always return KR> the correct instance because AllocCapa uses /0 as the KR> InstanceID. But something like the NetworkingPool returns KR> "NetworkPool/xenbr0". So you'll be creating an instance with KR> "NetworkPool/xenbr0" as the InstanceID, which would conflict with KR> what EnumInstances from AllocCapa would return. I think AllocationCapabilities needs to change here. It think using the InstanceID from the pool makes the most sense. I'm not sure what the existing AllocationCapabilities stuff intended, but I'm assuming it will need to change to match this new stuff. Perhaps it was a hold-over from the days of one-pool-per-resource-type? Good catch, by the way :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 01:14:04 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:14:04 -0800 Subject: [Libvirt-cim] [PATCH 5 of 5] Fix _get_vsms() call so other providers can call it In-Reply-To: <1fc24e24237efa5ea495.1194565731@kyon> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 15:48:51 -0800") References: <1fc24e24237efa5ea495.1194565731@kyon> Message-ID: <87wsssw78j.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1194558013 28800 KR> # Node ID 1fc24e24237efa5ea495b48c2beb8bb10afc2270 KR> # Parent 34e8e0d331e42f42545342dd765d35ee66aabd56 KR> Fix _get_vsms() call so other providers can call it. Looks good, applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 01:15:08 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:15:08 -0800 Subject: [Libvirt-cim] [PATCH 3 of 5] Add a new mof and registration file for the HostedService provider In-Reply-To: <151bc006918bfcce7619.1194565729@kyon> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 15:48:49 -0800") References: <151bc006918bfcce7619.1194565729@kyon> Message-ID: <87sl3gw76r.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1194555339 28800 KR> # Node ID 151bc006918bfcce761944dbe2397191a535a2dc KR> # Parent e47094a1620c4215427afaa46faedee97bcd123a KR> Add a new mof and registration file for the HostedService provider. Applied. I'll need to make sure I add this to my namespace change patch :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 01:17:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:17:06 -0800 Subject: [Libvirt-cim] [PATCH 2 of 5] Adding support to build and install Virt_HostedService provider In-Reply-To: (Kaitlin Rupert's message of "Thu, 08 Nov 2007 15:48:48 -0800") References: Message-ID: <87ode4w73h.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1194555199 28800 KR> # Node ID e47094a1620c4215427afaa46faedee97bcd123a KR> # Parent 6968bc0b3116061f68f467bc827e42ac853e2a7b KR> Adding support to build and install Virt_HostedService provider. Applied. KR> Also fixed the missing \ after KR> schema/ResourceAllocationFromPool.registration in Makefile.am. Excellent, thanks! I'm surprised that hasn't broken anything by now... -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 01:22:53 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:22:53 -0800 Subject: [Libvirt-cim] [PATCH 1 of 5] Add new HostedService association provider In-Reply-To: <6968bc0b3116061f68f4.1194565727@kyon> (Kaitlin Rupert's message of "Thu, 08 Nov 2007 15:48:47 -0800") References: <6968bc0b3116061f68f4.1194565727@kyon> Message-ID: <87k5osw6tu.fsf@theine.beaverton.ibm.com> KR> +static CMPIStatus host_to_service(const CMPIObjectPath *ref, KR> + struct std_assoc_info *info, KR> + struct inst_list *list) KR> +{ KR> + CMPIStatus s = {CMPI_RC_OK, NULL}; KR> + CMPIInstance *inst; KR> + KR> + s = rpcs_instance(ref, &inst, _BROKER); KR> + if (s.rc != CMPI_RC_OK) KR> + return s; KR> + if (!CMIsNullObject(inst)) KR> + inst_list_add(list, inst); KR> + KR> + s = get_vsms(ref, &inst, _BROKER, 0); Hmm, I didn't notice in the earlier patch (since it was just a unstaticification of an existing function) but the fourth parameter to get_vsms() isn't used for anything, so we should remove it. Looks good other than that. I'll apply and cook up a patch to remove the extraneous parameter. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 00:30:59 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 08 Nov 2007 17:30:59 -0700 Subject: [Libvirt-cim] [PATCH] Remove unused parameter from get_vsms() Message-ID: <7ca1a71de7d47452ea49.1194571859@theine> # HG changeset patch # User Dan Smith # Date 1194571829 28800 # Node ID 7ca1a71de7d47452ea49c6be5f11365b9bb6a947 # Parent 691b1ebbe2adc285c31006f71a3abc702c268add Remove unused parameter from get_vsms() Signed-off-by: Dan Smith diff -r 691b1ebbe2ad -r 7ca1a71de7d4 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Thu Nov 08 12:51:51 2007 -0800 +++ b/src/Virt_HostedService.c Thu Nov 08 17:30:29 2007 -0800 @@ -63,7 +63,7 @@ static CMPIStatus host_to_service(const if (!CMIsNullObject(inst)) inst_list_add(list, inst); - s = get_vsms(ref, &inst, _BROKER, 0); + s = get_vsms(ref, &inst, _BROKER); if (s.rc != CMPI_RC_OK) return s; if (!CMIsNullObject(inst)) diff -r 691b1ebbe2ad -r 7ca1a71de7d4 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Thu Nov 08 12:51:51 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Thu Nov 08 17:30:29 2007 -0800 @@ -995,8 +995,7 @@ STDIM_MethodMIStub(, Virt_VirtualSystemM CMPIStatus get_vsms(const CMPIObjectPath *reference, CMPIInstance **_inst, - const CMPIBroker *broker, - int name_only) + const CMPIBroker *broker) { CMPIStatus s; CMPIInstance *inst; @@ -1057,7 +1056,7 @@ static CMPIStatus return_vsms(const CMPI CMPIInstance *inst; CMPIStatus s; - s = get_vsms(reference, &inst, _BROKER, name_only); + s = get_vsms(reference, &inst, _BROKER); if (s.rc != CMPI_RC_OK) goto out; @@ -1099,7 +1098,7 @@ static CMPIStatus GetInstance(CMPIInstan CMPIStatus s; const char *prop; - s = get_vsms(ref, &inst, _BROKER, 0); + s = get_vsms(ref, &inst, _BROKER); if (s.rc != CMPI_RC_OK) return s; diff -r 691b1ebbe2ad -r 7ca1a71de7d4 src/Virt_VirtualSystemManagementService.h --- a/src/Virt_VirtualSystemManagementService.h Thu Nov 08 12:51:51 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.h Thu Nov 08 17:30:29 2007 -0800 @@ -21,5 +21,4 @@ CMPIStatus get_vsms(const CMPIObjectPath *reference, CMPIInstance **_inst, - const CMPIBroker *broker, - int name_only); + const CMPIBroker *broker); From veillard at redhat.com Fri Nov 9 09:03:03 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 9 Nov 2007 04:03:03 -0500 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: <87mytoxpb1.fsf@theine.beaverton.ibm.com> References: <0ed8747c1dfbf14ff7f6.1194558684@wulfgar> <87mytoxpb1.fsf@theine.beaverton.ibm.com> Message-ID: <20071109090303.GC2244@redhat.com> On Thu, Nov 08, 2007 at 03:58:26PM -0800, Dan Smith wrote: > JG> + uint16_t num_nics = 6; > JG> + struct sdc_rasd_prop *rasd = NULL; > JG> + > JG> + struct sdc_rasd_prop tmp[] = { > JG> + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, > JG> + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, > JG> + PROP_END > JG> + }; > > The maximum NIC count is probably different for KVM and Xen, and I > imagine this function should be intelligent in the future. Could we > at least pull the '6' out to a constant like XEN_MAX_VIF or something? As that bug points out, 6 sounds dangerously low for a virtual interface: https://bugzilla.redhat.com/show_bug.cgi?id=273421 Any chance to also increase this at least up to 32 ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From veillard at redhat.com Fri Nov 9 09:12:53 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 9 Nov 2007 04:12:53 -0500 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt In-Reply-To: <90ffd19dda747eb615f1.1194559003@theine> References: <90ffd19dda747eb615f1.1194559003@theine> Message-ID: <20071109091253.GD2244@redhat.com> On Thu, Nov 08, 2007 at 01:56:43PM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194558864 28800 > # Node ID 90ffd19dda747eb615f12b10aa04e4f9bc978b31 > # Parent 114b074cb5e710e6c3613ca89edf205bbf945d4c > Change installed namespace to root/virt > > This one deserves some serious testing, although I was pleasantly surprised > at how few instances of the namespace we had hard-coded. We could probably > use a configure flag to set the namespace, but the schema files would all > have to change before it would work, so I'm not sure it's worth it. > > Signed-off-by: Dan Smith > > diff -r 114b074cb5e7 -r 90ffd19dda74 Makefile.am > --- a/Makefile.am Thu Nov 08 12:47:38 2007 -0800 > +++ b/Makefile.am Thu Nov 08 13:54:24 2007 -0800 > @@ -81,11 +81,11 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk > # Un/Register the providers and class definitions from/to the current CIMOM. > # @CIMSERVER@ is set by the configure script > postinstall: > - sh provider-register.sh -v -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) > + sh provider-register.sh -v -t @CIMSERVER@ -n /root/virt -r $(REGS) -m $(MOFS) > sh provider-register.sh -v -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) In general root's home does not sound the proper place for storing system data, is there really no way to put this somewhere under /var instead ? The part below seems unrelated to the namespace change :-) but fine by me > diff -r 114b074cb5e7 -r 90ffd19dda74 doc/Makefile.am > --- a/doc/Makefile.am Thu Nov 08 12:47:38 2007 -0800 > +++ b/doc/Makefile.am Thu Nov 08 13:54:24 2007 -0800 > @@ -1,6 +1,8 @@ XSLTPROC = /usr/bin/xsltproc > XSLTPROC = /usr/bin/xsltproc > > WEB_PAGES = index.html > + > +EXTRA_DIST = site.xsl libvirt-cim.html Any chance to also add all the generated HTML pages ? That way we are sure the package will include the documentation in its final form, and even if xsltproc is not installed "make install" will suceed. We also need to initialize $(XSLTPROC) with a configure check if possible > $(WEB_PAGES): libvirt-cim.html site.xsl > $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html > diff -r 114b074cb5e7 -r 90ffd19dda74 doc/libvirt-cim.html [...] > @@ -142,7 +142,7 @@ static bool async_ind(CMPIContext *conte > CMPIStatus s; > const char *type_name; > char *type_cn = NULL; > - const char *ns = "root/ibmsd"; > + const char *ns = "root/virt"; > > /* FIXME: Hmm, need to get the namespace a better way */ > > diff -r 114b074cb5e7 -r 90ffd19dda74 src/Virt_ElementConformsToProfile.c > --- a/src/Virt_ElementConformsToProfile.c Thu Nov 08 12:47:38 2007 -0800 > +++ b/src/Virt_ElementConformsToProfile.c Thu Nov 08 13:54:24 2007 -0800 > @@ -64,7 +64,7 @@ static CMPIStatus elem_instances(const C > goto out; > } > > - op = CMNewObjectPath(_BROKER, "/root/ibmsd", classname, &s); > + op = CMNewObjectPath(_BROKER, "/root/virt", classname, &s); > if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) > goto error; Can't this go under $(datadir)/libvirt-cim ? If we could export this from config.h as a define I guess that would be perfect. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Fri Nov 9 14:28:32 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 06:28:32 -0800 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: <20071109090303.GC2244@redhat.com> (Daniel Veillard's message of "Fri, 9 Nov 2007 04:03:03 -0500") References: <0ed8747c1dfbf14ff7f6.1194558684@wulfgar> <87mytoxpb1.fsf@theine.beaverton.ibm.com> <20071109090303.GC2244@redhat.com> Message-ID: <87fxzfwl0v.fsf@theine.beaverton.ibm.com> DV> Any chance to also increase this at least up to 32 ? Last I checked, Xen had a hard limit due to a ringbuffer sizing issue or something; has this changed? We were planning to try to expose this limit (adjusted per platform) to the client. Note that this is an advertised maximum that is not strictly enforced. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 14:37:02 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 06:37:02 -0800 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt In-Reply-To: <20071109091253.GD2244@redhat.com> (Daniel Veillard's message of "Fri, 9 Nov 2007 04:12:53 -0500") References: <90ffd19dda747eb615f1.1194559003@theine> <20071109091253.GD2244@redhat.com> Message-ID: <87bqa3wkmp.fsf@theine.beaverton.ibm.com> DV> In general root's home does not sound the proper place for DV> storing system data, is there really no way to put this somewhere DV> under /var instead ? Okay, we're not *that* dumb :) The namespace is a CIM concept used to separate providers, which must be "/root/something". It's part of the URI used to make CIM queries. On a Pegasus box, this actually translates to $PEGASUS/repository/root/virt, where $PEGASUS is /var/lib/Pegasus (on most machines). DV> The part below seems unrelated to the namespace change :-) but fine by me Yes, thanks for that. It was supposed to be part of the rpm patch, but I leaked this hunk into the namespace patch :) DV> Any chance to also add all the generated HTML pages ? That way we DV> are sure the package will include the documentation in its final DV> form, and even if xsltproc is not installed "make install" will DV> suceed. Yep, that's fine. I guess I just need to make sure that the web pages get build as part of a normal build and installed appropriately. I've been focusing on getting the schema installation to work, but I can do this too. DV> We also need to initialize $(XSLTPROC) with a configure check if DV> possible Okay, I'm not familiar with what the options for XSLTPROC are, but I'll look at its pkg-config info for that. DV> If we could export this from config.h as a define I guess that DV> would be perfect. Yes, I can do that too. As I said in the log message, there are 62 schema files that you have to touch if you ever had to change it again, so a couple of source files aren't a big deal. However, I guess it *should* be in configure, so I'll add it :) Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Fri Nov 9 14:56:22 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 9 Nov 2007 09:56:22 -0500 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt In-Reply-To: <87bqa3wkmp.fsf@theine.beaverton.ibm.com> References: <90ffd19dda747eb615f1.1194559003@theine> <20071109091253.GD2244@redhat.com> <87bqa3wkmp.fsf@theine.beaverton.ibm.com> Message-ID: <20071109145621.GG2244@redhat.com> On Fri, Nov 09, 2007 at 06:37:02AM -0800, Dan Smith wrote: > DV> In general root's home does not sound the proper place for > DV> storing system data, is there really no way to put this somewhere > DV> under /var instead ? > > Okay, we're not *that* dumb :) > > The namespace is a CIM concept used to separate providers, which must > be "/root/something". It's part of the URI used to make CIM queries. > On a Pegasus box, this actually translates to > $PEGASUS/repository/root/virt, where $PEGASUS is /var/lib/Pegasus (on > most machines). I had an epidermic reaction, I didn't check further, my bad :-) Still even in the XML space people always wonder if they can dereference the namespace name to get extra informatiosn, I bet I won't be the only one confused by /root/... Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From grendel at linux.vnet.ibm.com Fri Nov 9 15:18:47 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 10:18:47 -0500 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: <87abpoz8hi.fsf@theine.beaverton.ibm.com> References: <87abpoz8hi.fsf@theine.beaverton.ibm.com> Message-ID: <47347A57.20309@linux.vnet.ibm.com> Dan Smith wrote: > JG> # HG changeset patch > JG> # User Jay Gagnon > JG> # Date 1194557266 18000 > JG> # Node ID fd6deb234772b44fe549a3513a47115a01e20f7d > JG> # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 > JG> Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree. > > This one looks pretty straightforward. It looks like we could apply > this one independently if we wanted to, right? A rather > self-contained change, considering the size of the rest of the set. > This sets up the new function header for all the callbacks. I think it can be applied separately in that it can be applied before the other ones, but if we are going to put those in then this one will have to be there. Did that answer the question? > JG> + if (!ret) { > JG> + cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, > JG> + "Could not copy RASD."); > JG> + } > > This is a total nit, so forgive my OCD, but I think that everywhere > else, the style of a cu_statusf() call is: > > cu_statusf(broker, status, > CMPI_RC_ERR_FOO, > "Error message", [opt if short, else newline], > [opt]); > > Could I convince you to change these? :) > Yea, no prob. -- -Jay From grendel at linux.vnet.ibm.com Fri Nov 9 15:21:37 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 10:21:37 -0500 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: <47339EAB.5020007@linux.vnet.ibm.com> References: <47339EAB.5020007@linux.vnet.ibm.com> Message-ID: <47347B01.9050803@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Jay Gagnon wrote: >> # HG changeset patch >> # User Jay Gagnon >> # Date 1194557266 18000 >> # Node ID fd6deb234772b44fe549a3513a47115a01e20f7d >> # Parent bd1b1067d106ecc1546c3b2436a43f59f8eaba15 >> Turns out that the sdc_rasd_prop functions might need to report >> status or see the passed in reference. This updates the typedef and >> the memory functions, since those are already in the tree. >> Signed-off-by: Jay Gagnon >> >> >> > Why is the ref param needed here? Is that something you'll be adding > later? > For the most part, the ref param is unneeded, but some of the callbacks (disk_max for example) need to look at the ref to determine which Pool they are being asked about. All of the callbacks need to have the same header because the sdc_rasd struct stores function pointers for the callbacks and I really didn't want to do it as the always foreboding (void *). -- -Jay From grendel at linux.vnet.ibm.com Fri Nov 9 15:28:20 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 10:28:20 -0500 Subject: [Libvirt-cim] [PATCH 3 of 6] Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional In-Reply-To: <871wb0z7tq.fsf@theine.beaverton.ibm.com> References: <94308147bed1693443d0.1194558683@wulfgar> <871wb0z7tq.fsf@theine.beaverton.ibm.com> Message-ID: <47347C94.6060806@linux.vnet.ibm.com> Dan Smith wrote: > JG> # HG changeset patch > JG> # User Jay Gagnon > JG> # Date 1194557358 18000 > JG> # Node ID 94308147bed1693443d0741de6a30c5b0f77b0f1 > JG> # Parent 543a0790d8615551153950de8f2f2fe3de107cf3 > JG> Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional. > > I think this looks okay, but: > > JG> +#define SDC_DISK_MIN 2000 > JG> +#define SDC_DISK_DEF 5000 > > Why not make the increment amount also parameterized as such? Seems > like a valid thing to want to change. Unlikely, but valid :) > > Sure, that's fine. With those two being defined as constants for disk it's logical to define the last one as well, for organizational purposes. That said, the next logical question could be, "Why aren't the other numbers all defines as well?" My answer to that is, as a habit I tend to only make things that are (or in this case, will be) used in more than one place, defines. The way I see it, if I only use a number once, having it as a define doesn't get me very far, because the define really just creates a level of "indirection" for whomever decides the value needs to be changed. As soon as the number is used twice, you of course need a define so that nobody has to root out all instances of the value, but for one-time-use-only values I don't generally bother with defines. This is a pretty good case for an exception to the rule, though, since the lack of an INC define could be misleading. -- -Jay From danms at us.ibm.com Fri Nov 9 15:31:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 07:31:00 -0800 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: <47347B01.9050803@linux.vnet.ibm.com> (Jay Gagnon's message of "Fri, 09 Nov 2007 10:21:37 -0500") References: <47339EAB.5020007@linux.vnet.ibm.com> <47347B01.9050803@linux.vnet.ibm.com> Message-ID: <877ikrwi4r.fsf@theine.beaverton.ibm.com> JG> All of the callbacks need to have the same header because the JG> sdc_rasd struct stores function pointers for the callbacks Right, you're doing the correct thing here, IMHO. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Fri Nov 9 15:33:19 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 10:33:19 -0500 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: <87ir4cxotd.fsf@theine.beaverton.ibm.com> References: <2d09468e2de7ed919490.1194558685@wulfgar> <87ir4cxotd.fsf@theine.beaverton.ibm.com> Message-ID: <47347DBF.6060603@linux.vnet.ibm.com> Dan Smith wrote: > JG> + cpuinfo = fopen("/proc/cpuinfo", "r"); > > This should come from virNodeInfo. Okay. Only question before I do that is do we have virNodeInfo in all the versions of libvirt we support? The only reason I had to write this myself at all is that the libvirt function that determines the maximum number of vcpus came in too late for us. > Also, it would be good to go ahead > and split out the "how many vcpus is the max for xen?" behavior into a > separate function, because it's possible that other platforms will be > able to overcommit vcpus. This might be a good place to start making > it clear that the behavior is platform-dependent. I think it's okay > to always take the Xen default for the time being, but while you're > reworking this, you might as well split it out too. > So for now proc_max will basically just call xen_proc_max but in the future we might need to check the ref and add another function? If that's what you meant, that's fine. -- -Jay From danms at us.ibm.com Fri Nov 9 15:34:38 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 07:34:38 -0800 Subject: [Libvirt-cim] [PATCH 3 of 6] Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional In-Reply-To: <47347C94.6060806@linux.vnet.ibm.com> (Jay Gagnon's message of "Fri, 09 Nov 2007 10:28:20 -0500") References: <94308147bed1693443d0.1194558683@wulfgar> <871wb0z7tq.fsf@theine.beaverton.ibm.com> <47347C94.6060806@linux.vnet.ibm.com> Message-ID: <873avfwhyp.fsf@theine.beaverton.ibm.com> JG> The way I see it, if I only use a number once, having it as a JG> define doesn't get me very far, because the define really just JG> creates a level of "indirection" for whomever decides the value JG> needs to be changed. As soon as the number is used twice, you of JG> course need a define so that nobody has to root out all instances JG> of the value, but for one-time-use-only values I don't generally JG> bother with defines. Well, even if something is only used once, it makes it easier to change something into a configure option if it already has that layer of indirection in place. It also means that someone can easily open the file, see that the limits are all defined at the top, and not bother to understand the rest of the function pointer indirection (which would be harder to follow without context than the #defines anyway). The only things that I think make sense to leave buried are things like increment for NICs, since it's very clear that adding one NIC will always be the desired granularity, which can't be said for disk or memory, IMHO. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Fri Nov 9 15:39:42 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 10:39:42 -0500 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: <87mytoxpb1.fsf@theine.beaverton.ibm.com> References: <0ed8747c1dfbf14ff7f6.1194558684@wulfgar> <87mytoxpb1.fsf@theine.beaverton.ibm.com> Message-ID: <47347F3E.6010506@linux.vnet.ibm.com> Dan Smith wrote: > JG> + uint16_t num_nics = 6; > JG> + struct sdc_rasd_prop *rasd = NULL; > JG> + > JG> + struct sdc_rasd_prop tmp[] = { > JG> + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, > JG> + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, > JG> + PROP_END > JG> + }; > > The maximum NIC count is probably different for KVM and Xen, and I > imagine this function should be intelligent in the future. Could we > at least pull the '6' out to a constant like XEN_MAX_VIF or something? > > I agree that this should probably be made intelligent in the future, but as I said with regards to the disk patch, I don't necessarily see the point to making this a defined constant unless we need to use it elsewhere or we actually add a hardcoded value for KVM. As it is right now, the value is only ever assigned in that initialization line and only ever read four lines later, and its use seems clear enough that a named constant won't be adding any clarity. Not a huge deal, and, "Yea, that's a good point. Make it a define," is a fine response here, but that's my opinion on the matter. -- -Jay From danms at us.ibm.com Fri Nov 9 15:10:51 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 08:10:51 -0700 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt Message-ID: <581a0f3fb078ccb00337.1194624651@theine> # HG changeset patch # User Dan Smith # Date 1194624608 28800 # Node ID 581a0f3fb078ccb003378d6d5974f5fe4636f123 # Parent 08753448b529043c78b24ebb019485761d8c6d4c Change installed namespace to root/virt - Made namespace a configure option for the source build - Made Makefile postinstall use namespace variable - Updated for HostedService recent addition This one deserves some serious testing, although I was pleasantly surprised at how few instances of the namespace we had hard-coded. We could probably Signed-off-by: Dan Smith diff -r 08753448b529 -r 581a0f3fb078 Makefile.am --- a/Makefile.am Thu Nov 08 19:19:50 2007 -0800 +++ b/Makefile.am Fri Nov 09 08:10:08 2007 -0800 @@ -83,11 +83,11 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk # Un/Register the providers and class definitions from/to the current CIMOM. # @CIMSERVER@ is set by the configure script postinstall: - sh provider-register.sh -v -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) + sh provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(REGS) -m $(MOFS) sh provider-register.sh -v -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) preuninstall: - sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/ibmsd -r $(REGS) -m $(MOFS) + sh provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(REGS) -m $(MOFS) sh provider-register.sh -v -d -t @CIMSERVER@ -n /root/interop -r $(INTEROP_REGS) -m $(INTEROP_MOFS) rpm: clean diff -r 08753448b529 -r 581a0f3fb078 configure.ac --- a/configure.ac Thu Nov 08 19:19:50 2007 -0800 +++ b/configure.ac Fri Nov 09 08:10:08 2007 -0800 @@ -34,6 +34,14 @@ AC_ARG_VAR([LIBVIRTDIR],[the directory w AC_ARG_VAR([LIBVIRTDIR],[the directory where the libvirt package is installed.]) AC_ARG_VAR([TESTSUITEDIR],[the directory where the SBLIM testsuite is installed. ]) + +AC_ARG_WITH([namespace], + AC_HELP_STRING([--with-namespace=ns], + [CIM namespace to use, default root/virt]), + [test "x$withval" != "x" && CIM_VIRT_NS="$withval"], + [CIM_VIRT_NS="root/virt"]) +AC_SUBST(CIM_VIRT_NS) +AC_DEFINE_UNQUOTED(CIM_VIRT_NS, "$CIM_VIRT_NS", [Namespace for provider source]) AC_ARG_WITH([diskconfig], [ --with-diskconfig=PATH Set config file for disk pool. (default=/tmp/diskpool.conf)], diff -r 08753448b529 -r 581a0f3fb078 doc/libvirt-cim.html --- a/doc/libvirt-cim.html Thu Nov 08 19:19:50 2007 -0800 +++ b/doc/libvirt-cim.html Fri Nov 09 08:10:08 2007 -0800 @@ -73,9 +73,9 @@ $ mkdir cim216
$ cd cim216
$ unzip $PATH_TO_ZIPFILE
- $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd cimv216.mof
- $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd qualifiers.mof
- $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/ibmsd qualifiers_optional.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof

To install the schema in SFCB:

diff -r 08753448b529 -r 581a0f3fb078 schema/AllocationCapabilities.registration --- a/schema/AllocationCapabilities.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/AllocationCapabilities.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_AllocationCapabilities root/ibmsd Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance -KVM_AllocationCapabilities root/ibmsd Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance +Xen_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance +KVM_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance diff -r 08753448b529 -r 581a0f3fb078 schema/ComputerSystem.registration --- a/schema/ComputerSystem.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ComputerSystem.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ComputerSystem root/ibmsd Virt_ComputerSystemProvider Virt_ComputerSystem instance method +Xen_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance method # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_ComputerSystem root/ibmsd Virt_ComputerSystemProvider Virt_ComputerSystem instance +KVM_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance diff -r 08753448b529 -r 581a0f3fb078 schema/ComputerSystemIndication.registration --- a/schema/ComputerSystemIndication.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ComputerSystemIndication.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 -Xen_ComputerSystemCreatedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method -Xen_ComputerSystemDeletedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method -KVM_ComputerSystemCreatedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method -KVM_ComputerSystemDeletedIndication root/ibmsd Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +Xen_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +Xen_ComputerSystemDeletedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +KVM_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method +KVM_ComputerSystemDeletedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method diff -r 08753448b529 -r 581a0f3fb078 schema/DiskPool.registration --- a/schema/DiskPool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/DiskPool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,2 +1,2 @@ Xen_DiskPool root/ibmsd Virt_DevicePoolP -Xen_DiskPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance -KVM_DiskPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +Xen_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance +KVM_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r 08753448b529 -r 581a0f3fb078 schema/ElementAllocatedFromPool.registration --- a/schema/ElementAllocatedFromPool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ElementAllocatedFromPool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ElementAllocatedFromPool root/ibmsd Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association -KVM_ElementAllocatedFromPool root/ibmsd KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association \ No newline at end of file +Xen_ElementAllocatedFromPool root/virt Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association +KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association \ No newline at end of file diff -r 08753448b529 -r 581a0f3fb078 schema/ElementConformsToProfile.registration --- a/schema/ElementConformsToProfile.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ElementConformsToProfile.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,7 +1,7 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -#Xen_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association +#Xen_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association Xen_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association # Classname Namespace ProviderName ProviderModule ProviderTypes ... -#KVM_ElementConformsToProfile root/ibmsd Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association +#KVM_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association KVM_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association diff -r 08753448b529 -r 581a0f3fb078 schema/EnabledLogicalElementCapabilities.registration --- a/schema/EnabledLogicalElementCapabilities.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/EnabledLogicalElementCapabilities.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_EnabledLogicalElementCapabilities root/ibmsd Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance +Xen_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_EnabledLogicalElementCapabilities root/ibmsd Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance +KVM_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance diff -r 08753448b529 -r 581a0f3fb078 schema/HostSystem.registration --- a/schema/HostSystem.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/HostSystem.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_HostSystem root/ibmsd Virt_HostSystemProvider Virt_HostSystem instance +Xen_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_HostSystem root/ibmsd Virt_HostSystemProvider Virt_HostSystem instance +KVM_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance diff -r 08753448b529 -r 581a0f3fb078 schema/HostedDependency.registration --- a/schema/HostedDependency.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/HostedDependency.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_HostedDependency root/ibmsd Virt_HostedDependencyProvider Virt_HostedDependency association +Xen_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_HostedDependency root/ibmsd Virt_HostedDependencyProvider Virt_HostedDependency association +KVM_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association diff -r 08753448b529 -r 581a0f3fb078 schema/HostedResourcePool.registration --- a/schema/HostedResourcePool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/HostedResourcePool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_HostedResourcePool root/ibmsd Virt_HostedResourcePoolProvider Virt_HostedResourcePool association -KVM_HostedResourcePool root/ibmsd Virt_HostedResourcePoolProvider Virt_HostedResourcePool association \ No newline at end of file +Xen_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association +KVM_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association \ No newline at end of file diff -r 08753448b529 -r 581a0f3fb078 schema/HostedService.registration --- a/schema/HostedService.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/HostedService.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_HostedService root/ibmsd Xen_HostedServiceProvider Virt_HostedService association -KVM_HostedService root/ibmsd KVM_HostedServiceProvider Virt_HostedService association +Xen_HostedService root/virt Xen_HostedServiceProvider Virt_HostedService association +KVM_HostedService root/virt KVM_HostedServiceProvider Virt_HostedService association diff -r 08753448b529 -r 581a0f3fb078 schema/LogicalDisk.registration --- a/schema/LogicalDisk.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/LogicalDisk.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_LogicalDisk root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_LogicalDisk root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance diff -r 08753448b529 -r 581a0f3fb078 schema/Memory.registration --- a/schema/Memory.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/Memory.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_Memory root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_Memory root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_Memory root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_Memory root/virt Virt_DeviceProvider Virt_Device instance diff -r 08753448b529 -r 581a0f3fb078 schema/MemoryPool.registration --- a/schema/MemoryPool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/MemoryPool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_MemoryPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +Xen_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_MemoryPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +KVM_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r 08753448b529 -r 581a0f3fb078 schema/NetPool.registration --- a/schema/NetPool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/NetPool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_NetworkPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance -KVM_NetworkPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance \ No newline at end of file +Xen_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance +KVM_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance \ No newline at end of file diff -r 08753448b529 -r 581a0f3fb078 schema/NetworkPort.registration --- a/schema/NetworkPort.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/NetworkPort.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_NetworkPort root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_NetworkPort root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance diff -r 08753448b529 -r 581a0f3fb078 schema/Processor.registration --- a/schema/Processor.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/Processor.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_Processor root/ibmsd Virt_DeviceProvider Virt_Device instance +Xen_Processor root/virt Virt_DeviceProvider Virt_Device instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_Processor root/ibmsd Virt_DeviceProvider Virt_Device instance +KVM_Processor root/virt Virt_DeviceProvider Virt_Device instance diff -r 08753448b529 -r 581a0f3fb078 schema/ProcessorPool.registration --- a/schema/ProcessorPool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ProcessorPool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ProcessorPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +Xen_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_ProcessorPool root/ibmsd Virt_DevicePoolProvider Virt_DevicePool instance +KVM_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r 08753448b529 -r 581a0f3fb078 schema/ResourceAllocationFromPool.registration --- a/schema/ResourceAllocationFromPool.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ResourceAllocationFromPool.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ResourceAllocationFromPool root/ibmsd Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association -KVM_ResourceAllocationFromPool root/ibmsd KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file +Xen_ResourceAllocationFromPool root/virt Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association +KVM_ResourceAllocationFromPool root/virt KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file diff -r 08753448b529 -r 581a0f3fb078 schema/ResourceAllocationSettingData.registration --- a/schema/ResourceAllocationSettingData.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ResourceAllocationSettingData.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 -Xen_DiskResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance -Xen_NetResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance -Xen_ProcResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance -Xen_MemResourceAllocationSettingData root/ibmsd Virt_RASDProvider Virt_RASD instance +Xen_DiskResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance +Xen_NetResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance +Xen_ProcResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance +Xen_MemResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance diff -r 08753448b529 -r 581a0f3fb078 schema/ResourcePoolConfigurationCapabilities.registration --- a/schema/ResourcePoolConfigurationCapabilities.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ResourcePoolConfigurationCapabilities.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ResourcePoolConfigurationCapabilities root/ibmsd Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance -KVM_ResourcePoolConfigurationCapabilities root/ibmsd Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance \ No newline at end of file +Xen_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance +KVM_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance \ No newline at end of file diff -r 08753448b529 -r 581a0f3fb078 schema/ResourcePoolConfigurationService.registration --- a/schema/ResourcePoolConfigurationService.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/ResourcePoolConfigurationService.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_ResourcePoolConfigurationService root/ibmsd Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method -KVM_ResourcePoolConfigurationService root/ibmsd Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method \ No newline at end of file +Xen_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method +KVM_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method \ No newline at end of file diff -r 08753448b529 -r 581a0f3fb078 schema/SettingsDefineCapabilities.registration --- a/schema/SettingsDefineCapabilities.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/SettingsDefineCapabilities.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_SettingsDefineCapabilities root/ibmsd Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association -KVM_SettingsDefineCapabilities root/ibmsd KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association diff -r 08753448b529 -r 581a0f3fb078 schema/SettingsDefineState.registration --- a/schema/SettingsDefineState.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/SettingsDefineState.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_SettingsDefineState root/ibmsd Xen_SettingsDefineStateProvider Virt_SettingsDefineState association -KVM_SettingsDefineState root/ibmsd KVM_SettingsDefineStateProvider Virt_SettingsDefineState association +Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association +KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association diff -r 08753448b529 -r 581a0f3fb078 schema/SystemDevice.registration --- a/schema/SystemDevice.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/SystemDevice.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_SystemDevice root/ibmsd Xen_SystemDeviceProvider Virt_SystemDevice association -KVM_SystemDevice root/ibmsd KVM_SystemDeviceProvider Virt_SystemDevice association +Xen_SystemDevice root/virt Xen_SystemDeviceProvider Virt_SystemDevice association +KVM_SystemDevice root/virt KVM_SystemDeviceProvider Virt_SystemDevice association diff -r 08753448b529 -r 581a0f3fb078 schema/VSSD.registration --- a/schema/VSSD.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/VSSD.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_VirtualSystemSettingData root/ibmsd Virt_VSSDProvider Virt_VSSD instance -KVM_VirtualSystemSettingData root/ibmsd Virt_VSSDProvider Virt_VSSD instance +Xen_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance +KVM_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance diff -r 08753448b529 -r 581a0f3fb078 schema/VSSDComponent.registration --- a/schema/VSSDComponent.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/VSSDComponent.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_VirtualSystemSettingDataComponent root/ibmsd Xen_VSSDComponentProvider Virt_VSSDComponent association -KVM_VirtualSystemSettingDataComponent root/ibmsd KVM_VSSDComponentProvider Virt_VSSDComponent association +Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association +KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association diff -r 08753448b529 -r 581a0f3fb078 schema/VirtualSystemManagementCapabilities.registration --- a/schema/VirtualSystemManagementCapabilities.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/VirtualSystemManagementCapabilities.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_VirtualSystemManagementCapabilities root/ibmsd Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance +Xen_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance # Classname Namespace ProviderName ProviderModule ProviderTypes ... -KVM_VirtualSystemManagementCapabilities root/ibmsd Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance +KVM_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance diff -r 08753448b529 -r 581a0f3fb078 schema/VirtualSystemManagementService.registration --- a/schema/VirtualSystemManagementService.registration Thu Nov 08 19:19:50 2007 -0800 +++ b/schema/VirtualSystemManagementService.registration Fri Nov 09 08:10:08 2007 -0800 @@ -1,3 +1,3 @@ # Copyright IBM Corp. 2007 -Xen_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance -KVM_VirtualSystemManagementService root/ibmsd Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance +Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance +KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance diff -r 08753448b529 -r 581a0f3fb078 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Thu Nov 08 19:19:50 2007 -0800 +++ b/src/Virt_ComputerSystemIndication.c Fri Nov 09 08:10:08 2007 -0800 @@ -142,7 +142,7 @@ static bool async_ind(CMPIContext *conte CMPIStatus s; const char *type_name; char *type_cn = NULL; - const char *ns = "root/ibmsd"; + const char *ns = CIM_VIRT_NS; /* FIXME: Hmm, need to get the namespace a better way */ diff -r 08753448b529 -r 581a0f3fb078 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Thu Nov 08 19:19:50 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 09 08:10:08 2007 -0800 @@ -34,6 +34,8 @@ #include "profiles.h" #include "std_association.h" +#include "config.h" + #include "Virt_RegisteredProfile.h" /* Associate an XXX_RegisteredProfile to the proper XXX_ManagedElement. @@ -64,7 +66,7 @@ static CMPIStatus elem_instances(const C goto out; } - op = CMNewObjectPath(_BROKER, "/root/ibmsd", classname, &s); + op = CMNewObjectPath(_BROKER, CIM_VIRT_NS, classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto error; From danms at us.ibm.com Fri Nov 9 15:10:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 08:10:58 -0700 Subject: [Libvirt-cim] [PATCH] Cleanups and schema install additions to the RPM spec Message-ID: # HG changeset patch # User Dan Smith # Date 1194624610 28800 # Node ID d2f6398c7174f362fddc07d9d07024e5ac9538b8 # Parent 581a0f3fb078ccb003378d6d5974f5fe4636f123 Cleanups and schema install additions to the RPM spec - Removed references to the register_bash.sh script - Added schema install/uninstall to scriptlets - Make HTML documentation be installed (and included in the RPM) - Remove references to beam in configure.ac - Check for xsltproc at configure time - Make RPM use configure-time namespace I have tested this on Fedora 8 with the bundled pegasus installation. We still need to figure out how we're going to get the CIM v2.16 Exp schema on the box, but if you do that manually (into /root/virt) before installing the RPM, it works as expected. Signed-off-by: Dan Smith diff -r 581a0f3fb078 -r d2f6398c7174 configure.ac --- a/configure.ac Fri Nov 09 08:10:08 2007 -0800 +++ b/configure.ac Fri Nov 09 08:10:10 2007 -0800 @@ -54,20 +54,20 @@ AC_ARG_WITH([maxmem], [DEFINE_MAXMEM(4096)] ) +AC_ARG_WITH(html-dir, + AC_HELP_STRING([--with-html-dir=path], + [path to html directory, default $datadir/doc/$PACKAGE-$VERSION/html]), + [test "x$withval" != "x" && HTML_DIR="$withval"], + [HTML_DIR='$(datadir)/doc/$(PACKAGE)-$(VERSION)/html']) +AC_SUBST(HTML_DIR) + # Autogenerate the autoconf header file to store build settings AC_CONFIG_HEADER([config.h]) -# We need a absolute here for beam to work topdir=`pwd` AC_SUBST(topdir) -AC_CHECK_PROG([found_beam_compile],[beam_compile],[yes]) - -BEAMFILES="parser-messages BEAM_STATS BEAM-complaints MISC_ERRORS *.beam" -AC_SUBST(BEAMFILES) - -# Autogenerate runbeam-c, which must be executable -#AC_CONFIG_FILES([beam/runbeam-c],[chmod a+x beam/runbeam-c]) +AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) # Autogenerate the Makefile AC_CONFIG_FILES([ @@ -140,11 +140,6 @@ else TESTSUITE_SUPPORT=Enabled fi -# -# Enable the beam source analysis system. This requires that beam's -# bin directory is in your path -# - CFLAGS_STRICT="-Werror" CHECK_LIBCU @@ -156,21 +151,6 @@ AC_ARG_ENABLE([werror], fi]) AC_SUBST(CFLAGS_STRICT) - -AC_ARG_ENABLE([beam], - [ --enable-beam use beam to compile source [[default=no]]], - [if test "x$enableval" = "xyes"; then - if test "x$found_beam_compile" = "xyes"; then - AC_MSG_NOTICE(Building beam configuration) - beam_configure --c $CC -o beam/compiler_c_config.tcl - CC="\$(top_srcdir)/beam/runbeam-c" - else - AC_CHECK_FAIL(beam,beam,http://w3.eda.ibm.com/beam, - Can not find beam_compile in path! Can not enable beam analysis! -) - fi - fi], - ) CFLAGS="$CFLAGS $CC_WARNINGS" diff -r 581a0f3fb078 -r d2f6398c7174 doc/Makefile.am --- a/doc/Makefile.am Fri Nov 09 08:10:08 2007 -0800 +++ b/doc/Makefile.am Fri Nov 09 08:10:10 2007 -0800 @@ -1,9 +1,25 @@ XSLTPROC = /usr/bin/xsltproc XSLTPROC = /usr/bin/xsltproc -WEB_PAGES = index.html +WEB_PAGES = index.html \ + architecture.html \ + downloads.html \ + intro.html \ + news.html \ + platforms.html \ + schema.html + +EXTRA_DIST = site.xsl libvirt-cim.html $(WEB_PAGES): libvirt-cim.html site.xsl - $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html + -@(if [ -x $(XSLTPROC) ]; then \ + $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html; \ + fi); + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) + @INSTALL@ -m 0644 $(srcdir)/*.html $(DESTDIR)$(HTML_DIR) + +clean-local: + rm -f $(WEB_PAGES) all: $(WEB_PAGES) - diff -r 581a0f3fb078 -r d2f6398c7174 libvirt-cim.spec.in --- a/libvirt-cim.spec.in Fri Nov 09 08:10:08 2007 -0800 +++ b/libvirt-cim.spec.in Fri Nov 09 08:10:10 2007 -0800 @@ -34,7 +34,7 @@ rm -fr %{buildroot} rm -fr %{buildroot} %makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi -cp provider-register.sh register_base.sh %{buildroot}%{_datadir}/libvirt-cim/ +cp provider-register.sh %{buildroot}%{_datadir}/libvirt-cim/ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la @@ -43,17 +43,34 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a %clean rm -fr %{buildroot} +%pre +%define REGISTRATION %{_datadir}/%{name}/*.registration +%define SCHEMA %{_datadir}/%{name}/*.mof + +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true + %post /sbin/ldconfig -%postun +%{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true + +%preun /sbin/ldconfig + +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true %files %defattr(-, root, root) %doc README doc/CodingStyle doc/SubmittingPatches -%doc provider-register.sh register_base.sh +%doc provider-register.sh +%doc doc/*.html %{_libdir}/lib*.so* %{_libdir}/cmpi/lib*.so* %{_datadir}/libvirt-cim/*.sh From veillard at redhat.com Fri Nov 9 16:19:11 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 9 Nov 2007 11:19:11 -0500 Subject: [Libvirt-cim] [PATCH] Cleanups and schema install additions to the RPM spec In-Reply-To: References: Message-ID: <20071109161911.GH2244@redhat.com> On Fri, Nov 09, 2007 at 08:10:58AM -0700, Dan Smith wrote: [...] > diff -r 581a0f3fb078 -r d2f6398c7174 doc/Makefile.am > --- a/doc/Makefile.am Fri Nov 09 08:10:08 2007 -0800 > +++ b/doc/Makefile.am Fri Nov 09 08:10:10 2007 -0800 > @@ -1,9 +1,25 @@ XSLTPROC = /usr/bin/xsltproc > XSLTPROC = /usr/bin/xsltproc > > -WEB_PAGES = index.html > +WEB_PAGES = index.html \ > + architecture.html \ > + downloads.html \ > + intro.html \ > + news.html \ > + platforms.html \ > + schema.html > + > +EXTRA_DIST = site.xsl libvirt-cim.html I would add $(WEB_PAGES) to $(EXTRA_DIST) > $(WEB_PAGES): libvirt-cim.html site.xsl > - $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html > + -@(if [ -x $(XSLTPROC) ]; then \ > + $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html; \ > + fi); > + > +install-data-local: > + $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) > + @INSTALL@ -m 0644 $(srcdir)/*.html $(DESTDIR)$(HTML_DIR) > + > +clean-local: > + rm -f $(WEB_PAGES) and probably not remove on make clean to be able to 'make dist' with them embedded in the tarball as xsltproc is not really a build requirement. > all: $(WEB_PAGES) > - > diff -r 581a0f3fb078 -r d2f6398c7174 libvirt-cim.spec.in > --- a/libvirt-cim.spec.in Fri Nov 09 08:10:08 2007 -0800 > +++ b/libvirt-cim.spec.in Fri Nov 09 08:10:10 2007 -0800 > @@ -34,7 +34,7 @@ rm -fr %{buildroot} > rm -fr %{buildroot} > > %makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi > -cp provider-register.sh register_base.sh %{buildroot}%{_datadir}/libvirt-cim/ > +cp provider-register.sh %{buildroot}%{_datadir}/libvirt-cim/ > rm -f $RPM_BUILD_ROOT%{_libdir}/*.la > rm -f $RPM_BUILD_ROOT%{_libdir}/*.a > rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la > @@ -43,17 +43,34 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a > %clean > rm -fr %{buildroot} > > +%pre > +%define REGISTRATION %{_datadir}/%{name}/*.registration > +%define SCHEMA %{_datadir}/%{name}/*.mof > + > +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ > + -n /@CIM_VIRT_NS@ \ > + -r %{REGISTRATION} -m %{SCHEMA} || true > + > %post > /sbin/ldconfig > > -%postun > +%{_datadir}/%{name}/provider-register.sh -t pegasus \ > + -n /@CIM_VIRT_NS@ \ > + -r %{REGISTRATION} -m %{SCHEMA} || true > + > +%preun > /sbin/ldconfig hum ... on uninstalls shouldn't ldconfig be run after the list have been removed (and hence in %postun) ? > + > +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ > + -n /@CIM_VIRT_NS@ \ > + -r %{REGISTRATION} -m %{SCHEMA} || true > > %files > %defattr(-, root, root) > > %doc README doc/CodingStyle doc/SubmittingPatches > -%doc provider-register.sh register_base.sh > +%doc provider-register.sh > +%doc doc/*.html > %{_libdir}/lib*.so* > %{_libdir}/cmpi/lib*.so* > %{_datadir}/libvirt-cim/*.sh Except those tiny issues looks fine to me, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From veillard at redhat.com Fri Nov 9 16:21:25 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 9 Nov 2007 11:21:25 -0500 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt In-Reply-To: <581a0f3fb078ccb00337.1194624651@theine> References: <581a0f3fb078ccb00337.1194624651@theine> Message-ID: <20071109162125.GI2244@redhat.com> On Fri, Nov 09, 2007 at 08:10:51AM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194624608 28800 > # Node ID 581a0f3fb078ccb003378d6d5974f5fe4636f123 > # Parent 08753448b529043c78b24ebb019485761d8c6d4c > Change installed namespace to root/virt > > - Made namespace a configure option for the source build > - Made Makefile postinstall use namespace variable > - Updated for HostedService recent addition > > This one deserves some serious testing, although I was pleasantly surprised > at how few instances of the namespace we had hard-coded. We could probably > seems something cut your sentence at that point ... > Signed-off-by: Dan Smith > > diff -r 08753448b529 -r 581a0f3fb078 Makefile.am [...] Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Fri Nov 9 15:29:52 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 08:29:52 -0700 Subject: [Libvirt-cim] [PATCH] Cleanups and schema install additions to the RPM spec Message-ID: <7a89e6d4a4d5f5dc1e77.1194625792@theine> # HG changeset patch # User Dan Smith # Date 1194625790 28800 # Node ID 7a89e6d4a4d5f5dc1e77992b22a8c1f173ded7df # Parent 581a0f3fb078ccb003378d6d5974f5fe4636f123 Cleanups and schema install additions to the RPM spec - Removed references to the register_bash.sh script - Added schema install/uninstall to scriptlets - Make HTML documentation be installed (and included in the RPM) - Remove references to beam in configure.ac - Check for xsltproc at configure time - Make RPM use configure-time namespace - Discard registration messages on %preun (failures are expected) - Include the generated web content in "make dist" I have tested this on Fedora 8 with the bundled pegasus installation. We still need to figure out how we're going to get the CIM v2.16 Exp schema on the box, but if you do that manually (into /root/virt) before installing the RPM, it works as expected. Signed-off-by: Dan Smith diff -r 581a0f3fb078 -r 7a89e6d4a4d5 configure.ac --- a/configure.ac Fri Nov 09 08:10:08 2007 -0800 +++ b/configure.ac Fri Nov 09 08:29:50 2007 -0800 @@ -54,20 +54,20 @@ AC_ARG_WITH([maxmem], [DEFINE_MAXMEM(4096)] ) +AC_ARG_WITH(html-dir, + AC_HELP_STRING([--with-html-dir=path], + [path to html directory, default $datadir/doc/$PACKAGE-$VERSION/html]), + [test "x$withval" != "x" && HTML_DIR="$withval"], + [HTML_DIR='$(datadir)/doc/$(PACKAGE)-$(VERSION)/html']) +AC_SUBST(HTML_DIR) + # Autogenerate the autoconf header file to store build settings AC_CONFIG_HEADER([config.h]) -# We need a absolute here for beam to work topdir=`pwd` AC_SUBST(topdir) -AC_CHECK_PROG([found_beam_compile],[beam_compile],[yes]) - -BEAMFILES="parser-messages BEAM_STATS BEAM-complaints MISC_ERRORS *.beam" -AC_SUBST(BEAMFILES) - -# Autogenerate runbeam-c, which must be executable -#AC_CONFIG_FILES([beam/runbeam-c],[chmod a+x beam/runbeam-c]) +AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) # Autogenerate the Makefile AC_CONFIG_FILES([ @@ -140,11 +140,6 @@ else TESTSUITE_SUPPORT=Enabled fi -# -# Enable the beam source analysis system. This requires that beam's -# bin directory is in your path -# - CFLAGS_STRICT="-Werror" CHECK_LIBCU @@ -156,21 +151,6 @@ AC_ARG_ENABLE([werror], fi]) AC_SUBST(CFLAGS_STRICT) - -AC_ARG_ENABLE([beam], - [ --enable-beam use beam to compile source [[default=no]]], - [if test "x$enableval" = "xyes"; then - if test "x$found_beam_compile" = "xyes"; then - AC_MSG_NOTICE(Building beam configuration) - beam_configure --c $CC -o beam/compiler_c_config.tcl - CC="\$(top_srcdir)/beam/runbeam-c" - else - AC_CHECK_FAIL(beam,beam,http://w3.eda.ibm.com/beam, - Can not find beam_compile in path! Can not enable beam analysis! -) - fi - fi], - ) CFLAGS="$CFLAGS $CC_WARNINGS" diff -r 581a0f3fb078 -r 7a89e6d4a4d5 doc/Makefile.am --- a/doc/Makefile.am Fri Nov 09 08:10:08 2007 -0800 +++ b/doc/Makefile.am Fri Nov 09 08:29:50 2007 -0800 @@ -1,9 +1,22 @@ XSLTPROC = /usr/bin/xsltproc XSLTPROC = /usr/bin/xsltproc -WEB_PAGES = index.html +WEB_PAGES = index.html \ + architecture.html \ + downloads.html \ + intro.html \ + news.html \ + platforms.html \ + schema.html + +EXTRA_DIST = site.xsl libvirt-cim.html $(WEB_PAGES) $(WEB_PAGES): libvirt-cim.html site.xsl - $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html + -@(if [ -x $(XSLTPROC) ]; then \ + $(XSLTPROC) --nonet --html $(top_srcdir)/doc/site.xsl $(top_srcdir)/doc/libvirt-cim.html > index.html; \ + fi); + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(HTML_DIR) + @INSTALL@ -m 0644 $(srcdir)/*.html $(DESTDIR)$(HTML_DIR) all: $(WEB_PAGES) - diff -r 581a0f3fb078 -r 7a89e6d4a4d5 libvirt-cim.spec.in --- a/libvirt-cim.spec.in Fri Nov 09 08:10:08 2007 -0800 +++ b/libvirt-cim.spec.in Fri Nov 09 08:29:50 2007 -0800 @@ -34,7 +34,7 @@ rm -fr %{buildroot} rm -fr %{buildroot} %makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi -cp provider-register.sh register_base.sh %{buildroot}%{_datadir}/libvirt-cim/ +cp provider-register.sh %{buildroot}%{_datadir}/libvirt-cim/ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la @@ -43,8 +43,25 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a %clean rm -fr %{buildroot} +%pre +%define REGISTRATION %{_datadir}/%{name}/*.registration +%define SCHEMA %{_datadir}/%{name}/*.mof + +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true + %post /sbin/ldconfig + +%{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true + +%preun +%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ + -n /@CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} || true %postun /sbin/ldconfig @@ -53,7 +70,8 @@ rm -fr %{buildroot} %defattr(-, root, root) %doc README doc/CodingStyle doc/SubmittingPatches -%doc provider-register.sh register_base.sh +%doc provider-register.sh +%doc doc/*.html %{_libdir}/lib*.so* %{_libdir}/cmpi/lib*.so* %{_datadir}/libvirt-cim/*.sh From danms at us.ibm.com Fri Nov 9 16:31:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 08:31:00 -0800 Subject: [Libvirt-cim] [PATCH] Cleanups and schema install additions to the RPM spec In-Reply-To: <20071109161911.GH2244@redhat.com> (Daniel Veillard's message of "Fri, 9 Nov 2007 11:19:11 -0500") References: <20071109161911.GH2244@redhat.com> Message-ID: <87y7d7v0sb.fsf@theine.beaverton.ibm.com> DV> I would add $(WEB_PAGES) to $(EXTRA_DIST) Ah, right. DV> and probably not remove on make clean to be able to 'make dist' DV> with them embedded in the tarball as xsltproc is not really a DV> build requirement. Yep, good point. DV> hum ... on uninstalls shouldn't ldconfig be run after the list DV> have been removed (and hence in %postun) ? Ah, right. DV> Except those tiny issues looks fine to me, Replacement patch on the way... :) Thanks for applying your experienced eye to this packaging stuff! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 16:34:11 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 08:34:11 -0800 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt In-Reply-To: <20071109162125.GI2244@redhat.com> (Daniel Veillard's message of "Fri, 9 Nov 2007 11:21:25 -0500") References: <581a0f3fb078ccb00337.1194624651@theine> <20071109162125.GI2244@redhat.com> Message-ID: <87tznvv0n0.fsf@theine.beaverton.ibm.com> DV> seems something cut your sentence at that point ... That "something" would be me :) I just removed the "we could probably make this a configure option" sentence, since the patch now does that. I've corrected my local copy. Thanks for making me do the configure option. In the process, I realized that in addition to the two source files, we also have makefiles and rpm specs that contain that string, which makes it more obvious that a configure option is the right way to go :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Fri Nov 9 16:42:06 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 9 Nov 2007 11:42:06 -0500 Subject: [Libvirt-cim] [PATCH] Cleanups and schema install additions to the RPM spec In-Reply-To: <87y7d7v0sb.fsf@theine.beaverton.ibm.com> References: <20071109161911.GH2244@redhat.com> <87y7d7v0sb.fsf@theine.beaverton.ibm.com> Message-ID: <20071109164206.GL2244@redhat.com> On Fri, Nov 09, 2007 at 08:31:00AM -0800, Dan Smith wrote: > DV> I would add $(WEB_PAGES) to $(EXTRA_DIST) > > Ah, right. > > DV> and probably not remove on make clean to be able to 'make dist' > DV> with them embedded in the tarball as xsltproc is not really a > DV> build requirement. > > Yep, good point. > > DV> hum ... on uninstalls shouldn't ldconfig be run after the list > DV> have been removed (and hence in %postun) ? > > Ah, right. > > DV> Except those tiny issues looks fine to me, > > Replacement patch on the way... :) > > Thanks for applying your experienced eye to this packaging stuff! Heh, I don't understand much to the CIM C code so I try to compensate :) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From kaitlin at linux.vnet.ibm.com Fri Nov 9 17:07:36 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 09:07:36 -0800 Subject: [Libvirt-cim] [PATCH 3 of 5] Add a new mof and registration file for the HostedService provider In-Reply-To: <87sl3gw76r.fsf@theine.beaverton.ibm.com> References: <151bc006918bfcce7619.1194565729@kyon> <87sl3gw76r.fsf@theine.beaverton.ibm.com> Message-ID: <473493D8.4050907@linux.vnet.ibm.com> Dan Smith wrote: > KR> # HG changeset patch > KR> # User Kaitlin Rupert > KR> # Date 1194555339 28800 > KR> # Node ID 151bc006918bfcce761944dbe2397191a535a2dc > KR> # Parent e47094a1620c4215427afaa46faedee97bcd123a > KR> Add a new mof and registration file for the HostedService provider. > > Applied. I'll need to make sure I add this to my namespace change > patch :) > Yep! I had the patch all done before I saw your namespace patch. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Fri Nov 9 17:11:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 09:11:49 -0800 Subject: [Libvirt-cim] [PATCH] Remove unused parameter from get_vsms() In-Reply-To: <7ca1a71de7d47452ea49.1194571859@theine> References: <7ca1a71de7d47452ea49.1194571859@theine> Message-ID: <473494D5.90707@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194571829 28800 > # Node ID 7ca1a71de7d47452ea49c6be5f11365b9bb6a947 > # Parent 691b1ebbe2adc285c31006f71a3abc702c268add > Remove unused parameter from get_vsms() > > Signed-off-by: Dan Smith > Nice catch - patch looks good. +1 I'll need to update HostedService to conform. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Fri Nov 9 17:16:34 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 09:16:34 -0800 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: <877ikrwi4r.fsf@theine.beaverton.ibm.com> References: <47339EAB.5020007@linux.vnet.ibm.com> <47347B01.9050803@linux.vnet.ibm.com> <877ikrwi4r.fsf@theine.beaverton.ibm.com> Message-ID: <473495F2.4040102@linux.vnet.ibm.com> Dan Smith wrote: > JG> All of the callbacks need to have the same header because the > JG> sdc_rasd struct stores function pointers for the callbacks > > Right, you're doing the correct thing here, IMHO. > Yep, agreed. I didn't see ref used in any of the functions in the first patch, so I was confused. But I see why it's useful now. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 9 17:20:35 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 09:20:35 -0800 Subject: [Libvirt-cim] [PATCH] Remove unused parameter from get_vsms() References: <7ca1a71de7d47452ea49.1194571859@theine> <473494D5.90707@linux.vnet.ibm.com> Message-ID: <87ir4buyho.fsf@theine.beaverton.ibm.com> KR> I'll need to update HostedService to conform. The first hunk of that patch was to HostedService.c Is there anything else that needs to be done? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 9 17:39:33 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 09:39:33 -0800 Subject: [Libvirt-cim] [PATCH] Remove unused parameter from get_vsms() In-Reply-To: <473498E1.1060409@linux.vnet.ibm.com> References: <7ca1a71de7d47452ea49.1194571859@theine> <473494D5.90707@linux.vnet.ibm.com> <87ir4buyho.fsf@theine.beaverton.ibm.com> <473498E1.1060409@linux.vnet.ibm.com> Message-ID: <47349B55.7030605@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> KR> I'll need to update HostedService to conform. >> >> The first hunk of that patch was to HostedService.c Is there anything >> else that needs to be done? Yes, you're right. I'm sorry - for some reason when I read the first part of your patch, I read it all as changes src/Virt_VirtualSystemManagementService.c. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Fri Nov 9 17:40:07 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 09:40:07 -0800 Subject: [Libvirt-cim] [PATCH] Make HostedResourcePool a little more discerning In-Reply-To: <47349785.3010905@linux.vnet.ibm.com> References: <4c736ba430524c00804b.1194548692@theine> <47338786.3000406@linux.vnet.ibm.com> <87ejf0z8ve.fsf@theine.beaverton.ibm.com> <4733A615.2020202@linux.vnet.ibm.com> <87abpoxo43.fsf@theine.beaverton.ibm.com> <47349785.3010905@linux.vnet.ibm.com> Message-ID: <47349B77.8010401@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> KR> Oops, yes. I meant the pool_to_sys() side. =) >> >> Well, that is less of a problem I'd say. We don't really have the >> same issue of checking for a superclass where a subset of the children >> would be invalid parameters to the association, right? That's the >> root of the problem with the other direction. >> >> We could certainly look up an instance of the pool they're asking >> about and check their reference. I'm not sure it really matters as >> much as something like a GetInstance though, because the answer is >> always the same, no matter what pool they ask about. If someone >> deleted a pool between when they got a reference and when they asked >> about the host system for that pool, then we'd fail the association >> even though we already knew the answer and the answer is valid. >> >> Depends on your interpretation of CIM principles I suppose :) >> >> KR> Is there a defined CIM way for handling properties? I mostly >> KR> asked because I don't know much about them. >> >> I'm not sure what the policy is for property filtering and if keys >> can't be filtered. Something to revisit when we actually implement >> support for such, I'd say :) > Well said - good points. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Fri Nov 9 19:15:05 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 12:15:05 -0700 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes Message-ID: <9e90c48e77195c9b1f7f.1194639305@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1194638786 28800 # Node ID 9e90c48e77195c9b1f7f7f892ba6f43f3d7a027d # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa Some minor std_association fixes. Change result_list to tmp_list since the list is freed before filter_results() returns. Initialize CMPIStatus s in do_assoc(). If match class fails, then s is never properly set. This is assuming that it's *not* an error if a user queries an association with a result class that isn't handled by the provider. The CU_DEBUG() call before the match_class() call on info->assoc_class has a typo. The string text prints info->assoc_class, but the value passed in for info->assoc_class is info->result_class. Signed-off-by: Kaitlin Rupert diff -r 5f84fd6c5cde -r 9e90c48e7719 std_association.c --- a/std_association.c Thu Nov 08 11:21:50 2007 -0800 +++ b/std_association.c Fri Nov 09 12:06:26 2007 -0800 @@ -80,16 +80,16 @@ static CMPIStatus filter_results(struct const char *filter_class, const CMPIBroker *broker) { - struct inst_list result_list; + struct inst_list tmp_list; CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; int i; - result_list = *list; + tmp_list = *list; inst_list_init(list); - for (i = 0; result_list.list[i] != NULL; i++) { - op = CMGetObjectPath(result_list.list[i], &s); + for (i = 0; tmp_list.list[i] != NULL; i++) { + op = CMGetObjectPath(tmp_list.list[i], &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; @@ -100,11 +100,11 @@ static CMPIStatus filter_results(struct if (!match_op(broker, op, filter_class)) continue; - inst_list_add(list, result_list.list[i]); + inst_list_add(list, tmp_list.list[i]); } out: - inst_list_free(&result_list); + inst_list_free(&tmp_list); return s; } @@ -133,7 +133,7 @@ static CMPIStatus do_assoc(struct std_as bool names_only) { struct inst_list list; - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; struct std_assoc *handler; bool rc; @@ -168,7 +168,7 @@ static CMPIStatus do_assoc(struct std_as CU_DEBUG("Match_class succeeded.\n"); CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'\n", - info->result_class); + info->assoc_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, From grendel at linux.vnet.ibm.com Fri Nov 9 20:32:43 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 15:32:43 -0500 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: <871wb0xlx2.fsf@theine.beaverton.ibm.com> References: <4733A2EC.5040406@linux.vnet.ibm.com> <871wb0xlx2.fsf@theine.beaverton.ibm.com> Message-ID: <4734C3EB.6030100@linux.vnet.ibm.com> Dan Smith wrote: > KR> Just a nit-picky thing here... why not call the AllocCapabilities > KR> function that setups the instance? I think using the same > KR> InstanceID for the AllocCapa as the pool might not always return > KR> the correct instance because AllocCapa uses /0 as the > KR> InstanceID. But something like the NetworkingPool returns > KR> "NetworkPool/xenbr0". So you'll be creating an instance with > KR> "NetworkPool/xenbr0" as the InstanceID, which would conflict with > KR> what EnumInstances from AllocCapa would return. > > I think AllocationCapabilities needs to change here. It think using > the InstanceID from the pool makes the most sense. I'm not sure what > the existing AllocationCapabilities stuff intended, but I'm assuming > it will need to change to match this new stuff. Perhaps it was a > hold-over from the days of one-pool-per-resource-type? > > Good catch, by the way :) > > > Just to be clear, copying InstanceID from the instance of ResourcePool to the instance of AllocationCapabilities is okay, but I need to change the AllocationCapabilities provider? That doesn't much surprise me; the AllocationCapabilities provider itself only exists so I could register it as a class; I'm honestly not even sure what it's supposed to do on its own . Reading through the entire Allocation Capabilities Profile (DSP1043) provides no insight into what get/enumerateInstance(s) would do. Reasonable detail is given about how it should be connected to things via associations, but there isn't much concept of a standalone instance. -- -Jay From danms at us.ibm.com Fri Nov 9 20:40:43 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 12:40:43 -0800 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes In-Reply-To: <9e90c48e77195c9b1f7f.1194639305@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Fri, 09 Nov 2007 12:15:05 -0700") References: <9e90c48e77195c9b1f7f.1194639305@elm3b41.beaverton.ibm.com> Message-ID: <87640bup84.fsf@theine.beaverton.ibm.com> KR> Change result_list to tmp_list since the list is freed before KR> filter_results() returns. Thanks :) KR> Initialize CMPIStatus s in do_assoc(). If match class fails, then KR> s is never properly set. This is assuming that it's *not* an KR> error if a user queries an association with a result class that KR> isn't handled by the provider. If they try to pass an invalid reference (i.e. one we don't support an association for) we RETURN_UNSUPPORTED(). Shouldn't we do the same thing if they ask for a result that we don't support a transition to? Rather, shouldn't these two cases behave the same, no matter what that behavior should be? KR> The CU_DEBUG() call before the match_class() call on KR> info->assoc_class has a typo. The string text prints KR> info->assoc_class, but the value passed in for info->assoc_class KR> is info->result_class. That wouldn't be confusing in a debug situation at all, would it? :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 9 20:46:40 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 12:46:40 -0800 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: <4734C3EB.6030100@linux.vnet.ibm.com> (Jay Gagnon's message of "Fri, 09 Nov 2007 15:32:43 -0500") References: <4733A2EC.5040406@linux.vnet.ibm.com> <871wb0xlx2.fsf@theine.beaverton.ibm.com> <4734C3EB.6030100@linux.vnet.ibm.com> Message-ID: <871wazuoy7.fsf@theine.beaverton.ibm.com> JG> I'm honestly not even sure what it's supposed to do on its own . JG> Reading through the entire Allocation Capabilities Profile JG> (DSP1043) provides no insight into what get/enumerateInstance(s) JG> would do. Reasonable detail is given about how it should be JG> connected to things via associations, but there isn't much concept JG> of a standalone instance. The instance functions for AllocationCapabilities could probably be left unimplemented without anyone noticing, I imagine. However, I think that EnumInstances should return an instance of every AllocationCapabilities that could possibly be had through association with a pool. Thus, enumerate all the pools, create an AC instance for each and return them. GetInstance works the same. Should be trivial. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Fri Nov 9 21:27:54 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 09 Nov 2007 16:27:54 -0500 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: <871wazuoy7.fsf@theine.beaverton.ibm.com> References: <4733A2EC.5040406@linux.vnet.ibm.com> <871wb0xlx2.fsf@theine.beaverton.ibm.com> <4734C3EB.6030100@linux.vnet.ibm.com> <871wazuoy7.fsf@theine.beaverton.ibm.com> Message-ID: <4734D0DA.5070206@linux.vnet.ibm.com> Dan Smith wrote: > JG> I'm honestly not even sure what it's supposed to do on its own . > JG> Reading through the entire Allocation Capabilities Profile > JG> (DSP1043) provides no insight into what get/enumerateInstance(s) > JG> would do. Reasonable detail is given about how it should be > JG> connected to things via associations, but there isn't much concept > JG> of a standalone instance. > > The instance functions for AllocationCapabilities could probably be > left unimplemented without anyone noticing, I imagine. However, I > think that EnumInstances should return an instance of every > AllocationCapabilities that could possibly be had through association > with a pool. Thus, enumerate all the pools, create an AC instance for > each and return them. GetInstance works the same. Should be > trivial. > > I can see what you mean with EnumInstances, although if this is how the DMTF wants things done I still take issue with it since it just feels like a broken way of doing what the associations do. -- -Jay From kaitlin at linux.vnet.ibm.com Fri Nov 9 21:37:19 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 13:37:19 -0800 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes In-Reply-To: <87640bup84.fsf@theine.beaverton.ibm.com> References: <9e90c48e77195c9b1f7f.1194639305@elm3b41.beaverton.ibm.com> <87640bup84.fsf@theine.beaverton.ibm.com> Message-ID: <4734D30F.2020003@linux.vnet.ibm.com> Dan Smith wrote: > If they try to pass an invalid reference (i.e. one we don't support an > association for) we RETURN_UNSUPPORTED(). Shouldn't we do the same > thing if they ask for a result that we don't support a transition to? > Rather, shouldn't these two cases behave the same, no matter what that > behavior should be? > You mean, instead of returning success, we should set the status using cu_statusf(). Returning an error makes sense from a client point of view. If the client thinks an association is going to return a specific instance, and nothing is returned, it won't know the state of the system. If an error is returned, it's much more obvious to the client what has happened. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 9 21:42:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 13:42:34 -0800 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes In-Reply-To: <4734D30F.2020003@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Fri, 09 Nov 2007 13:37:19 -0800") References: <9e90c48e77195c9b1f7f.1194639305@elm3b41.beaverton.ibm.com> <87640bup84.fsf@theine.beaverton.ibm.com> <4734D30F.2020003@linux.vnet.ibm.com> Message-ID: <87wssrt7sl.fsf@theine.beaverton.ibm.com> KR> You mean, instead of returning success, we should set the status KR> using cu_statusf(). Returning an error makes sense from a client KR> point of view. If the client thinks an association is going to KR> return a specific instance, and nothing is returned, it won't know KR> the state of the system. If an error is returned, it's much more KR> obvious to the client what has happened. Right, if you return OK, but no instances, then it just looks like there is nothing on the other end of your association, which would normally be a transient state. However, asking for a result class that we don't support is not a transient error, it's a real one, and we should signal as such. Thanks for catching this and bringing it into the foreground for the requisite beating :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 9 22:07:11 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 15:07:11 -0700 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes Message-ID: <11f579d7363d783dab97.1194649631@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1194649591 28800 # Node ID 11f579d7363d783dab97b0d59b2fd5d2eedb7034 # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa Some minor std_association fixes. Change result_list to tmp_list since the list is freed before filter_results() returns. The CU_DEBUG() call before the match_class() call on info->assoc_class has a typo. The string text prints info->assoc_class, but the value passed in for info->assoc_class is info->result_class. Return an error if match_class() fails. This needs to be done in both do_assoc() and do_ref() Signed-off-by: Kaitlin Rupert diff -r 5f84fd6c5cde -r 11f579d7363d std_association.c --- a/std_association.c Thu Nov 08 11:21:50 2007 -0800 +++ b/std_association.c Fri Nov 09 15:06:31 2007 -0800 @@ -80,16 +80,16 @@ static CMPIStatus filter_results(struct const char *filter_class, const CMPIBroker *broker) { - struct inst_list result_list; + struct inst_list tmp_list; CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; int i; - result_list = *list; + tmp_list = *list; inst_list_init(list); - for (i = 0; result_list.list[i] != NULL; i++) { - op = CMGetObjectPath(result_list.list[i], &s); + for (i = 0; tmp_list.list[i] != NULL; i++) { + op = CMGetObjectPath(tmp_list.list[i], &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; @@ -100,11 +100,11 @@ static CMPIStatus filter_results(struct if (!match_op(broker, op, filter_class)) continue; - inst_list_add(list, result_list.list[i]); + inst_list_add(list, tmp_list.list[i]); } out: - inst_list_free(&result_list); + inst_list_free(&tmp_list); return s; } @@ -163,18 +163,24 @@ static CMPIStatus do_assoc(struct std_as handler->target_class); if (!rc) { CU_DEBUG("Match_class failed.\n"); + cu_statusf(ctx->brkr, &s, + CMPI_RC_ERR_FAILED, + "Result class is not valid for this association"); goto out; } CU_DEBUG("Match_class succeeded.\n"); CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'\n", - info->result_class); + info->assoc_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, handler->assoc_class); if (!rc) { CU_DEBUG("Match_class failed.\n"); + cu_statusf(ctx->brkr, &s, + CMPI_RC_ERR_FAILED, + "Association class given does not this association"); goto out; } CU_DEBUG("Match_class succeeded.\n"); @@ -248,8 +254,13 @@ static CMPIStatus do_ref(struct std_asso NAMESPACE(ref), info->result_class, handler->assoc_class); - if (!rc) - goto out; + if (!rc) { + cu_statusf(ctx->brkr, &s, + CMPI_RC_ERR_FAILED, + "Result class is not valid for this association"); + goto out; + } + s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) From kaitlin at linux.vnet.ibm.com Fri Nov 9 22:47:02 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 15:47:02 -0700 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes Message-ID: <22c4e9b498fb52f5fce9.1194652022@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1194651524 28800 # Node ID 22c4e9b498fb52f5fce98a71702c4610a42b6f18 # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa Some minor std_association fixes. Change result_list to tmp_list since the list is freed before filter_results() returns. The CU_DEBUG() call before the match_class() call on info->assoc_class has a typo. The string text prints info->assoc_class, but the value passed in for info->assoc_class is info->result_class. Return an error if match_class() fails. This needs to be done in both do_assoc() and do_ref() Resent patch due to poor grammar in the match_class() for assoc_class error message. Signed-off-by: Kaitlin Rupert diff -r 5f84fd6c5cde -r 22c4e9b498fb std_association.c --- a/std_association.c Thu Nov 08 11:21:50 2007 -0800 +++ b/std_association.c Fri Nov 09 15:38:44 2007 -0800 @@ -80,16 +80,16 @@ static CMPIStatus filter_results(struct const char *filter_class, const CMPIBroker *broker) { - struct inst_list result_list; + struct inst_list tmp_list; CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; int i; - result_list = *list; + tmp_list = *list; inst_list_init(list); - for (i = 0; result_list.list[i] != NULL; i++) { - op = CMGetObjectPath(result_list.list[i], &s); + for (i = 0; tmp_list.list[i] != NULL; i++) { + op = CMGetObjectPath(tmp_list.list[i], &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; @@ -100,11 +100,11 @@ static CMPIStatus filter_results(struct if (!match_op(broker, op, filter_class)) continue; - inst_list_add(list, result_list.list[i]); + inst_list_add(list, tmp_list.list[i]); } out: - inst_list_free(&result_list); + inst_list_free(&tmp_list); return s; } @@ -163,18 +163,25 @@ static CMPIStatus do_assoc(struct std_as handler->target_class); if (!rc) { CU_DEBUG("Match_class failed.\n"); + cu_statusf(ctx->brkr, &s, + CMPI_RC_ERR_FAILED, + "Result class is not valid for this association"); goto out; } CU_DEBUG("Match_class succeeded.\n"); CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'\n", - info->result_class); + info->assoc_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, handler->assoc_class); if (!rc) { CU_DEBUG("Match_class failed.\n"); + cu_statusf(ctx->brkr, &s, + CMPI_RC_ERR_FAILED, + "Association class given is not valid for" + "this association"); goto out; } CU_DEBUG("Match_class succeeded.\n"); @@ -248,8 +255,13 @@ static CMPIStatus do_ref(struct std_asso NAMESPACE(ref), info->result_class, handler->assoc_class); - if (!rc) - goto out; + if (!rc) { + cu_statusf(ctx->brkr, &s, + CMPI_RC_ERR_FAILED, + "Result class is not valid for this association"); + goto out; + } + s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) From danms at us.ibm.com Fri Nov 9 23:45:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 09 Nov 2007 15:45:28 -0800 Subject: [Libvirt-cim] [PATCH] Some minor std_association fixes In-Reply-To: <22c4e9b498fb52f5fce9.1194652022@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Fri, 09 Nov 2007 15:47:02 -0700") References: <22c4e9b498fb52f5fce9.1194652022@elm3b41.beaverton.ibm.com> Message-ID: <87sl3ft23r.fsf@theine.beaverton.ibm.com> KR> Return an error if match_class() fails. This needs to be done in KR> both do_assoc() and do_ref() Cool. KR> Resent patch due to poor grammar in the match_class() for KR> assoc_class error message. Thanks :) Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 9 23:50:46 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 09 Nov 2007 15:50:46 -0800 Subject: [Libvirt-cim] [PATCH] Change installed namespace to root/virt In-Reply-To: <581a0f3fb078ccb00337.1194624651@theine> References: <581a0f3fb078ccb00337.1194624651@theine> Message-ID: <4734F256.5070906@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194624608 28800 > # Node ID 581a0f3fb078ccb003378d6d5974f5fe4636f123 > # Parent 08753448b529043c78b24ebb019485761d8c6d4c > Change installed namespace to root/virt > > - Made namespace a configure option for the source build > - Made Makefile postinstall use namespace variable > - Updated for HostedService recent addition > > This one deserves some serious testing, although I was pleasantly surprised > at how few instances of the namespace we had hard-coded. We could probably > > Signed-off-by: Dan Smith > I applied this to my tree and ran a few tests. Everything that worked before applying works after applying. I also didn't notice anything wrong when I read through. A lot to read through though. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From zli at linux.vnet.ibm.com Mon Nov 12 07:13:13 2007 From: zli at linux.vnet.ibm.com (Zhengang Li) Date: Mon, 12 Nov 2007 15:13:13 +0800 Subject: [Libvirt-cim] [PATCH] Fix stdi_trigger_indication for Pegasus In-Reply-To: References: Message-ID: <4737FD09.8030108@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194491086 28800 > # Node ID c84928927faf099a7de17ee15321ad7f2574e979 > # Parent 926009fc62a0080bcf93aaddf098b074ce71a096 > Fix stdi_trigger_indication for Pegasus > > This fixes (for me) the DefineSystem crash on Pegasus. > > Signed-off-by: Dan Smith > This fixes the VSMS.definesystem crash on Pegasus. +1. -- - Zhengang From heidieck at linux.vnet.ibm.com Mon Nov 12 10:23:20 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 12 Nov 2007 12:23:20 +0200 Subject: [Libvirt-cim] [PATCH] Register association ElementCapabilities to root/virt namespace Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1194866181 -3600 # Node ID be03306b6557177c68d4fb936cd8e38a234daff7 # Parent 3e2881417ccd3898228179694d3a34bcc9a976ce Register association ElementCapabilities to root/virt namespace Signed-off-by: Heidi Eckhart diff -r 3e2881417ccd -r be03306b6557 schema/ElementCapabilities.registration --- a/schema/ElementCapabilities.registration Fri Nov 09 15:57:52 2007 -0800 +++ b/schema/ElementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_ElementCapabilities root/interop Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association -KVM_ElementCapabilities root/interop KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association +Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association +KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association From heidieck at linux.vnet.ibm.com Mon Nov 12 10:36:27 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 12 Nov 2007 12:36:27 +0200 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel Message-ID: <2519c5f9656c58a6034c.1194867387@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1194867348 -3600 # Node ID 2519c5f9656c58a6034cf17395deb379dbae4c9c # Parent be03306b6557177c68d4fb936cd8e38a234daff7 Updated Copyright Statements and common schema look and feel Signed-off-by: Heidi Eckhart diff -r be03306b6557 -r 2519c5f9656c schema/AllocationCapabilities.mof --- a/schema/AllocationCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/AllocationCapabilities.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,5 @@ // Copyright IBM Corp. 2007 + class Xen_AllocationCapabilities : CIM_AllocationCapabilities { }; diff -r be03306b6557 -r 2519c5f9656c schema/AllocationCapabilities.registration --- a/schema/AllocationCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/AllocationCapabilities.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance KVM_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance diff -r be03306b6557 -r 2519c5f9656c schema/ComputerSystem.mof --- a/schema/ComputerSystem.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystem.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,35 +1,26 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ComputerSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the Xen virtual machines/domains running on the system.")] + "the Xen virtual machines/domains running on the system.") +] class Xen_ComputerSystem : CIM_ComputerSystem { + [Description("UUID assigned to this DomU.")] string UUID; - [Description("Change domain state")] - uint32 RequestStateChange( - uint16 RequestedState, - datetime TimeoutPeriod - ); - }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_ComputerSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the KVM virtual machines running on the system.")] + "the KVM virtual machines running on the system.") +] class KVM_ComputerSystem : CIM_ComputerSystem { + [Description("UUID assigned to this virtual machine.")] string UUID; + }; diff -r be03306b6557 -r 2519c5f9656c schema/ComputerSystem.registration --- a/schema/ComputerSystem.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystem.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance method -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance diff -r be03306b6557 -r 2519c5f9656c schema/ComputerSystemIndication.mof --- a/schema/ComputerSystemIndication.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystemIndication.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,5 @@ // Copyright IBM Corp. 2007 + [Description ("Xen_ComputerSystem created")] class Xen_ComputerSystemCreatedIndication : CIM_InstCreation { @@ -9,7 +10,6 @@ class Xen_ComputerSystemDeletedIndicatio { }; - [Description ("KVM_ComputerSystem lifecycle")] class KVM_ComputerSystemCreatedIndication : CIM_InstCreation { diff -r be03306b6557 -r 2519c5f9656c schema/ComputerSystemIndication.registration --- a/schema/ComputerSystemIndication.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystemIndication.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,5 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method Xen_ComputerSystemDeletedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method KVM_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method diff -r be03306b6557 -r 2519c5f9656c schema/DiskPool.mof --- a/schema/DiskPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/DiskPool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,6 +1,9 @@ class Xen_DiskPool : CIM_ResourcePool +// Copyright IBM Corp. 2007 + class Xen_DiskPool : CIM_ResourcePool { }; + class KVM_DiskPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 2519c5f9656c schema/DiskPool.registration --- a/schema/DiskPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/DiskPool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,2 +1,4 @@ Xen_DiskPool root/virt Virt_DevicePoolPr +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance KVM_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r be03306b6557 -r 2519c5f9656c schema/ElementAllocatedFromPool.mof --- a/schema/ElementAllocatedFromPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementAllocatedFromPool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,7 +1,11 @@ // Copyright IBM Corp. 2007 + [Association] -class Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { +class Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool +{ }; + [Association] -class KVM_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { +class KVM_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool +{ }; diff -r be03306b6557 -r 2519c5f9656c schema/ElementAllocatedFromPool.registration --- a/schema/ElementAllocatedFromPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementAllocatedFromPool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ElementAllocatedFromPool root/virt Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association -KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association \ No newline at end of file +KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association diff -r be03306b6557 -r 2519c5f9656c schema/ElementCapabilities.mof --- a/schema/ElementCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementCapabilities.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ElementCapabilities -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its Capabilities." -)] + "A class to associate a ManagedElement with its Capabilities.") +] class Xen_ElementCapabilities : CIM_ElementCapabilities { }; -// ================================================================== -// KVM_ElementCapabilities -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its Capabilities." -)] + "A class to associate a ManagedElement with its Capabilities.") +] class KVM_ElementCapabilities : CIM_ElementCapabilities { }; diff -r be03306b6557 -r 2519c5f9656c schema/ElementCapabilities.registration --- a/schema/ElementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementCapabilities.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association diff -r be03306b6557 -r 2519c5f9656c schema/ElementConformsToProfile.mof --- a/schema/ElementConformsToProfile.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementConformsToProfile.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ElementConformsToProfile -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its RegisteredProfile." -)] + "A class to associate a ManagedElement with its RegisteredProfile.") +] class Xen_ElementConformsToProfile : CIM_ElementConformsToProfile { }; -// ================================================================== -// KVM_ElementConformsToProfile -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its RegisteredProfile." -)] + "A class to associate a ManagedElement with its RegisteredProfile.") +] class KVM_ElementConformsToProfile : CIM_ElementConformsToProfile { }; diff -r be03306b6557 -r 2519c5f9656c schema/ElementConformsToProfile.registration --- a/schema/ElementConformsToProfile.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementConformsToProfile.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,7 +1,6 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes #Xen_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association Xen_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association -# Classname Namespace ProviderName ProviderModule ProviderTypes ... #KVM_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association KVM_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association diff -r be03306b6557 -r 2519c5f9656c schema/EnabledLogicalElementCapabilities.mof --- a/schema/EnabledLogicalElementCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/EnabledLogicalElementCapabilities.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_EnabledLogicalElementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the changes that can be made to a started Xen virtual system")] + "the changes that can be made to a started Xen virtual system") +] class Xen_EnabledLogicalElementCapabilities : CIM_EnabledLogicalElementCapabilities { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_EnabledLogicalElementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the changes that can be made to a started KVM virtual system")] + "the changes that can be made to a started KVM virtual system") +] class KVM_EnabledLogicalElementCapabilities : CIM_EnabledLogicalElementCapabilities { }; diff -r be03306b6557 -r 2519c5f9656c schema/EnabledLogicalElementCapabilities.registration --- a/schema/EnabledLogicalElementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/EnabledLogicalElementCapabilities.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance diff -r be03306b6557 -r 2519c5f9656c schema/HostSystem.mof --- a/schema/HostSystem.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostSystem.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_HostSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the Xen host system")] + "the Xen host system.") +] class Xen_HostSystem : CIM_ComputerSystem { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_HostSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the KVM host system.")] + "the KVM host system.") +] class KVM_HostSystem : CIM_ComputerSystem { }; diff -r be03306b6557 -r 2519c5f9656c schema/HostSystem.registration --- a/schema/HostSystem.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostSystem.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance diff -r be03306b6557 -r 2519c5f9656c schema/HostedDependency.mof --- a/schema/HostedDependency.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedDependency.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,19 +1,19 @@ // Copyright IBM Corp. 2007 -// ================================================================== -// Xen_HostedDependency -// ================================================================== - [Association, Version ( "2.8.0" ), - UMLPackagePath ( "CIM::Core::CoreElements" ), Description ( - "HostedDependency defines a ManagedElement in the context of " - "another ManagedElement in which it resides.")] -class Xen_HostedDependency : CIM_HostedDependency { -}; -// ================================================================== -// KVM_HostedDependency -// ================================================================== - [Association, Version ( "2.8.0" ), - UMLPackagePath ( "CIM::Core::CoreElements" ), Description ( - "HostedDependency defines a ManagedElement in the context of " - "another ManagedElement in which it resides.")] -class KVM_HostedDependency : CIM_HostedDependency { -}; + +[Association, + Description ( + "HostedDependency defines a ManagedElement in the context of " + "another ManagedElement in which it resides.") +] +class Xen_HostedDependency : CIM_HostedDependency +{ +}; + +[Association, + Description ( + "HostedDependency defines a ManagedElement in the context of " + "another ManagedElement in which it resides.") +] +class KVM_HostedDependency : CIM_HostedDependency +{ +}; diff -r be03306b6557 -r 2519c5f9656c schema/HostedDependency.registration --- a/schema/HostedDependency.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedDependency.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association diff -r be03306b6557 -r 2519c5f9656c schema/HostedResourcePool.mof --- a/schema/HostedResourcePool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedResourcePool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2007 + [Association, Description ( - "Associates a host system to its resource pools" -)] + "Associates a host system to its resource pools") +] class Xen_HostedResourcePool : CIM_HostedResourcePool { }; [Association, Description ( - "Associates a host system to its resource pools" -)] + "Associates a host system to its resource pools") +] class KVM_HostedResourcePool : CIM_HostedResourcePool { }; \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/HostedResourcePool.registration --- a/schema/HostedResourcePool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedResourcePool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association KVM_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/LogicalDisk.mof --- a/schema/LogicalDisk.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/LogicalDisk.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_LogicalDisk -// ================================================================== [Description ( "A class derived from CIM_LogicalDisk to represent " - "the Xen virtual disks on the system.")] + "the Xen virtual disks on the system.") +] class Xen_LogicalDisk : CIM_LogicalDisk { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_LogicalDisk -// ================================================================== [Description ( "A class derived from CIM_LogicalDisk to represent " - "the KVM virtual disks on the system.")] + "the KVM virtual disks on the system.") +] class KVM_LogicalDisk : CIM_LogicalDisk { }; diff -r be03306b6557 -r 2519c5f9656c schema/LogicalDisk.registration --- a/schema/LogicalDisk.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/LogicalDisk.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 2519c5f9656c schema/Memory.mof --- a/schema/Memory.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Memory.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,24 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// Xen_Memory -// ================================================================== +// Copyright IBM Corp. 2007 [Description ( "A class derived from CIM_Memory to represent " - "the Xen virtual memory.")] + "the Xen virtual memory.") +] class Xen_Memory : CIM_Memory { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_Memory -// ================================================================== [Description ( "A class derived from CIM_Memory to represent " - "the KVM virtual memory.")] + "the KVM virtual memory.") +] class KVM_Memory : CIM_Memory { }; diff -r be03306b6557 -r 2519c5f9656c schema/Memory.registration --- a/schema/Memory.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Memory.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_Memory root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_Memory root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 2519c5f9656c schema/MemoryPool.mof --- a/schema/MemoryPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/MemoryPool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,17 +1,9 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_MemoryPool -// ================================================================== class Xen_MemoryPool : CIM_ResourcePool { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_MemoryPool -// ================================================================== class KVM_MemoryPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 2519c5f9656c schema/MemoryPool.registration --- a/schema/MemoryPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/MemoryPool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r be03306b6557 -r 2519c5f9656c schema/NetPool.mof --- a/schema/NetPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetPool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,7 +1,9 @@ // Copyright IBM Corp. 2007 + class Xen_NetworkPool : CIM_ResourcePool { }; + class KVM_NetworkPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 2519c5f9656c schema/NetPool.registration --- a/schema/NetPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetPool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance KVM_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/NetworkPort.mof --- a/schema/NetworkPort.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetworkPort.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_NetworkPort -// ================================================================== [Description ( "A class derived from CIM_NetworkPort to represent " - "the Xen virtual network interfaces on the system.")] + "the Xen virtual network interfaces on the system.") +] class Xen_NetworkPort : CIM_NetworkPort { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_NetworkPort -// ================================================================== [Description ( "A class derived from CIM_NetworkPort to represent " - "the KVM virtual network interfaces on the system.")] + "the KVM virtual network interfaces on the system.") +] class KVM_NetworkPort : CIM_NetworkPort { }; diff -r be03306b6557 -r 2519c5f9656c schema/NetworkPort.registration --- a/schema/NetworkPort.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetworkPort.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 2519c5f9656c schema/Processor.mof --- a/schema/Processor.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Processor.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_Processor -// ================================================================== [Description ( "A class derived from CIM_Processor to represent " - "the Xen virtual processors.")] + "the Xen virtual processors.") +] class Xen_Processor : CIM_Processor { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_Processor -// ================================================================== [Description ( "A class derived from CIM_Processor to represent " - "the KVM virtual processors.")] + "the KVM virtual processors.") +] class KVM_Processor : CIM_Processor { }; diff -r be03306b6557 -r 2519c5f9656c schema/Processor.registration --- a/schema/Processor.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Processor.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_Processor root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_Processor root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 2519c5f9656c schema/ProcessorPool.mof --- a/schema/ProcessorPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ProcessorPool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,17 +1,9 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ProcessorPool -// ================================================================== class Xen_ProcessorPool : CIM_ResourcePool { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_ProcessorPool -// ================================================================== class KVM_ProcessorPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 2519c5f9656c schema/ProcessorPool.registration --- a/schema/ProcessorPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ProcessorPool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r be03306b6557 -r 2519c5f9656c schema/RegisteredProfile.mof --- a/schema/RegisteredProfile.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/RegisteredProfile.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,21 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_RegisteredProfile -// ================================================================== [Description ( "A class derived from CIM_RegisteredProfile to represent " - "an advertised conformant profile.")] + "an advertised conformant profile.") +] class Xen_RegisteredProfile : CIM_RegisteredProfile { }; -// ================================================================== -// KVM_RegisteredProfile -// ================================================================== [Description ( "A class derived from CIM_RegisteredProfile to represent " - "an advertised conformant profile.")] + "an advertised conformant profile.") +] class KVM_RegisteredProfile : CIM_RegisteredProfile { }; diff -r be03306b6557 -r 2519c5f9656c schema/RegisteredProfile.registration --- a/schema/RegisteredProfile.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/RegisteredProfile.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_RegisteredProfile root/interop Virt_RegisteredProfileProvider Virt_RegisteredProfile instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_RegisteredProfile root/interop Virt_RegisteredProfileProvider Virt_RegisteredProfile instance diff -r be03306b6557 -r 2519c5f9656c schema/ResourceAllocationFromPool.mof --- a/schema/ResourceAllocationFromPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationFromPool.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool { + +[Association] +class Xen_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool +{ }; -class KVM_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool { +[Association] +class KVM_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool +{ }; diff -r be03306b6557 -r 2519c5f9656c schema/ResourceAllocationFromPool.registration --- a/schema/ResourceAllocationFromPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationFromPool.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ResourceAllocationFromPool root/virt Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association KVM_ResourceAllocationFromPool root/virt KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationSettingData.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,14 +1,16 @@ // Copyright IBM Corp. 2007 -class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { +class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData +{ }; -class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - +class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData +{ }; [Description ("Xen virtual disk configuration")] -class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData{ +class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ [Description ("Device as seen by the guest")] string VirtualDevice; @@ -16,7 +18,8 @@ class Xen_DiskResourceAllocationSettingD }; [Description ("KVM virtual disk configuration")] -class KVM_DiskResourceAllocationSettingData : KVM_ResourceAllocationSettingData{ +class KVM_DiskResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ [Description ("Device as seen by the guest")] string VirtualDevice; @@ -24,7 +27,8 @@ class KVM_DiskResourceAllocationSettingD }; [Description ("Xen virtual network configuration")] -class Xen_NetResourceAllocationSettingData : Xen_ResourceAllocationSettingData { +class Xen_NetResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ [Description ("Interface type")] string NetworkType; @@ -32,7 +36,8 @@ class Xen_NetResourceAllocationSettingDa }; [Description ("KVM virtual network configuration")] -class KVM_NetResourceAllocationSettingData : KVM_ResourceAllocationSettingData { +class KVM_NetResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ [Description ("Interface type")] string NetworkType; @@ -40,13 +45,21 @@ class KVM_NetResourceAllocationSettingDa }; [Description ("Xen virtual processor")] -class Xen_ProcResourceAllocationSettingData : Xen_ResourceAllocationSettingData {}; +class Xen_ProcResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ +}; [Description ("KVM virtual processor")] -class KVM_ProcResourceAllocationSettingData : KVM_ResourceAllocationSettingData {}; +class KVM_ProcResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ +}; [Description ("Xen virtual memory")] -class Xen_MemResourceAllocationSettingData : Xen_ResourceAllocationSettingData {}; +class Xen_MemResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ +}; [Description ("KVM virtual memory")] -class KVM_MemResourceAllocationSettingData : KVM_ResourceAllocationSettingData {}; +class KVM_MemResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ +}; diff -r be03306b6557 -r 2519c5f9656c schema/ResourceAllocationSettingData.registration --- a/schema/ResourceAllocationSettingData.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationSettingData.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,5 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_DiskResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance Xen_NetResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance Xen_ProcResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance diff -r be03306b6557 -r 2519c5f9656c schema/ResourcePoolConfigurationCapabilities.mof --- a/schema/ResourcePoolConfigurationCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationCapabilities.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,7 +1,9 @@ // Copyright IBM Corp. 2007 -class Xen_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities { +class Xen_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities +{ }; -class KVM_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities { +class KVM_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities +{ }; diff -r be03306b6557 -r 2519c5f9656c schema/ResourcePoolConfigurationCapabilities.registration --- a/schema/ResourcePoolConfigurationCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationCapabilities.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance KVM_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/ResourcePoolConfigurationService.mof --- a/schema/ResourcePoolConfigurationService.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationService.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,8 +1,9 @@ // Copyright IBM Corp. 2007 -class Xen_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { +class Xen_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService +{ }; -class KVM_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { - -}; \ No newline at end of file +class KVM_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService +{ +}; diff -r be03306b6557 -r 2519c5f9656c schema/ResourcePoolConfigurationService.registration --- a/schema/ResourcePoolConfigurationService.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationService.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method KVM_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/SettingsDefineCapabilities.mof --- a/schema/SettingsDefineCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineCapabilities.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,8 +1,11 @@ // Copyright IBM Corp. 2007 + +[Association] class Xen_SettingsDefineCapabilities : CIM_SettingsDefineCapabilities { }; +[Association] class KVM_SettingsDefineCapabilities : CIM_SettingsDefineCapabilities { }; diff -r be03306b6557 -r 2519c5f9656c schema/SettingsDefineCapabilities.registration --- a/schema/SettingsDefineCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineCapabilities.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association -KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +# Classname Namespace ProviderName ProviderModule ProviderTypes +Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association diff -r be03306b6557 -r 2519c5f9656c schema/SettingsDefineState.mof --- a/schema/SettingsDefineState.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineState.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_SettingsDefineState : CIM_SettingsDefineState { + +[Association] +class Xen_SettingsDefineState : CIM_SettingsDefineState +{ }; -class KVM_SettingsDefineState : CIM_SettingsDefineState { +[Association] +class KVM_SettingsDefineState : CIM_SettingsDefineState +{ }; \ No newline at end of file diff -r be03306b6557 -r 2519c5f9656c schema/SettingsDefineState.registration --- a/schema/SettingsDefineState.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineState.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association diff -r be03306b6557 -r 2519c5f9656c schema/SystemDevice.mof --- a/schema/SystemDevice.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SystemDevice.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,44 +1,32 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ******************************************************************* -// Associations -// ******************************************************************* - -// ================================================================== -// Xen_SystemDevice -// ================================================================== [Association, Description ( - "A class to associate a Xen_ComputerSystem with its devices" -)] + "A class to associate a Xen_ComputerSystem with its devices." ) +] class Xen_SystemDevice : CIM_SystemDevice { + [Override ( "GroupComponent" )] Xen_ComputerSystem REF GroupComponent; [Override ( "PartComponent" )] CIM_LogicalDevice REF PartComponent; + }; -// Copyright 2007 IBM. All rights reserved. - -// ******************************************************************* -// Associations -// ******************************************************************* - -// ================================================================== -// KVM_SystemDevice -// ================================================================== [Association, Description ( - "A class to associate a KVM_ComputerSystem with its devices" -)] + "A class to associate a KVM_ComputerSystem with its devices." ) +] class KVM_SystemDevice : CIM_SystemDevice { + [Override ( "GroupComponent" )] KVM_ComputerSystem REF GroupComponent; [Override ( "PartComponent" )] CIM_LogicalDevice REF PartComponent; + }; diff -r be03306b6557 -r 2519c5f9656c schema/SystemDevice.registration --- a/schema/SystemDevice.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SystemDevice.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_SystemDevice root/virt Xen_SystemDeviceProvider Virt_SystemDevice association KVM_SystemDevice root/virt KVM_SystemDeviceProvider Virt_SystemDevice association diff -r be03306b6557 -r 2519c5f9656c schema/VSSD.mof --- a/schema/VSSD.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSD.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,16 +1,21 @@ // Copyright IBM Corp. 2007 + [Description ( "A class derived from CIM_VirtualSystemSettingData to represent " - "the config of Xen virtual machines/domains running on the system.")] + "the config of Xen virtual machines/domains running on the system.") +] class Xen_VirtualSystemSettingData : CIM_VirtualSystemSettingData { + string Bootloader; string BootloaderArgs; + }; [Description ( "A class derived from CIM_VirtualSystemSettingData to represent " - "the config of KVM virtual machines/domains running on the system.")] + "the config of KVM virtual machines/domains running on the system.") +] class KVM_VirtualSystemSettingData : CIM_VirtualSystemSettingData { }; diff -r be03306b6557 -r 2519c5f9656c schema/VSSD.registration --- a/schema/VSSD.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSD.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance KVM_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance diff -r be03306b6557 -r 2519c5f9656c schema/VSSDComponent.mof --- a/schema/VSSDComponent.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSDComponent.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_VirtualSystemSettingDataComponent : CIM_Component { + +[Association] +class Xen_VirtualSystemSettingDataComponent : CIM_Component +{ }; -class KVM_VirtualSystemSettingDataComponent : CIM_Component { +[Association] +class KVM_VirtualSystemSettingDataComponent : CIM_Component +{ }; diff -r be03306b6557 -r 2519c5f9656c schema/VSSDComponent.registration --- a/schema/VSSDComponent.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSDComponent.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association diff -r be03306b6557 -r 2519c5f9656c schema/VirtualSystemManagementCapabilities.mof --- a/schema/VirtualSystemManagementCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementCapabilities.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_VirtualSystemManagementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the management capabilities of a Xen virtual system")] + "the management capabilities of a Xen virtual system") +] class Xen_VirtualSystemManagementCapabilities : CIM_VirtualSystemManagementCapabilities { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_VirtualSystemManagementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the management capabilities of a KVM virtual system.")] + "the management capabilities of a KVM virtual system.") +] class KVM_VirtualSystemManagementCapabilities : CIM_VirtualSystemManagementCapabilities { }; diff -r be03306b6557 -r 2519c5f9656c schema/VirtualSystemManagementCapabilities.registration --- a/schema/VirtualSystemManagementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementCapabilities.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance diff -r be03306b6557 -r 2519c5f9656c schema/VirtualSystemManagementService.mof --- a/schema/VirtualSystemManagementService.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementService.mof Mon Nov 12 12:35:48 2007 +0100 @@ -1,6 +1,9 @@ // Copyright IBM Corp. 2007 -class Xen_VirtualSystemManagementService : CIM_VirtualSystemManagementService { + +class Xen_VirtualSystemManagementService : CIM_VirtualSystemManagementService +{ }; -class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService { +class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService +{ }; diff -r be03306b6557 -r 2519c5f9656c schema/VirtualSystemManagementService.registration --- a/schema/VirtualSystemManagementService.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementService.registration Mon Nov 12 12:35:48 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance From heidieck at linux.vnet.ibm.com Mon Nov 12 10:41:54 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 12 Nov 2007 12:41:54 +0200 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel Message-ID: <20b83bfd514faa824c55.1194867714@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1194867556 -3600 # Node ID 20b83bfd514faa824c5565cdf8703ada146e9e56 # Parent be03306b6557177c68d4fb936cd8e38a234daff7 Updated Copyright Statements and common schema look and feel Signed-off-by: Heidi Eckhart diff -r be03306b6557 -r 20b83bfd514f schema/AllocationCapabilities.mof --- a/schema/AllocationCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/AllocationCapabilities.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,5 @@ // Copyright IBM Corp. 2007 + class Xen_AllocationCapabilities : CIM_AllocationCapabilities { }; diff -r be03306b6557 -r 20b83bfd514f schema/AllocationCapabilities.registration --- a/schema/AllocationCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/AllocationCapabilities.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance KVM_AllocationCapabilities root/virt Virt_AllocationCapabilitiesProvider Virt_AllocationCapabilities instance diff -r be03306b6557 -r 20b83bfd514f schema/ComputerSystem.mof --- a/schema/ComputerSystem.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystem.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,35 +1,26 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ComputerSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the Xen virtual machines/domains running on the system.")] + "the Xen virtual machines/domains running on the system.") +] class Xen_ComputerSystem : CIM_ComputerSystem { + [Description("UUID assigned to this DomU.")] string UUID; - [Description("Change domain state")] - uint32 RequestStateChange( - uint16 RequestedState, - datetime TimeoutPeriod - ); - }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_ComputerSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the KVM virtual machines running on the system.")] + "the KVM virtual machines running on the system.") +] class KVM_ComputerSystem : CIM_ComputerSystem { + [Description("UUID assigned to this virtual machine.")] string UUID; + }; diff -r be03306b6557 -r 20b83bfd514f schema/ComputerSystem.registration --- a/schema/ComputerSystem.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystem.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance method -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_ComputerSystem root/virt Virt_ComputerSystemProvider Virt_ComputerSystem instance diff -r be03306b6557 -r 20b83bfd514f schema/ComputerSystemIndication.mof --- a/schema/ComputerSystemIndication.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystemIndication.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,5 @@ // Copyright IBM Corp. 2007 + [Description ("Xen_ComputerSystem created")] class Xen_ComputerSystemCreatedIndication : CIM_InstCreation { @@ -9,7 +10,6 @@ class Xen_ComputerSystemDeletedIndicatio { }; - [Description ("KVM_ComputerSystem lifecycle")] class KVM_ComputerSystemCreatedIndication : CIM_InstCreation { diff -r be03306b6557 -r 20b83bfd514f schema/ComputerSystemIndication.registration --- a/schema/ComputerSystemIndication.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ComputerSystemIndication.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,5 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method Xen_ComputerSystemDeletedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method KVM_ComputerSystemCreatedIndication root/virt Virt_ComputerSystemIndicationProvider Virt_ComputerSystemIndication indication method diff -r be03306b6557 -r 20b83bfd514f schema/DiskPool.mof --- a/schema/DiskPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/DiskPool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,6 +1,9 @@ class Xen_DiskPool : CIM_ResourcePool +// Copyright IBM Corp. 2007 + class Xen_DiskPool : CIM_ResourcePool { }; + class KVM_DiskPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 20b83bfd514f schema/DiskPool.registration --- a/schema/DiskPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/DiskPool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,2 +1,4 @@ Xen_DiskPool root/virt Virt_DevicePoolPr +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance KVM_DiskPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r be03306b6557 -r 20b83bfd514f schema/ElementAllocatedFromPool.mof --- a/schema/ElementAllocatedFromPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementAllocatedFromPool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,7 +1,11 @@ // Copyright IBM Corp. 2007 + [Association] -class Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { +class Xen_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool +{ }; + [Association] -class KVM_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool { +class KVM_ElementAllocatedFromPool : CIM_ElementAllocatedFromPool +{ }; diff -r be03306b6557 -r 20b83bfd514f schema/ElementAllocatedFromPool.registration --- a/schema/ElementAllocatedFromPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementAllocatedFromPool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ElementAllocatedFromPool root/virt Xen_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association -KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association \ No newline at end of file +KVM_ElementAllocatedFromPool root/virt KVM_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association diff -r be03306b6557 -r 20b83bfd514f schema/ElementCapabilities.mof --- a/schema/ElementCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementCapabilities.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ElementCapabilities -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its Capabilities." -)] + "A class to associate a ManagedElement with its Capabilities.") +] class Xen_ElementCapabilities : CIM_ElementCapabilities { }; -// ================================================================== -// KVM_ElementCapabilities -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its Capabilities." -)] + "A class to associate a ManagedElement with its Capabilities.") +] class KVM_ElementCapabilities : CIM_ElementCapabilities { }; diff -r be03306b6557 -r 20b83bfd514f schema/ElementCapabilities.registration --- a/schema/ElementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementCapabilities.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association diff -r be03306b6557 -r 20b83bfd514f schema/ElementConformsToProfile.mof --- a/schema/ElementConformsToProfile.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementConformsToProfile.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ElementConformsToProfile -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its RegisteredProfile." -)] + "A class to associate a ManagedElement with its RegisteredProfile.") +] class Xen_ElementConformsToProfile : CIM_ElementConformsToProfile { }; -// ================================================================== -// KVM_ElementConformsToProfile -// ================================================================== [Association, Description ( - "A class to associate a ManagedElement with its RegisteredProfile." -)] + "A class to associate a ManagedElement with its RegisteredProfile.") +] class KVM_ElementConformsToProfile : CIM_ElementConformsToProfile { }; diff -r be03306b6557 -r 20b83bfd514f schema/ElementConformsToProfile.registration --- a/schema/ElementConformsToProfile.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ElementConformsToProfile.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,7 +1,6 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes #Xen_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association Xen_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association -# Classname Namespace ProviderName ProviderModule ProviderTypes ... #KVM_ElementConformsToProfile root/virt Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association KVM_ElementConformsToProfile root/interop Virt_ElementConformsToProfileProvider Virt_ElementConformsToProfile association diff -r be03306b6557 -r 20b83bfd514f schema/EnabledLogicalElementCapabilities.mof --- a/schema/EnabledLogicalElementCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/EnabledLogicalElementCapabilities.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_EnabledLogicalElementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the changes that can be made to a started Xen virtual system")] + "the changes that can be made to a started Xen virtual system") +] class Xen_EnabledLogicalElementCapabilities : CIM_EnabledLogicalElementCapabilities { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_EnabledLogicalElementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the changes that can be made to a started KVM virtual system")] + "the changes that can be made to a started KVM virtual system") +] class KVM_EnabledLogicalElementCapabilities : CIM_EnabledLogicalElementCapabilities { }; diff -r be03306b6557 -r 20b83bfd514f schema/EnabledLogicalElementCapabilities.registration --- a/schema/EnabledLogicalElementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/EnabledLogicalElementCapabilities.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_EnabledLogicalElementCapabilities root/virt Virt_EnabledLogicalElementCapabilitiesProvider Virt_EnabledLogicalElementCapabilities instance diff -r be03306b6557 -r 20b83bfd514f schema/HostSystem.mof --- a/schema/HostSystem.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostSystem.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_HostSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the Xen host system")] + "the Xen host system.") +] class Xen_HostSystem : CIM_ComputerSystem { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_HostSystem -// ================================================================== [Description ( "A class derived from CIM_ComputerSystem to represent " - "the KVM host system.")] + "the KVM host system.") +] class KVM_HostSystem : CIM_ComputerSystem { }; diff -r be03306b6557 -r 20b83bfd514f schema/HostSystem.registration --- a/schema/HostSystem.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostSystem.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_HostSystem root/virt Virt_HostSystemProvider Virt_HostSystem instance diff -r be03306b6557 -r 20b83bfd514f schema/HostedDependency.mof --- a/schema/HostedDependency.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedDependency.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,19 +1,19 @@ // Copyright IBM Corp. 2007 -// ================================================================== -// Xen_HostedDependency -// ================================================================== - [Association, Version ( "2.8.0" ), - UMLPackagePath ( "CIM::Core::CoreElements" ), Description ( - "HostedDependency defines a ManagedElement in the context of " - "another ManagedElement in which it resides.")] -class Xen_HostedDependency : CIM_HostedDependency { -}; -// ================================================================== -// KVM_HostedDependency -// ================================================================== - [Association, Version ( "2.8.0" ), - UMLPackagePath ( "CIM::Core::CoreElements" ), Description ( - "HostedDependency defines a ManagedElement in the context of " - "another ManagedElement in which it resides.")] -class KVM_HostedDependency : CIM_HostedDependency { -}; + +[Association, + Description ( + "HostedDependency defines a ManagedElement in the context of " + "another ManagedElement in which it resides.") +] +class Xen_HostedDependency : CIM_HostedDependency +{ +}; + +[Association, + Description ( + "HostedDependency defines a ManagedElement in the context of " + "another ManagedElement in which it resides.") +] +class KVM_HostedDependency : CIM_HostedDependency +{ +}; diff -r be03306b6557 -r 20b83bfd514f schema/HostedDependency.registration --- a/schema/HostedDependency.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedDependency.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_HostedDependency root/virt Virt_HostedDependencyProvider Virt_HostedDependency association diff -r be03306b6557 -r 20b83bfd514f schema/HostedResourcePool.mof --- a/schema/HostedResourcePool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedResourcePool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,16 +1,17 @@ // Copyright IBM Corp. 2007 + [Association, Description ( - "Associates a host system to its resource pools" -)] + "Associates a host system to its resource pools") +] class Xen_HostedResourcePool : CIM_HostedResourcePool { }; [Association, Description ( - "Associates a host system to its resource pools" -)] + "Associates a host system to its resource pools") +] class KVM_HostedResourcePool : CIM_HostedResourcePool { }; \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/HostedResourcePool.registration --- a/schema/HostedResourcePool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedResourcePool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association KVM_HostedResourcePool root/virt Virt_HostedResourcePoolProvider Virt_HostedResourcePool association \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/HostedService.mof --- a/schema/HostedService.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedService.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_HostedService : CIM_HostedService { + +[Association] +class Xen_HostedService : CIM_HostedService +{ }; -class KVM_HostedService : CIM_HostedService { +[Association] +class KVM_HostedService : CIM_HostedService +{ }; diff -r be03306b6557 -r 20b83bfd514f schema/HostedService.registration --- a/schema/HostedService.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/HostedService.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_HostedService root/virt Xen_HostedServiceProvider Virt_HostedService association KVM_HostedService root/virt KVM_HostedServiceProvider Virt_HostedService association diff -r be03306b6557 -r 20b83bfd514f schema/LogicalDisk.mof --- a/schema/LogicalDisk.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/LogicalDisk.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_LogicalDisk -// ================================================================== [Description ( "A class derived from CIM_LogicalDisk to represent " - "the Xen virtual disks on the system.")] + "the Xen virtual disks on the system.") +] class Xen_LogicalDisk : CIM_LogicalDisk { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_LogicalDisk -// ================================================================== [Description ( "A class derived from CIM_LogicalDisk to represent " - "the KVM virtual disks on the system.")] + "the KVM virtual disks on the system.") +] class KVM_LogicalDisk : CIM_LogicalDisk { }; diff -r be03306b6557 -r 20b83bfd514f schema/LogicalDisk.registration --- a/schema/LogicalDisk.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/LogicalDisk.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_LogicalDisk root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 20b83bfd514f schema/Memory.mof --- a/schema/Memory.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Memory.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,24 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// Xen_Memory -// ================================================================== +// Copyright IBM Corp. 2007 [Description ( "A class derived from CIM_Memory to represent " - "the Xen virtual memory.")] + "the Xen virtual memory.") +] class Xen_Memory : CIM_Memory { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_Memory -// ================================================================== [Description ( "A class derived from CIM_Memory to represent " - "the KVM virtual memory.")] + "the KVM virtual memory.") +] class KVM_Memory : CIM_Memory { }; diff -r be03306b6557 -r 20b83bfd514f schema/Memory.registration --- a/schema/Memory.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Memory.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_Memory root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_Memory root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 20b83bfd514f schema/MemoryPool.mof --- a/schema/MemoryPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/MemoryPool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,17 +1,9 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_MemoryPool -// ================================================================== class Xen_MemoryPool : CIM_ResourcePool { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_MemoryPool -// ================================================================== class KVM_MemoryPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 20b83bfd514f schema/MemoryPool.registration --- a/schema/MemoryPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/MemoryPool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_MemoryPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r be03306b6557 -r 20b83bfd514f schema/NetPool.mof --- a/schema/NetPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetPool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,7 +1,9 @@ // Copyright IBM Corp. 2007 + class Xen_NetworkPool : CIM_ResourcePool { }; + class KVM_NetworkPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 20b83bfd514f schema/NetPool.registration --- a/schema/NetPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetPool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance KVM_NetworkPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/NetworkPort.mof --- a/schema/NetworkPort.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetworkPort.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_NetworkPort -// ================================================================== [Description ( "A class derived from CIM_NetworkPort to represent " - "the Xen virtual network interfaces on the system.")] + "the Xen virtual network interfaces on the system.") +] class Xen_NetworkPort : CIM_NetworkPort { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_NetworkPort -// ================================================================== [Description ( "A class derived from CIM_NetworkPort to represent " - "the KVM virtual network interfaces on the system.")] + "the KVM virtual network interfaces on the system.") +] class KVM_NetworkPort : CIM_NetworkPort { }; diff -r be03306b6557 -r 20b83bfd514f schema/NetworkPort.registration --- a/schema/NetworkPort.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/NetworkPort.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_NetworkPort root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 20b83bfd514f schema/Processor.mof --- a/schema/Processor.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Processor.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_Processor -// ================================================================== [Description ( "A class derived from CIM_Processor to represent " - "the Xen virtual processors.")] + "the Xen virtual processors.") +] class Xen_Processor : CIM_Processor { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_Processor -// ================================================================== [Description ( "A class derived from CIM_Processor to represent " - "the KVM virtual processors.")] + "the KVM virtual processors.") +] class KVM_Processor : CIM_Processor { }; diff -r be03306b6557 -r 20b83bfd514f schema/Processor.registration --- a/schema/Processor.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/Processor.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_Processor root/virt Virt_DeviceProvider Virt_Device instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_Processor root/virt Virt_DeviceProvider Virt_Device instance diff -r be03306b6557 -r 20b83bfd514f schema/ProcessorPool.mof --- a/schema/ProcessorPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ProcessorPool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,17 +1,9 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_ProcessorPool -// ================================================================== class Xen_ProcessorPool : CIM_ResourcePool { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_ProcessorPool -// ================================================================== class KVM_ProcessorPool : CIM_ResourcePool { }; diff -r be03306b6557 -r 20b83bfd514f schema/ProcessorPool.registration --- a/schema/ProcessorPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ProcessorPool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_ProcessorPool root/virt Virt_DevicePoolProvider Virt_DevicePool instance diff -r be03306b6557 -r 20b83bfd514f schema/RegisteredProfile.mof --- a/schema/RegisteredProfile.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/RegisteredProfile.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,21 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_RegisteredProfile -// ================================================================== [Description ( "A class derived from CIM_RegisteredProfile to represent " - "an advertised conformant profile.")] + "an advertised conformant profile.") +] class Xen_RegisteredProfile : CIM_RegisteredProfile { }; -// ================================================================== -// KVM_RegisteredProfile -// ================================================================== [Description ( "A class derived from CIM_RegisteredProfile to represent " - "an advertised conformant profile.")] + "an advertised conformant profile.") +] class KVM_RegisteredProfile : CIM_RegisteredProfile { }; diff -r be03306b6557 -r 20b83bfd514f schema/RegisteredProfile.registration --- a/schema/RegisteredProfile.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/RegisteredProfile.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_RegisteredProfile root/interop Virt_RegisteredProfileProvider Virt_RegisteredProfile instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_RegisteredProfile root/interop Virt_RegisteredProfileProvider Virt_RegisteredProfile instance diff -r be03306b6557 -r 20b83bfd514f schema/ResourceAllocationFromPool.mof --- a/schema/ResourceAllocationFromPool.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationFromPool.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool { + +[Association] +class Xen_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool +{ }; -class KVM_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool { +[Association] +class KVM_ResourceAllocationFromPool : CIM_ResourceAllocationFromPool +{ }; diff -r be03306b6557 -r 20b83bfd514f schema/ResourceAllocationFromPool.registration --- a/schema/ResourceAllocationFromPool.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationFromPool.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ResourceAllocationFromPool root/virt Xen_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association KVM_ResourceAllocationFromPool root/virt KVM_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationSettingData.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,14 +1,16 @@ // Copyright IBM Corp. 2007 -class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { +class Xen_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData +{ }; -class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData { - +class KVM_ResourceAllocationSettingData : CIM_ResourceAllocationSettingData +{ }; [Description ("Xen virtual disk configuration")] -class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData{ +class Xen_DiskResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ [Description ("Device as seen by the guest")] string VirtualDevice; @@ -16,7 +18,8 @@ class Xen_DiskResourceAllocationSettingD }; [Description ("KVM virtual disk configuration")] -class KVM_DiskResourceAllocationSettingData : KVM_ResourceAllocationSettingData{ +class KVM_DiskResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ [Description ("Device as seen by the guest")] string VirtualDevice; @@ -24,7 +27,8 @@ class KVM_DiskResourceAllocationSettingD }; [Description ("Xen virtual network configuration")] -class Xen_NetResourceAllocationSettingData : Xen_ResourceAllocationSettingData { +class Xen_NetResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ [Description ("Interface type")] string NetworkType; @@ -32,7 +36,8 @@ class Xen_NetResourceAllocationSettingDa }; [Description ("KVM virtual network configuration")] -class KVM_NetResourceAllocationSettingData : KVM_ResourceAllocationSettingData { +class KVM_NetResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ [Description ("Interface type")] string NetworkType; @@ -40,13 +45,21 @@ class KVM_NetResourceAllocationSettingDa }; [Description ("Xen virtual processor")] -class Xen_ProcResourceAllocationSettingData : Xen_ResourceAllocationSettingData {}; +class Xen_ProcResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ +}; [Description ("KVM virtual processor")] -class KVM_ProcResourceAllocationSettingData : KVM_ResourceAllocationSettingData {}; +class KVM_ProcResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ +}; [Description ("Xen virtual memory")] -class Xen_MemResourceAllocationSettingData : Xen_ResourceAllocationSettingData {}; +class Xen_MemResourceAllocationSettingData : Xen_ResourceAllocationSettingData +{ +}; [Description ("KVM virtual memory")] -class KVM_MemResourceAllocationSettingData : KVM_ResourceAllocationSettingData {}; +class KVM_MemResourceAllocationSettingData : KVM_ResourceAllocationSettingData +{ +}; diff -r be03306b6557 -r 20b83bfd514f schema/ResourceAllocationSettingData.registration --- a/schema/ResourceAllocationSettingData.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourceAllocationSettingData.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,5 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_DiskResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance Xen_NetResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance Xen_ProcResourceAllocationSettingData root/virt Virt_RASDProvider Virt_RASD instance diff -r be03306b6557 -r 20b83bfd514f schema/ResourcePoolConfigurationCapabilities.mof --- a/schema/ResourcePoolConfigurationCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationCapabilities.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,7 +1,9 @@ // Copyright IBM Corp. 2007 -class Xen_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities { +class Xen_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities +{ }; -class KVM_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities { +class KVM_ResourcePoolConfigurationCapabilities : CIM_ResourcePoolConfigurationCapabilities +{ }; diff -r be03306b6557 -r 20b83bfd514f schema/ResourcePoolConfigurationCapabilities.registration --- a/schema/ResourcePoolConfigurationCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationCapabilities.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance KVM_ResourcePoolConfigurationCapabilities root/virt Virt_ResourcePoolConfigurationCapabilitiesProvider Virt_ResourcePoolConfigurationCapabilities instance \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/ResourcePoolConfigurationService.mof --- a/schema/ResourcePoolConfigurationService.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationService.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,8 +1,9 @@ // Copyright IBM Corp. 2007 -class Xen_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { +class Xen_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService +{ }; -class KVM_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService { - -}; \ No newline at end of file +class KVM_ResourcePoolConfigurationService : CIM_ResourcePoolConfigurationService +{ +}; diff -r be03306b6557 -r 20b83bfd514f schema/ResourcePoolConfigurationService.registration --- a/schema/ResourcePoolConfigurationService.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/ResourcePoolConfigurationService.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method KVM_ResourcePoolConfigurationService root/virt Virt_ResourcePoolConfigurationServiceProvider Virt_ResourcePoolConfigurationService instance method \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/SettingsDefineCapabilities.mof --- a/schema/SettingsDefineCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineCapabilities.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,8 +1,11 @@ // Copyright IBM Corp. 2007 + +[Association] class Xen_SettingsDefineCapabilities : CIM_SettingsDefineCapabilities { }; +[Association] class KVM_SettingsDefineCapabilities : CIM_SettingsDefineCapabilities { }; diff -r be03306b6557 -r 20b83bfd514f schema/SettingsDefineCapabilities.registration --- a/schema/SettingsDefineCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineCapabilities.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... -Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association -KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +# Classname Namespace ProviderName ProviderModule ProviderTypes +Xen_SettingsDefineCapabilities root/virt Xen_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association +KVM_SettingsDefineCapabilities root/virt KVM_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association diff -r be03306b6557 -r 20b83bfd514f schema/SettingsDefineState.mof --- a/schema/SettingsDefineState.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineState.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_SettingsDefineState : CIM_SettingsDefineState { + +[Association] +class Xen_SettingsDefineState : CIM_SettingsDefineState +{ }; -class KVM_SettingsDefineState : CIM_SettingsDefineState { +[Association] +class KVM_SettingsDefineState : CIM_SettingsDefineState +{ }; \ No newline at end of file diff -r be03306b6557 -r 20b83bfd514f schema/SettingsDefineState.registration --- a/schema/SettingsDefineState.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SettingsDefineState.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association diff -r be03306b6557 -r 20b83bfd514f schema/SystemDevice.mof --- a/schema/SystemDevice.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SystemDevice.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,44 +1,32 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ******************************************************************* -// Associations -// ******************************************************************* - -// ================================================================== -// Xen_SystemDevice -// ================================================================== [Association, Description ( - "A class to associate a Xen_ComputerSystem with its devices" -)] + "A class to associate a Xen_ComputerSystem with its devices." ) +] class Xen_SystemDevice : CIM_SystemDevice { + [Override ( "GroupComponent" )] Xen_ComputerSystem REF GroupComponent; [Override ( "PartComponent" )] CIM_LogicalDevice REF PartComponent; + }; -// Copyright 2007 IBM. All rights reserved. - -// ******************************************************************* -// Associations -// ******************************************************************* - -// ================================================================== -// KVM_SystemDevice -// ================================================================== [Association, Description ( - "A class to associate a KVM_ComputerSystem with its devices" -)] + "A class to associate a KVM_ComputerSystem with its devices." ) +] class KVM_SystemDevice : CIM_SystemDevice { + [Override ( "GroupComponent" )] KVM_ComputerSystem REF GroupComponent; [Override ( "PartComponent" )] CIM_LogicalDevice REF PartComponent; + }; diff -r be03306b6557 -r 20b83bfd514f schema/SystemDevice.registration --- a/schema/SystemDevice.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/SystemDevice.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_SystemDevice root/virt Xen_SystemDeviceProvider Virt_SystemDevice association KVM_SystemDevice root/virt KVM_SystemDeviceProvider Virt_SystemDevice association diff -r be03306b6557 -r 20b83bfd514f schema/VSSD.mof --- a/schema/VSSD.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSD.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,16 +1,21 @@ // Copyright IBM Corp. 2007 + [Description ( "A class derived from CIM_VirtualSystemSettingData to represent " - "the config of Xen virtual machines/domains running on the system.")] + "the config of Xen virtual machines/domains running on the system.") +] class Xen_VirtualSystemSettingData : CIM_VirtualSystemSettingData { + string Bootloader; string BootloaderArgs; + }; [Description ( "A class derived from CIM_VirtualSystemSettingData to represent " - "the config of KVM virtual machines/domains running on the system.")] + "the config of KVM virtual machines/domains running on the system.") +] class KVM_VirtualSystemSettingData : CIM_VirtualSystemSettingData { }; diff -r be03306b6557 -r 20b83bfd514f schema/VSSD.registration --- a/schema/VSSD.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSD.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance KVM_VirtualSystemSettingData root/virt Virt_VSSDProvider Virt_VSSD instance diff -r be03306b6557 -r 20b83bfd514f schema/VSSDComponent.mof --- a/schema/VSSDComponent.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSDComponent.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,6 +1,11 @@ // Copyright IBM Corp. 2007 -class Xen_VirtualSystemSettingDataComponent : CIM_Component { + +[Association] +class Xen_VirtualSystemSettingDataComponent : CIM_Component +{ }; -class KVM_VirtualSystemSettingDataComponent : CIM_Component { +[Association] +class KVM_VirtualSystemSettingDataComponent : CIM_Component +{ }; diff -r be03306b6557 -r 20b83bfd514f schema/VSSDComponent.registration --- a/schema/VSSDComponent.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VSSDComponent.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association diff -r be03306b6557 -r 20b83bfd514f schema/VirtualSystemManagementCapabilities.mof --- a/schema/VirtualSystemManagementCapabilities.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementCapabilities.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,23 +1,17 @@ -// Copyright 2007 IBM. All rights reserved. +// Copyright IBM Corp. 2007 -// ================================================================== -// Xen_VirtualSystemManagementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the management capabilities of a Xen virtual system")] + "the management capabilities of a Xen virtual system") +] class Xen_VirtualSystemManagementCapabilities : CIM_VirtualSystemManagementCapabilities { }; -// Copyright 2007 IBM. All rights reserved. - -// ================================================================== -// KVM_VirtualSystemManagementCapabilities -// ================================================================== [Description ( "A class derived from CIM_Capabilities to represent " - "the management capabilities of a KVM virtual system.")] + "the management capabilities of a KVM virtual system.") +] class KVM_VirtualSystemManagementCapabilities : CIM_VirtualSystemManagementCapabilities { }; diff -r be03306b6557 -r 20b83bfd514f schema/VirtualSystemManagementCapabilities.registration --- a/schema/VirtualSystemManagementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementCapabilities.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,5 +1,4 @@ # Copyright IBM Corp. 2007 -# Classname Namespace ProviderName ProviderModule ProviderTypes ... +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance -# Classname Namespace ProviderName ProviderModule ProviderTypes ... KVM_VirtualSystemManagementCapabilities root/virt Virt_VirtualSystemManagementCapabilitiesProvider Virt_VirtualSystemManagementCapabilities instance diff -r be03306b6557 -r 20b83bfd514f schema/VirtualSystemManagementService.mof --- a/schema/VirtualSystemManagementService.mof Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementService.mof Mon Nov 12 12:39:16 2007 +0100 @@ -1,6 +1,9 @@ // Copyright IBM Corp. 2007 -class Xen_VirtualSystemManagementService : CIM_VirtualSystemManagementService { + +class Xen_VirtualSystemManagementService : CIM_VirtualSystemManagementService +{ }; -class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService { +class KVM_VirtualSystemManagementService : CIM_VirtualSystemManagementService +{ }; diff -r be03306b6557 -r 20b83bfd514f schema/VirtualSystemManagementService.registration --- a/schema/VirtualSystemManagementService.registration Mon Nov 12 12:16:21 2007 +0100 +++ b/schema/VirtualSystemManagementService.registration Mon Nov 12 12:39:16 2007 +0100 @@ -1,3 +1,4 @@ # Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance From heidieck at linux.vnet.ibm.com Mon Nov 12 11:48:02 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 12 Nov 2007 12:48:02 +0100 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel In-Reply-To: <20b83bfd514faa824c55.1194867714@localhost.localdomain> References: <20b83bfd514faa824c55.1194867714@localhost.localdomain> Message-ID: <47383D72.4000602@linux.vnet.ibm.com> I had to resend the patch as I forgot to take care of the new HostedService association in the first one. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From grendel at linux.vnet.ibm.com Mon Nov 12 14:49:25 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 12 Nov 2007 09:49:25 -0500 Subject: [Libvirt-cim] [PATCH] Register association ElementCapabilities to root/virt namespace In-Reply-To: References: Message-ID: <473867F5.5080807@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1194866181 -3600 > # Node ID be03306b6557177c68d4fb936cd8e38a234daff7 > # Parent 3e2881417ccd3898228179694d3a34bcc9a976ce > Register association ElementCapabilities to root/virt namespace > Signed-off-by: Heidi Eckhart > > diff -r 3e2881417ccd -r be03306b6557 schema/ElementCapabilities.registration > --- a/schema/ElementCapabilities.registration Fri Nov 09 15:57:52 2007 -0800 > +++ b/schema/ElementCapabilities.registration Mon Nov 12 12:16:21 2007 +0100 > @@ -1,4 +1,4 @@ > # Copyright IBM Corp. 2007 > # Classname Namespace ProviderName ProviderModule ProviderTypes ... > -Xen_ElementCapabilities root/interop Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association > -KVM_ElementCapabilities root/interop KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association > +Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association > +KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Quick and clean, my favorite kind of patch. :) +1 -- -Jay From danms at us.ibm.com Mon Nov 12 15:14:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 07:14:48 -0800 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel References: <20b83bfd514faa824c55.1194867714@localhost.localdomain> Message-ID: <87r6iv7axj.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1194867556 -3600 HE> # Node ID 20b83bfd514faa824c5565cdf8703ada146e9e56 HE> # Parent be03306b6557177c68d4fb936cd8e38a234daff7 HE> Updated Copyright Statements and common schema look and feel This doesn't apply cleanly for me. It rejects the entire HostedDependency.mof file. Can you check to make sure this applies cleanly against the up-to-date tree? Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Mon Nov 12 15:26:54 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 12 Nov 2007 10:26:54 -0500 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: <47347DBF.6060603@linux.vnet.ibm.com> References: <2d09468e2de7ed919490.1194558685@wulfgar> <87ir4cxotd.fsf@theine.beaverton.ibm.com> <47347DBF.6060603@linux.vnet.ibm.com> Message-ID: <473870BE.4020307@linux.vnet.ibm.com> Jay Gagnon wrote: > Dan Smith wrote: > >> JG> + cpuinfo = fopen("/proc/cpuinfo", "r"); >> >> This should come from virNodeInfo. >> > Okay. Only question before I do that is do we have virNodeInfo in all > the versions of libvirt we support? The only reason I had to write this > myself at all is that the libvirt function that determines the maximum > number of vcpus came in too late for us. > Looks like this question got lost in the shuffle. What version of libvirt are we actually writing against? In other words, of the versions shipped with the various distributions we're supporting, which one is the oldest? I want to make sure I don't try to use something that is too new. -- -Jay From danms at us.ibm.com Mon Nov 12 15:37:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 07:37:30 -0800 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: <473870BE.4020307@linux.vnet.ibm.com> (Jay Gagnon's message of "Mon, 12 Nov 2007 10:26:54 -0500") References: <2d09468e2de7ed919490.1194558685@wulfgar> <87ir4cxotd.fsf@theine.beaverton.ibm.com> <47347DBF.6060603@linux.vnet.ibm.com> <473870BE.4020307@linux.vnet.ibm.com> Message-ID: <87640779vp.fsf@theine.beaverton.ibm.com> JG> What version of libvirt are we actually writing against? In other JG> words, of the versions shipped with the various distributions JG> we're supporting, which one is the oldest? I want to make sure I JG> don't try to use something that is too new. I think that for right now, we should aim at the latest libvirt release. If someone needs to run libvirt-cim on an older stack, we can evaluate and address issues with a specific version in mind. That said, I'm not sure what version this node info call was added in, but it seems rather fundamental, so I would hope it's been around for a while :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Mon Nov 12 16:01:12 2007 From: veillard at redhat.com (Daniel Veillard) Date: Mon, 12 Nov 2007 11:01:12 -0500 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: <473870BE.4020307@linux.vnet.ibm.com> References: <2d09468e2de7ed919490.1194558685@wulfgar> <87ir4cxotd.fsf@theine.beaverton.ibm.com> <47347DBF.6060603@linux.vnet.ibm.com> <473870BE.4020307@linux.vnet.ibm.com> Message-ID: <20071112160112.GE9936@redhat.com> On Mon, Nov 12, 2007 at 10:26:54AM -0500, Jay Gagnon wrote: > Jay Gagnon wrote: > > Dan Smith wrote: > > > >> JG> + cpuinfo = fopen("/proc/cpuinfo", "r"); > >> > >> This should come from virNodeInfo. > >> > > Okay. Only question before I do that is do we have virNodeInfo in all > > the versions of libvirt we support? The only reason I had to write this > > myself at all is that the libvirt function that determines the maximum > > number of vcpus came in too late for us. > > > Looks like this question got lost in the shuffle. What version of > libvirt are we actually writing against? In other words, of the > versions shipped with the various distributions we're supporting, which > one is the oldest? I want to make sure I don't try to use something > that is too new. See virNodeGetInfo in the table http://libvirt.org/hvsupport.html it's there since 0.1.0 (at least for Xen), so no problem, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From grendel at linux.vnet.ibm.com Mon Nov 12 16:31:11 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 12 Nov 2007 11:31:11 -0500 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: <20071112160112.GE9936@redhat.com> References: <2d09468e2de7ed919490.1194558685@wulfgar> <87ir4cxotd.fsf@theine.beaverton.ibm.com> <47347DBF.6060603@linux.vnet.ibm.com> <473870BE.4020307@linux.vnet.ibm.com> <20071112160112.GE9936@redhat.com> Message-ID: <47387FCF.3060107@linux.vnet.ibm.com> Daniel Veillard wrote: > On Mon, Nov 12, 2007 at 10:26:54AM -0500, Jay Gagnon wrote: > >> Jay Gagnon wrote: >> >>> Dan Smith wrote: >>> >>> >>>> JG> + cpuinfo = fopen("/proc/cpuinfo", "r"); >>>> >>>> This should come from virNodeInfo. >>>> >>>> >>> Okay. Only question before I do that is do we have virNodeInfo in all >>> the versions of libvirt we support? The only reason I had to write this >>> myself at all is that the libvirt function that determines the maximum >>> number of vcpus came in too late for us. >>> >>> >> Looks like this question got lost in the shuffle. What version of >> libvirt are we actually writing against? In other words, of the >> versions shipped with the various distributions we're supporting, which >> one is the oldest? I want to make sure I don't try to use something >> that is too new. >> > > See virNodeGetInfo in the table > http://libvirt.org/hvsupport.html > it's there since 0.1.0 (at least for Xen), so no problem, > > Daniel > > Heh, yea looks like we should be all right. I hadn't seen that table before, definitely good to know that exists. -- -Jay From danms at us.ibm.com Mon Nov 12 18:03:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 11:03:26 -0700 Subject: [Libvirt-cim] [PATCH] Make the EO parser not depend on root/ibmsd namespace Message-ID: <6f09834081cf603e73b8.1194894206@theine> # HG changeset patch # User Dan Smith # Date 1194894184 28800 # Node ID 6f09834081cf603e73b82376f738e4384206ffc9 # Parent cbed0b1c5f006d83a0a3a12d4f379a5a0173a31e Make the EO parser not depend on root/ibmsd namespace This EO parser needs some serious work. It's not even remotely thread-safe and it's pretty crusty. This doesn't make it any less thread safe than it already was, and it makes us not break things that depend on EO parsing. I'll take a TODO to fix this up a bit sometime in the future. Signed-off-by: Dan Smith diff -r cbed0b1c5f00 -r 6f09834081cf eo_parser.c --- a/eo_parser.c Fri Nov 09 15:38:44 2007 -0800 +++ b/eo_parser.c Mon Nov 12 11:03:04 2007 -0800 @@ -35,7 +35,7 @@ #define TEMPLATE "/tmp/tmp_eo_parse.XXXXXX" void eo_parse_restart(FILE *); -int eo_parse_parseinstance(const CMPIBroker *, CMPIInstance **); +int eo_parse_parseinstance(const CMPIBroker *, CMPIInstance **, const char *ns); static int write_temp(char *eo) { @@ -64,6 +64,7 @@ static int write_temp(char *eo) int cu_parse_embedded_instance(const char *eo, const CMPIBroker *broker, + const char *ns, CMPIInstance **instance) { int ret; @@ -77,7 +78,7 @@ int cu_parse_embedded_instance(const cha fp = fdopen(fd, "r"); eo_parse_restart(fp); - ret = eo_parse_parseinstance(broker, instance); + ret = eo_parse_parseinstance(broker, instance, ns); close(fd); #else diff -r cbed0b1c5f00 -r 6f09834081cf eo_util_parser.y --- a/eo_util_parser.y Fri Nov 09 15:38:44 2007 -0800 +++ b/eo_util_parser.y Mon Nov 12 11:03:04 2007 -0800 @@ -22,8 +22,9 @@ void eo_parse_error(char *); #define RC_EOF EOF /* DEFINE ANY GLOBAL VARS HERE */ -static CMPIBroker * _BROKER; +static const CMPIBroker * _BROKER; static CMPIInstance ** _INSTANCE; +static const char * _NAMESPACE; #ifdef EODEBUG #define EOTRACE(fmt, arg...) fprintf(stderr, fmt, ##arg) @@ -31,7 +32,9 @@ static CMPIInstance ** _INSTANCE; #define EOTRACE(fmt, arg...) #endif -int eo_parse_parseinstance(CMPIBroker *broker, CMPIInstance **instance); +int eo_parse_parseinstance(const CMPIBroker *broker, + CMPIInstance **instance, + const char *ns); %} @@ -64,7 +67,7 @@ instance: /* empty */ EOTRACE("classname = %s\n",$3); CMPIObjectPath *op; op = CMNewObjectPath(_BROKER, - "root/ibmsd", + _NAMESPACE, $3, NULL); *_INSTANCE = CMNewInstance(_BROKER, @@ -125,10 +128,13 @@ property: PROPERTYNAME '=' STRING ';' /* USER SUBROUTINE SECTION */ -int eo_parse_parseinstance(CMPIBroker *broker, CMPIInstance **instance) +int eo_parse_parseinstance(const CMPIBroker *broker, + CMPIInstance **instance, + const char *ns) { _BROKER = broker; _INSTANCE = instance; + _NAMESPACE = ns; /* Parse the next instance */ return(eo_parse_parse()); diff -r cbed0b1c5f00 -r 6f09834081cf libcmpiutil.h --- a/libcmpiutil.h Fri Nov 09 15:38:44 2007 -0800 +++ b/libcmpiutil.h Mon Nov 12 11:03:04 2007 -0800 @@ -277,12 +277,14 @@ CMPIType cu_arg_type(const CMPIArgs *arg * * @param eo The embedded instance string * @param broker A pointer to the current broker + * @param ns The namespace for the new instance * @param instance A pointer to an instance pointer to hold the result * @returns nonzero on success * */ int cu_parse_embedded_instance(const char *eo, const CMPIBroker *broker, + const char *ns, CMPIInstance **instance); /** From danms at us.ibm.com Mon Nov 12 18:08:51 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 11:08:51 -0700 Subject: [Libvirt-cim] [PATCH] Update VSMS to pass a namespace when parsing EO method arguments Message-ID: # HG changeset patch # User Dan Smith # Date 1194894466 28800 # Node ID c7572e9cdf49a37b96375e799c7b9818ae36fd1d # Parent 9fd4142d9739977cc3b49e3373461373a57365ec Update VSMS to pass a namespace when parsing EO method arguments Signed-off-by: Dan Smith diff -r 9fd4142d9739 -r c7572e9cdf49 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 12 12:16:21 2007 +0100 +++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 12 11:07:46 2007 -0800 @@ -51,6 +51,7 @@ const static CMPIBroker *_BROKER; const static CMPIBroker *_BROKER; static int parse_str_inst_array(CMPIArray *array, + const char *ns, struct inst_list *list) { int count; @@ -67,8 +68,9 @@ static int parse_str_inst_array(CMPIArra /* FIXME: Check for string here */ ret = cu_parse_embedded_instance(CMGetCharPtr(item.value.string), - _BROKER, - &inst); + _BROKER, + ns, + &inst); if (ret == 0) inst_list_add(list, inst); @@ -79,6 +81,7 @@ static int parse_str_inst_array(CMPIArra static CMPIStatus define_system_parse_args(const CMPIArgs *argsin, CMPIInstance **sys, + const char *ns, struct inst_list *res) { CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; @@ -92,7 +95,10 @@ static CMPIStatus define_system_parse_ar goto out; } - ret = cu_parse_embedded_instance(sys_str, _BROKER, sys); + ret = cu_parse_embedded_instance(sys_str, + _BROKER, + ns, + sys); if (ret) { CU_DEBUG("Unable to parse SystemSettings instance"); CMSetStatusWithChars(_BROKER, &s, @@ -107,7 +113,7 @@ static CMPIStatus define_system_parse_ar goto out; } - ret = parse_str_inst_array(res_arr, res); + ret = parse_str_inst_array(res_arr, ns, res); CMSetStatus(&s, CMPI_RC_OK); @@ -371,7 +377,7 @@ static CMPIStatus define_system(CMPIMeth CU_DEBUG("DefineSystem"); - s = define_system_parse_args(argsin, &vssd, &res); + s = define_system_parse_args(argsin, &vssd, NAMESPACE(reference), &res); if (s.rc != CMPI_RC_OK) goto out; @@ -527,7 +533,10 @@ static CMPIStatus mod_system_settings(CM return s; } - if (cu_parse_embedded_instance(inst_str, _BROKER, &inst)) { + if (cu_parse_embedded_instance(inst_str, + _BROKER, + NAMESPACE(reference), + &inst)) { CMPIStatus s; cu_statusf(_BROKER, &s, @@ -889,7 +898,7 @@ static CMPIStatus update_resource_settin goto out; } - parse_str_inst_array(array, &list); + parse_str_inst_array(array, NAMESPACE(ref), &list); s = _update_resource_settings(ref, &list, func); From danms at us.ibm.com Mon Nov 12 18:59:17 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 11:59:17 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Dynamic memory ballooning Message-ID: This set adds dynamic memory ballooning when a client does a ModifyResourceSettings on the Memory RASD. From danms at us.ibm.com Mon Nov 12 18:59:18 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 11:59:18 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add device change support (just for memory right now) In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1194897180 28800 # Node ID f86d7a5bfa6b597d3909eae06f367ec640fb0a2c # Parent c7572e9cdf49a37b96375e799c7b9818ae36fd1d Add device change support (just for memory right now) Signed-off-by: Dan Smith diff -r c7572e9cdf49 -r f86d7a5bfa6b libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Mon Nov 12 11:07:46 2007 -0800 +++ b/libxkutil/device_parsing.c Mon Nov 12 11:53:00 2007 -0800 @@ -615,9 +615,9 @@ void cleanup_dominfo(struct domain **dom *dominfo = NULL; } -static int change_device(virDomainPtr dom, - struct virt_device *dev, - bool attach) +static int _change_device(virDomainPtr dom, + struct virt_device *dev, + bool attach) { char *xml = NULL; int ret = 0; @@ -648,11 +648,28 @@ static int change_device(virDomainPtr do } +static int change_memory(virDomainPtr dom, + struct virt_device *dev) +{ + CU_DEBUG("Changing memory of %s to %llu/%llu", + virDomainGetName(dom), + dev->dev.mem.size, + dev->dev.mem.maxsize); + + if (virDomainSetMemory(dom, dev->dev.mem.size)) + return 0; + + if (virDomainSetMaxMemory(dom, dev->dev.mem.maxsize)) + return 0; + + return 1; +} + int attach_device(virDomainPtr dom, struct virt_device *dev) { if ((dev->type == VIRT_DEV_NET) || (dev->type == VIRT_DEV_DISK)) - return change_device(dom, dev, true); + return _change_device(dom, dev, true); CU_DEBUG("Unhandled device type %i", dev->type); @@ -663,7 +680,17 @@ int detach_device(virDomainPtr dom, stru { if ((dev->type == VIRT_DEV_NET) || (dev->type == VIRT_DEV_DISK)) - return change_device(dom, dev, false); + return _change_device(dom, dev, false); + + CU_DEBUG("Unhandled device type %i", dev->type); + + return 0; +} + +int change_device(virDomainPtr dom, struct virt_device *dev) +{ + if (dev->type == VIRT_DEV_MEM) + return change_memory(dom, dev); CU_DEBUG("Unhandled device type %i", dev->type); diff -r c7572e9cdf49 -r f86d7a5bfa6b libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Mon Nov 12 11:07:46 2007 -0800 +++ b/libxkutil/device_parsing.h Mon Nov 12 11:53:00 2007 -0800 @@ -113,6 +113,7 @@ int parse_fq_devid(char *devid, char **h int attach_device(virDomainPtr dom, struct virt_device *dev); int detach_device(virDomainPtr dom, struct virt_device *dev); +int change_device(virDomainPtr dom, struct virt_device *dev); #endif From danms at us.ibm.com Mon Nov 12 18:59:19 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 11:59:19 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Make memory device changes dynamic In-Reply-To: Message-ID: <50be717355487fc76bd7.1194897559@theine> # HG changeset patch # User Dan Smith # Date 1194897181 28800 # Node ID 50be717355487fc76bd725e71201d49564b77edf # Parent f86d7a5bfa6b597d3909eae06f367ec640fb0a2c Make memory device changes dynamic Refuse to add or delete a memory device of course, but allow modify Signed-off-by: Dan Smith diff -r f86d7a5bfa6b -r 50be71735548 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 12 11:53:00 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 12 11:53:01 2007 -0800 @@ -50,6 +50,12 @@ const static CMPIBroker *_BROKER; +enum ResourceAction { + RESOURCE_ADD, + RESOURCE_DEL, + RESOURCE_MOD, +}; + static int parse_str_inst_array(CMPIArray *array, const char *ns, struct inst_list *list) @@ -568,6 +574,9 @@ static struct virt_device **find_list(st } else if (type == VIRT_DEV_VCPU) { list = &dominfo->dev_vcpu; *count = &dominfo->dev_vcpu_ct; + } else if (type == VIRT_DEV_MEM) { + list = &dominfo->dev_mem; + *count = &dominfo->dev_mem_ct; } return list; @@ -575,17 +584,26 @@ static struct virt_device **find_list(st static CMPIStatus _resource_dynamic(struct domain *dominfo, struct virt_device *dev, - bool attach) + enum ResourceAction action) { CMPIStatus s; virConnectPtr conn; virDomainPtr dom; int (*func)(virDomainPtr, struct virt_device *); - if (attach) + if (action == RESOURCE_ADD) func = attach_device; - else + else if (action == RESOURCE_DEL) func = detach_device; + else if (action == RESOURCE_MOD) + func = change_device; + else { + CU_DEBUG("Unknown dynamic resource action: %i", action); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Internal error (undefined resource action)"); + return s; + } conn = lv_connect(_BROKER, &s); if (conn == NULL) { @@ -614,8 +632,8 @@ static CMPIStatus _resource_dynamic(stru if (func(dom, dev) == 0) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Unable to %s device", - attach ? "attach" : "detach"); + "Unable to change (%i) device", + action); } else { CMSetStatus(&s, CMPI_RC_OK); } @@ -638,7 +656,7 @@ static CMPIStatus resource_del(struct do int i; _list = find_list(dominfo, type, &count); - if (_list != NULL) + if ((type == CIM_RASD_TYPE_MEM) || (_list != NULL)) list = *_list; else { cu_statusf(_BROKER, &s, @@ -656,7 +674,7 @@ static CMPIStatus resource_del(struct do struct virt_device *dev = &list[i]; if (STREQ(dev->id, devid)) { - s = _resource_dynamic(dominfo, dev, false); + s = _resource_dynamic(dominfo, dev, RESOURCE_DEL); dev->type = VIRT_DEV_UNKNOWN; break; } @@ -678,7 +696,7 @@ static CMPIStatus resource_add(struct do int *count; _list = find_list(dominfo, type, &count); - if (_list == NULL) { + if ((type == CIM_RASD_TYPE_MEM) || (_list == NULL)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Cannot add resources of type %" PRIu16, @@ -713,7 +731,7 @@ static CMPIStatus resource_add(struct do dev->id = strdup(devid); rasd_to_vdev(rasd, dev); - s = _resource_dynamic(dominfo, dev, true); + s = _resource_dynamic(dominfo, dev, RESOURCE_ADD); if (s.rc != CMPI_RC_OK) goto out; @@ -755,7 +773,7 @@ static CMPIStatus resource_mod(struct do if (STREQ(dev->id, devid)) { rasd_to_vdev(rasd, dev); - CMSetStatus(&s, CMPI_RC_OK); + s = _resource_dynamic(dominfo, dev, RESOURCE_MOD); break; } } From kaitlin at linux.vnet.ibm.com Mon Nov 12 20:05:18 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 12:05:18 -0800 Subject: [Libvirt-cim] [PATCH] Make the EO parser not depend on root/ibmsd namespace In-Reply-To: <6f09834081cf603e73b8.1194894206@theine> References: <6f09834081cf603e73b8.1194894206@theine> Message-ID: <4738B1FE.5030203@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194894184 28800 > # Node ID 6f09834081cf603e73b82376f738e4384206ffc9 > # Parent cbed0b1c5f006d83a0a3a12d4f379a5a0173a31e > Make the EO parser not depend on root/ibmsd namespace > > This EO parser needs some serious work. It's not even remotely thread-safe > and it's pretty crusty. This doesn't make it any less thread safe than > it already was, and it makes us not break things that depend on EO parsing. > I'll take a TODO to fix this up a bit sometime in the future. > > Signed-off-by: Dan Smith > Good catch - looks nice and generic now. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Mon Nov 12 20:08:06 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 12 Nov 2007 15:08:06 -0500 Subject: [Libvirt-cim] [PATCH] Update VSMS to pass a namespace when parsing EO method arguments In-Reply-To: References: Message-ID: <4738B2A6.9040704@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194894466 28800 > # Node ID c7572e9cdf49a37b96375e799c7b9818ae36fd1d > # Parent 9fd4142d9739977cc3b49e3373461373a57365ec > Update VSMS to pass a namespace when parsing EO method arguments > > Signed-off-by: Dan Smith > > > Looks good. +1 -- -Jay From kaitlin at linux.vnet.ibm.com Mon Nov 12 21:39:51 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 13:39:51 -0800 Subject: [Libvirt-cim] [PATCH 0 of 2] Dynamic memory ballooning In-Reply-To: References: Message-ID: <4738C827.5010308@linux.vnet.ibm.com> Dan Smith wrote: > This set adds dynamic memory ballooning when a client does a > ModifyResourceSettings on the Memory RASD. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Good set of changes. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Mon Nov 12 21:36:23 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 14:36:23 -0700 Subject: [Libvirt-cim] [PATCH] Handle the case where bootloader (and _args) is not specified Message-ID: <44fb749aa036b3ccaeed.1194906983@theine> # HG changeset patch # User Dan Smith # Date 1194905179 28800 # Node ID 44fb749aa036b3ccaeed3862a302a3848cea3822 # Parent 4ceb57b4430b0455ef7cb68f57a8ec6ad01abeca Handle the case where bootloader (and _args) is not specified Otherwise, there is an error starting the domain because the bootloader is not executable. Signed-off-by: Dan Smith diff -r 4ceb57b4430b -r 44fb749aa036 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Mon Nov 12 13:54:53 2007 -0800 +++ b/libxkutil/xmlgen.c Mon Nov 12 14:06:19 2007 -0800 @@ -244,21 +244,29 @@ static char *system_xml(struct domain *d static char *system_xml(struct domain *domain) { int ret; - char *xml; + char *bl = NULL; + char *bl_args = NULL; + char *xml; + + bl = tagify("bootloader", domain->bootloader, NULL, 0); + bl_args = tagify("bootloader_args", domain->bootloader_args, NULL, 0); ret = asprintf(&xml, "%s\n" - "%s\n" - "%s\n" + "%s\n" + "%s\n" "%s\n" "%s\n", domain->name, - domain->bootloader, - domain->bootloader_args, + bl, + bl_args, vssd_recovery_action_str(domain->on_poweroff), vssd_recovery_action_str(domain->on_crash)); if (ret == -1) xml = NULL; + + free(bl); + free(bl_args); return xml; } From danms at us.ibm.com Mon Nov 12 21:36:32 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 14:36:32 -0700 Subject: [Libvirt-cim] [PATCH] Fix crash if create_system() returns a NULL instance Message-ID: # HG changeset patch # User Dan Smith # Date 1194905315 28800 # Node ID c3aebc961483f72f6a60795b5902499cd4422a9e # Parent 44fb749aa036b3ccaeed3862a302a3848cea3822 Fix crash if create_system() returns a NULL instance Signed-off-by: Dan Smith diff -r 44fb749aa036 -r c3aebc961483 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 12 14:06:19 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 12 14:08:35 2007 -0800 @@ -388,6 +388,8 @@ static CMPIStatus define_system(CMPIMeth goto out; sys = create_system(vssd, &res, reference, &s); + if (sys == NULL) + goto out; inst_list_free(&res); From kaitlin at linux.vnet.ibm.com Tue Nov 13 00:06:04 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 17:06:04 -0700 Subject: [Libvirt-cim] [PATCH] This fixes a potential crash if _get_domain() is unable to properly parse the dom XML Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1194912941 28800 # Node ID f2966070990024afbad3ee79dd5f276b0310aa2e # Parent 4ceb57b4430b0455ef7cb68f57a8ec6ad01abeca This fixes a potential crash if _get_domain() is unable to properly parse the dom XML. Also fixes an issue in VSSD - if get_domaininfo() returns 0 (an error), then instance_from_dom() needs to set ret properly so that an empty instance won't be created. Signed-off-by: Kaitlin Rupert diff -r 4ceb57b4430b -r f29660709900 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Mon Nov 12 13:54:53 2007 -0800 +++ b/libxkutil/device_parsing.c Mon Nov 12 16:15:41 2007 -0800 @@ -575,10 +575,17 @@ int get_dominfo(virDomainPtr dom, struct xml = virDomainGetXMLDesc(dom, 0); if (!xml) { free(*dominfo); + *dominfo = NULL; return 0; } ret = _get_dominfo(xml, *dominfo); + if (!ret) { + free(*dominfo); + *dominfo = NULL; + return 0; + } + free(xml); (*dominfo)->dev_mem_ct = get_mem_devices(dom, &(*dominfo)->dev_mem); diff -r 4ceb57b4430b -r f29660709900 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Nov 12 13:54:53 2007 -0800 +++ b/src/Virt_VSSD.c Mon Nov 12 16:15:41 2007 -0800 @@ -45,7 +45,8 @@ static int instance_from_dom(virDomainPt CMPIObjectPath *op; struct domain *dominfo = NULL; - if (!get_dominfo(dom, &dominfo)) + ret = get_dominfo(dom, &dominfo); + if (!ret) goto out; op = CMGetObjectPath(inst, NULL); From kaitlin at linux.vnet.ibm.com Tue Nov 13 00:53:39 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 16:53:39 -0800 Subject: [Libvirt-cim] [PATCH] Handle the case where bootloader (and _args) is not specified In-Reply-To: <44fb749aa036b3ccaeed.1194906983@theine> References: <44fb749aa036b3ccaeed.1194906983@theine> Message-ID: <4738F593.8090106@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194905179 28800 > # Node ID 44fb749aa036b3ccaeed3862a302a3848cea3822 > # Parent 4ceb57b4430b0455ef7cb68f57a8ec6ad01abeca > Handle the case where bootloader (and _args) is not specified > > Otherwise, there is an error starting the domain because the bootloader > is not executable. > > Signed-off-by: Dan Smith > Looks fine to me. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Tue Nov 13 00:56:45 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 16:56:45 -0800 Subject: [Libvirt-cim] [PATCH] Fix crash if create_system() returns a NULL instance In-Reply-To: References: Message-ID: <4738F64D.20903@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1194905315 28800 > # Node ID c3aebc961483f72f6a60795b5902499cd4422a9e > # Parent 44fb749aa036b3ccaeed3862a302a3848cea3822 > Fix crash if create_system() returns a NULL instance > > Signed-off-by: Dan Smith > Makes sense +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 13 00:57:04 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 16:57:04 -0800 Subject: [Libvirt-cim] [PATCH] This fixes a potential crash if _get_domain() is unable to properly parse the dom XML In-Reply-To: (Kaitlin Rupert's message of "Mon, 12 Nov 2007 17:06:04 -0700") References: Message-ID: <87lk930xpb.fsf@theine.beaverton.ibm.com> KR> ret = _get_dominfo(xml, *dominfo); KR> + if (!ret) { KR> + free(*dominfo); KR> + *dominfo = NULL; KR> + return 0; KR> + } KR> + KR> free(xml); You've just introduced a memory leak here, since xml won't get free()'d. Just remove the "return 0" and let it fall through and it should be fine. KR> diff -r 4ceb57b4430b -r f29660709900 src/Virt_VSSD.c KR> --- a/src/Virt_VSSD.c Mon Nov 12 13:54:53 2007 -0800 KR> +++ b/src/Virt_VSSD.c Mon Nov 12 16:15:41 2007 -0800 KR> @@ -45,7 +45,8 @@ static int instance_from_dom(virDomainPt KR> CMPIObjectPath *op; KR> struct domain *dominfo = NULL; KR> - if (!get_dominfo(dom, &dominfo)) KR> + ret = get_dominfo(dom, &dominfo); KR> + if (!ret) KR> goto out; Maybe my eyes are tired at the end of the day, but does this fix anything or is it just a style change? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Nov 13 01:18:03 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 17:18:03 -0800 Subject: [Libvirt-cim] [PATCH] This fixes a potential crash if _get_domain() is unable to properly parse the dom XML In-Reply-To: <87lk930xpb.fsf@theine.beaverton.ibm.com> References: <87lk930xpb.fsf@theine.beaverton.ibm.com> Message-ID: <4738FB4B.9000009@linux.vnet.ibm.com> Dan Smith wrote: > KR> ret = _get_dominfo(xml, *dominfo); > KR> + if (!ret) { > KR> + free(*dominfo); > KR> + *dominfo = NULL; > KR> + return 0; > KR> + } > KR> + > KR> free(xml); > > You've just introduced a memory leak here, since xml won't get > free()'d. Just remove the "return 0" and let it fall through and it > should be fine. > Yep, good call. Although, if we fall through here, we run into problems with the (*dominfo)->dev_mem_ct = get_mem_devices(dom, &(*dominfo)->dev_mem); related pieces since dominfo is NULL. Instead, I think it should be: ret = _get_dominfo(xml, *dominfo); free(xml); if (!ret) { free(*dominfo); *dominfo = NULL; return 0; } > > KR> - if (!get_dominfo(dom, &dominfo)) > KR> + ret = get_dominfo(dom, &dominfo); > KR> + if (!ret) > KR> goto out; > > Maybe my eyes are tired at the end of the day, but does this fix > anything or is it just a style change? > We need to capture ret from get_domain(). ret is initialized to 1. If we don't capture the ret from get_domain(), then we return 1 to get_vssd_instance(). This causes the if statement to pass, and we return an empty instance. If get_domain() fails, we need to return NULL. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 13 01:35:02 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 17:35:02 -0800 Subject: [Libvirt-cim] [PATCH] This fixes a potential crash if _get_domain() is unable to properly parse the dom XML In-Reply-To: <4738FB4B.9000009@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Mon, 12 Nov 2007 17:18:03 -0800") References: <87lk930xpb.fsf@theine.beaverton.ibm.com> <4738FB4B.9000009@linux.vnet.ibm.com> Message-ID: <87hcjr0vy1.fsf@theine.beaverton.ibm.com> KR> Yep, good call. Although, if we fall through here, we run into KR> problems with the (*dominfo)->dev_mem_ct = get_mem_devices(dom, KR> &(*dominfo)->dev_mem); related pieces since dominfo is NULL. Sorry, I didn't have the full context. I think it's bad form to cleanup in multiple exit paths. How about moving the free(xml) to the end, and adding an "out" label right before it. Then you can free(dominfo), set it to NULL, and goto out to free(xml) and return ret, which will be zero, signalling error to the caller. That would fit better with how we handle error paths elsewhere in the code. KR> We need to capture ret from get_domain(). Ah, right, okay, I see it now. Again, I wasn't looking at the context of the rest of the file :) Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Nov 13 01:10:43 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 12 Nov 2007 18:10:43 -0700 Subject: [Libvirt-cim] [PATCH] This fixes a potential crash if _get_domain() is unable to properly parse the dom XML Message-ID: <8b6965d9e9479dab2833.1194919843@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1194918780 28800 # Node ID 8b6965d9e9479dab28337480e1f84812d2c880f2 # Parent 4ceb57b4430b0455ef7cb68f57a8ec6ad01abeca This fixes a potential crash if _get_domain() is unable to properly parse the dom XML. Also fixes an issue in VSSD - if get_domaininfo() returns 0 (an error), then instance_from_dom() needs to set ret properly so that an empty instance won't be created. Previous patch had a memory leak - fixed this issue. Signed-off-by: Kaitlin Rupert diff -r 4ceb57b4430b -r 8b6965d9e947 libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Mon Nov 12 13:54:53 2007 -0800 +++ b/libxkutil/device_parsing.c Mon Nov 12 17:53:00 2007 -0800 @@ -575,16 +575,24 @@ int get_dominfo(virDomainPtr dom, struct xml = virDomainGetXMLDesc(dom, 0); if (!xml) { free(*dominfo); + *dominfo = NULL; return 0; } ret = _get_dominfo(xml, *dominfo); - free(xml); + if (!ret) { + free(*dominfo); + *dominfo = NULL; + goto out; + } (*dominfo)->dev_mem_ct = get_mem_devices(dom, &(*dominfo)->dev_mem); (*dominfo)->dev_net_ct = get_net_devices(dom, &(*dominfo)->dev_net); (*dominfo)->dev_disk_ct = get_disk_devices(dom, &(*dominfo)->dev_disk); (*dominfo)->dev_vcpu_ct = get_vcpu_devices(dom, &(*dominfo)->dev_vcpu); + +out: + free(xml); return ret; } diff -r 4ceb57b4430b -r 8b6965d9e947 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Nov 12 13:54:53 2007 -0800 +++ b/src/Virt_VSSD.c Mon Nov 12 17:53:00 2007 -0800 @@ -45,7 +45,8 @@ static int instance_from_dom(virDomainPt CMPIObjectPath *op; struct domain *dominfo = NULL; - if (!get_dominfo(dom, &dominfo)) + ret = get_dominfo(dom, &dominfo); + if (!ret) goto out; op = CMGetObjectPath(inst, NULL); From danms at us.ibm.com Tue Nov 13 02:02:49 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 12 Nov 2007 18:02:49 -0800 Subject: [Libvirt-cim] [PATCH] This fixes a potential crash if _get_domain() is unable to properly parse the dom XML In-Reply-To: <8b6965d9e9479dab2833.1194919843@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Mon, 12 Nov 2007 18:10:43 -0700") References: <8b6965d9e9479dab2833.1194919843@elm3b41.beaverton.ibm.com> Message-ID: <87d4ue2986.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1194918780 28800 KR> # Node ID 8b6965d9e9479dab28337480e1f84812d2c880f2 KR> # Parent 4ceb57b4430b0455ef7cb68f57a8ec6ad01abeca KR> This fixes a potential crash if _get_domain() is unable to properly parse the dom XML. Looks good, I'll apply. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From heidieck at linux.vnet.ibm.com Tue Nov 13 08:44:53 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 13 Nov 2007 09:44:53 +0100 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel In-Reply-To: <87r6iv7axj.fsf@theine.beaverton.ibm.com> References: <20b83bfd514faa824c55.1194867714@localhost.localdomain> <87r6iv7axj.fsf@theine.beaverton.ibm.com> Message-ID: <47396405.60000@linux.vnet.ibm.com> Dan Smith wrote: > This doesn't apply cleanly for me. It rejects the entire > HostedDependency.mof file. Can you check to make sure this applies > cleanly against the up-to-date tree? > Mhh, applied the patch against the up-to-date tree (clean check out some minutes ago) without any rejects. But I can imagine that I introduced an ordering problem, as I created the "Register association ElementCapabilities to root/virt namespace" patch before this one. Maybe this was causing some problems ? [heidineu at localhost libvirt-cim]$ hg log -l 2 changeset: 58:146a93bf2b92 branch: default tag: tip user: Kaitlin Rupert date: Mon Nov 12 17:53:00 2007 -0800 summary: This fixes a potential crash if _get_domain() is unable to properly parse the dom XML. changeset: 57:c3aebc961483 user: Dan Smith date: Mon Nov 12 14:08:35 2007 -0800 summary: Fix crash if create_system() returns a NULL instance -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 13 11:38:36 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 13 Nov 2007 12:38:36 +0100 Subject: [Libvirt-cim] [PATCH] Change cu_compare_ref() to be a little lighter-weight In-Reply-To: <4731F968.8090003@linux.vnet.ibm.com> References: <926009fc62a0080bcf93.1194453656@theine> <4731F968.8090003@linux.vnet.ibm.com> Message-ID: <47398CBC.7050906@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> # HG changeset patch >> # User Dan Smith >> # Date 1194453648 28800 >> # Node ID 926009fc62a0080bcf93aaddf098b074ce71a096 >> # Parent 404c4803b1b542676c4d283226a7cc3b7f3ab58d >> Change cu_compare_ref() to be a little lighter-weight >> Now, we just check the keys that were provided by the client (or the >> CIMOM >> if that ever starts to happen). We will have already checked the >> required >> keys to actually do the lookup in the provider, which serves the >> "required" >> key purpose. Changes to libvirt-cim to follow shortly... >> >> Signed-off-by: Dan Smith >> > I think this is a good compromise - looks good. +1 > I agree to Kaitlin, that this is a good compromise. I had discussions with some CIM specialists and we concluded that currently a strict definition - on how the key values have to be set and checked - can not be found in one of the DMTF Spec's. The only clear statement is, that the sum of all key properties form the unique instance identifier. An agreement was also, that the provider should only accept these object paths (in regard to the number of key properties and their values), that the provider itself delivers via an enumeration. The current implementation includes the - more academical - possibility that a client generates an object path by itself, which is definitely a controversial and not recommended approach. This is not problematic as long as the client takes care of all key properties. Only the case that key properties are not handed over by the client breaks interoperability. But this could be fixed by a slight switch in the cu_compare_ref() function. Instead of getting the key count out of the reference it could be retrieved out of the instance : diff -r 6f09834081cf instance_util.c --- a/instance_util.c Mon Nov 12 11:03:04 2007 -0800 +++ b/instance_util.c Tue Nov 13 12:36:24 2007 +0100 @@ -118,8 +118,13 @@ const char *cu_compare_ref(const CMPIObj CMPIStatus s; int count; const char *prop = NULL; + CMPIObjectPath *op; - count = CMGetKeyCount(ref, &s); + op = CMGetObjectPath(inst, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) + return NULL; + + count = CMGetKeyCount(op, &s); if (s.rc != CMPI_RC_OK) { CU_DEBUG("Unable to get key count"); return NULL; The reason why the CIMOMs do not check the key properties (and accept not set key properties ) might be, that no CIM spec does definitely clarify the responsibilities here. So the CIMOM hands it over to the provider. Which makes sense as the provider is the one with the implementation logic for the key generation and always needs a way to identify its real instances out of a given object path. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 13 11:38:24 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 13 Nov 2007 13:38:24 +0200 Subject: [Libvirt-cim] [PATCH] GetInstance does not return NOT_FOUND in case of Xen classname on KVM system (and reverse) Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1194957414 -3600 # Node ID a561761306d40f4394cb519784c5b474a268db7d # Parent b201578d4ade863822cb06c1e52d839f51250d87 GetInstance does not return NOT_FOUND in case of Xen classname on KVM system (and reverse) Signed-off-by: Heidi Eckhart diff -r b201578d4ade -r a561761306d4 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Tue Nov 13 09:37:25 2007 +0100 +++ b/src/Virt_ComputerSystem.c Tue Nov 13 13:36:54 2007 +0100 @@ -381,6 +381,11 @@ static CMPIStatus get_domain(const CMPIO virConnectPtr conn = NULL; const char *prop = NULL; + if (!provider_is_responsible(_BROKER, reference, &s)) { + CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); + return s; + } + conn = lv_connect(_BROKER, &s); if (conn == NULL) return s; From heidieck at linux.vnet.ibm.com Tue Nov 13 12:40:46 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 13 Nov 2007 13:40:46 +0100 Subject: [Libvirt-cim] [PATCH] Make cu_compare_ref() also compare the actual classname of the ref and inst In-Reply-To: <87sl3gzgj2.fsf@theine.beaverton.ibm.com> References: <87sl3gzgj2.fsf@theine.beaverton.ibm.com> Message-ID: <47399B4E.8000606@linux.vnet.ibm.com> Dan Smith wrote: > This makes cu_compare_ref() assist association providers in avoiding > carefully crafted instances to fool the dispatch code. For example, > in HostedResourcePool, it (now) uses cu_compare_ref() to make sure the > client specified a valid HostSystem, but since ComputerSystem is a > CIM_System, if you pass ComputerSystem.Name="", > HostedResourcePool would validate Name and proceed. > A very good catch :) ! -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Tue Nov 13 14:51:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 06:51:34 -0800 Subject: [Libvirt-cim] [PATCH] GetInstance does not return NOT_FOUND in case of Xen classname on KVM system (and reverse) In-Reply-To: (Heidi Eckhart's message of "Tue, 13 Nov 2007 13:38:24 +0200") References: Message-ID: <87ve86yz9l.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1194957414 -3600 HE> # Node ID a561761306d40f4394cb519784c5b474a268db7d HE> # Parent b201578d4ade863822cb06c1e52d839f51250d87 HE> GetInstance does not return NOT_FOUND in case of Xen classname on HE> KVM system (and reverse) Applied, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 15:42:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 07:42:26 -0800 Subject: [Libvirt-cim] [PATCH] Change cu_compare_ref() to be a little lighter-weight In-Reply-To: <47398CBC.7050906@linux.vnet.ibm.com> (Heidi Eckhart's message of "Tue, 13 Nov 2007 12:38:36 +0100") References: <926009fc62a0080bcf93.1194453656@theine> <4731F968.8090003@linux.vnet.ibm.com> <47398CBC.7050906@linux.vnet.ibm.com> Message-ID: <87r6iuywwt.fsf@theine.beaverton.ibm.com> HE> The current implementation includes the - more academical - HE> possibility that a client generates an object path by itself, HE> which is definitely a controversial and not recommended HE> approach. This is not problematic as long as the client takes care HE> of all key properties. Only the case that key properties are not HE> handed over by the client breaks interoperability. Well, if all of the other key properties are unrelated to the output, I don't see how it matters. In most cases, we have one true key and the rest are all identical. If the client fashioned an object path with two conflicting keys, then it would make sense to reject the request, and the current implementation would do so correctly. For the sake of human-driven manual testing, it seems reasonable to me to ensure that the client provided enough keys to adequately disambiguate the requested instance from any others. However, I can appreciate that this is not the common case and that a normal client should be using only object paths that we have previously generated. HE> The reason why the CIMOMs do not check the key properties (and HE> accept not set key properties ) might be, that no CIM spec does HE> definitely clarify the responsibilities here. So the CIMOM hands HE> it over to the provider. Which makes sense as the provider is the HE> one with the implementation logic for the key generation and HE> always needs a way to identify its real instances out of a given HE> object path. Right, which is why I originally had a list of required properties passed to this function. Because the CIMOM doesn't do its own checking, we have to do it. Since we know the domain, we should be able to be intelligent about which properties will always be identical, and which are really required for disambiguation. That said, your fix is small and easy, so if you want to write up a formal patch, I'll apply it. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 15:55:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 07:55:48 -0800 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel In-Reply-To: <47396405.60000@linux.vnet.ibm.com> (Heidi Eckhart's message of "Tue, 13 Nov 2007 09:44:53 +0100") References: <20b83bfd514faa824c55.1194867714@localhost.localdomain> <87r6iv7axj.fsf@theine.beaverton.ibm.com> <47396405.60000@linux.vnet.ibm.com> Message-ID: <87mytiywaj.fsf@theine.beaverton.ibm.com> HE> Mhh, applied the patch against the up-to-date tree (clean check HE> out some minutes ago) without any rejects. I looked into it, and the HostedDependency.mof file in the repo was CRLF terminated, but your patch was not. Maybe the act of emailing it stripped those off. Either way, I commited a little changeset to strip the CR's off the end of that mof before I committed your patch and it went fine. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:13 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:13 -0400 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: Message-ID: <5d8e959f6b81f08015e3.1194970513@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194970453 18000 # Node ID 5d8e959f6b81f08015e32866a9d2de2506c51762 # Parent fa1ace488da3c6b98e8b77290860e7ab15e2e8f5 Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic. Signed-off-by: Jay Gagnon diff -r fa1ace488da3 -r 5d8e959f6b81 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 @@ -200,6 +200,114 @@ static struct sdc_rasd_prop *mem_inc(con return rasd; } +static struct sdc_rasd_prop *net_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 0; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static int net_max_xen(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + /* No dynamic lookup for now. */ + return 6; +} + +static struct sdc_rasd_prop *net_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics; + struct sdc_rasd_prop *rasd = NULL; + + /* TODO: relevant functions for KVM etc. and dispatch code. */ + num_nics = net_max_xen(ref, s); + if (s->rc != CMPI_RC_OK) { + goto out; + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get max nic count"); + } + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + out: + return rasd; +} + +static struct sdc_rasd_prop *net_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *net_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_nics = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_nics, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + static struct sdc_rasd_prop *disk_min(const CMPIObjectPath *ref, CMPIStatus *s) { @@ -347,6 +455,14 @@ static struct sdc_rasd mem = { .inc = mem_inc }; +static struct sdc_rasd network = { + .resource_type = CIM_RASD_TYPE_NET, + .min = net_min, + .max = net_max, + .def = net_def, + .inc = net_inc +}; + static struct sdc_rasd disk = { .resource_type = CIM_RASD_TYPE_DISK, .min = disk_min, @@ -357,6 +473,7 @@ static struct sdc_rasd disk = { static struct sdc_rasd *sdc_rasd_list[] = { &mem, + &network, &disk, NULL }; From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:15 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:15 -0400 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: Message-ID: <6a57bca4ac97fb503e1d.1194970515@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194970454 18000 # Node ID 6a57bca4ac97fb503e1d32713a3b0155bd4ff322 # Parent 1cee1dbf1fc9c270ca007f5ebc36138713ffd97f Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point. Signed-off-by: Jay Gagnon diff -r 1cee1dbf1fc9 -r 6a57bca4ac97 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Tue Nov 13 11:14:13 2007 -0500 +++ b/src/Virt_ElementCapabilities.c Tue Nov 13 11:14:14 2007 -0500 @@ -183,6 +183,50 @@ static CMPIStatus cap_to_cs(const CMPIOb return s; } +static CMPIStatus alloc_to_pool(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + /* Pool to alloc is more important. That will be done first. */ + RETURN_UNSUPPORTED(); +} + +static CMPIStatus pool_to_alloc(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + int ret; + char *inst_id; + uint16_t type; + CMPIInstance *inst = NULL; + CMPIStatus s = {CMPI_RC_OK}; + + inst_id = cu_get_str_path(ref, "InstanceID"); + if (inst_id == NULL) { + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); + goto out; + } + + inst = get_typed_instance(_BROKER, "AllocationCapabilities", + NAMESPACE(ref)); + CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars); + + ret = cu_get_u16_path(ref, "ResourceType", &type); + if (ret != 1) { + CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + "Could not get ResourceType."); + goto out; + } + CMSetProperty(inst, "ResourceType", &type, CMPI_uint16); + + inst_list_add(list, inst); + + out: + free(inst_id); + + return s; +} static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, @@ -277,6 +321,28 @@ struct std_assoc ele_cap_to_computer_sys .assoc_class = "CIM_ElementCapabilities", .handler = cap_to_cs, + .make_ref = make_ref +}; + +struct std_assoc alloc_cap_to_resource_pool = { + .source_class = "CIM_AllocationCapabilities", + .source_prop = "Capabilities", + + .target_class = "CIM_ResourcePool", + .target_prop = "ManagedElement", + + .handler = alloc_to_pool, + .make_ref = make_ref +}; + +struct std_assoc resource_pool_to_alloc_cap = { + .source_class = "CIM_ResourcePool", + .source_prop = "ManagedElement", + + .target_class = "CIM_AllocationCapabilities", + .target_prop = "Capabilities", + + .handler = pool_to_alloc, .make_ref = make_ref }; @@ -286,6 +352,8 @@ struct std_assoc *assoc_handlers[] = { &system_to_vsm_cap, &vsm_cap_to_system, &ele_cap_to_computer_system, + &alloc_cap_to_resource_pool, + &resource_pool_to_alloc_cap, NULL }; From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:10 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:10 -0400 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: Message-ID: <00626d8731495a89a930.1194970510@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194970453 18000 # Node ID 00626d8731495a89a93055be42ac52951f6fbcc7 # Parent 146a93bf2b929232c41bf7ed157c0343481d01a3 Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree. Signed-off-by: Jay Gagnon diff -r 146a93bf2b92 -r 00626d873149 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Mon Nov 12 17:53:00 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Tue Nov 13 11:14:13 2007 -0500 @@ -94,14 +94,16 @@ static CMPIStatus cap_to_sys(const CMPIO inst_id = cu_get_str_path(ref, "InstanceID"); if (inst_id == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); goto out; } if (!parse_fq_devid(inst_id, &host, &device)) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get system name."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get system name."); goto out; } @@ -152,14 +154,16 @@ static CMPIStatus cap_to_cs(const CMPIOb inst_id = cu_get_str_path(ref, "InstanceID"); if (inst_id == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); goto error1; } if (!parse_fq_devid(inst_id, &host, &device)) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get system name."); + cu_status(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get system name."); goto error1; } diff -r 146a93bf2b92 -r 00626d873149 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 12 17:53:00 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 @@ -96,84 +96,100 @@ static bool free_rasd_prop_list(struct s return true; } -static struct sdc_rasd_prop *mem_max(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; +static struct sdc_rasd_prop *mem_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t max_vq = MAX_MEM; - struct sdc_rasd_prop max[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&max_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(max, &rasd); - if (ret) - return rasd; - else - return NULL; -} - -static struct sdc_rasd_prop *mem_min(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *mem_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t min_vq = 64; - struct sdc_rasd_prop min[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&min_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(min, &rasd); - if (ret) - return rasd; - else - return NULL; -} - -static struct sdc_rasd_prop *mem_def(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *mem_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t def_vq = 256; - struct sdc_rasd_prop def[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&def_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(def, &rasd); - if (ret) - return rasd; - else - return NULL; -} - -static struct sdc_rasd_prop *mem_inc(void) -{ - bool ret; - struct sdc_rasd_prop *rasd; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *mem_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + struct sdc_rasd_prop *rasd = NULL; uint64_t inc_vq = 1; - struct sdc_rasd_prop inc[] = { + struct sdc_rasd_prop tmp[] = { {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, {"AllocationUnits", (CMPIValue *)"MegaBytes", CMPI_chars}, {"VirtualQuantity", (CMPIValue *)&inc_vq, CMPI_uint64}, PROP_END }; - ret = dup_rasd_prop_list(inc, &rasd); - if (ret) - return rasd; - else - return NULL; + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; } static struct sdc_rasd mem = { @@ -190,17 +206,17 @@ static struct sdc_rasd *sdc_rasd_list[] }; static CMPIInstance *sdc_rasd_inst(const CMPIBroker *broker, + CMPIStatus *s, const CMPIObjectPath *ref, struct sdc_rasd *rasd, sdc_rasd_type type) { - CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; struct sdc_rasd_prop *prop_list; int i; char *inst_id; uint16_t resource_type; - /* Defaults for the following three values are from + /* Defaults for the following are from CIM_SettingsDefineCapabilities.mof. */ uint16_t policy = SDC_POLICY_INDEPENDENT; uint16_t role = SDC_ROLE_SUPPORTED; @@ -209,43 +225,40 @@ static CMPIInstance *sdc_rasd_inst(const case SDC_RASD_MIN: if (rasd->min == NULL) goto out; - prop_list = rasd->min(); + prop_list = rasd->min(ref, s); inst_id = "Minimum"; range = SDC_RANGE_MIN; break; case SDC_RASD_MAX: if (rasd->max == NULL) goto out; - prop_list = rasd->max(); + prop_list = rasd->max(ref, s); inst_id = "Maximum"; range = SDC_RANGE_MAX; break; case SDC_RASD_INC: if (rasd->inc == NULL) goto out; - prop_list = rasd->inc(); + prop_list = rasd->inc(ref, s); inst_id = "Increment"; range = SDC_RANGE_INC; break; case SDC_RASD_DEF: if (rasd->def == NULL) goto out; - prop_list = rasd->def(); + prop_list = rasd->def(ref, s); inst_id = "Default"; role = SDC_ROLE_DEFAULT; range = SDC_RANGE_POINT; break; default: - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, + CMSetStatusWithChars(broker, s, CMPI_RC_ERR_FAILED, "Unsupported sdc_rasd type."); goto out; } - if (prop_list == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Failed to get prop_list."); + if (s->rc != CMPI_RC_OK) goto out; - } inst = get_typed_instance(broker, "ResourceAllocationSettingData", @@ -291,7 +304,11 @@ static CMPIStatus sdc_rasds_for_type(con if (rasd) { for (i = SDC_RASD_MIN; i <= SDC_RASD_INC; i++) { - inst = sdc_rasd_inst(_BROKER, ref, rasd, i); + inst = sdc_rasd_inst(_BROKER, &s, ref, rasd, i); + if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Problem getting inst."); + goto out; + } CU_DEBUG("Got inst.\n"); if (inst != NULL) { inst_list_add(list, inst); @@ -307,6 +324,7 @@ static CMPIStatus sdc_rasds_for_type(con "Unsupported device type."); } + out: return s; } diff -r 146a93bf2b92 -r 00626d873149 src/Virt_SettingsDefineCapabilities.h --- a/src/Virt_SettingsDefineCapabilities.h Mon Nov 12 17:53:00 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.h Tue Nov 13 11:14:13 2007 -0500 @@ -50,7 +50,8 @@ struct sdc_rasd_prop { CMPIType type; }; -typedef struct sdc_rasd_prop *(*rasd_prop_func_t)(void); +typedef struct sdc_rasd_prop *(*rasd_prop_func_t)(const CMPIObjectPath *ref, + CMPIStatus *s); struct sdc_rasd { uint16_t resource_type; From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:09 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:09 -0400 Subject: [Libvirt-cim] [PATCH 0 of 6] Take two of huge SettingsDefineCapabilities set Message-ID: Changes from the last set are: reformatted cu_statusf calls SDC_DISK_INC as a define use of libvirt call for proc_max breakout for net_max so each hypervisor can have its own function call alloc_to_pool returning unsupported instead of nothing From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:12 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:12 -0400 Subject: [Libvirt-cim] [PATCH 3 of 6] Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional In-Reply-To: Message-ID: # HG changeset patch # User Jay Gagnon # Date 1194970453 18000 # Node ID fa1ace488da3c6b98e8b77290860e7ab15e2e8f5 # Parent bd43a8aca68d8b40186bd3ba51fd966fc02d9560 Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional. Signed-off-by: Jay Gagnon diff -r bd43a8aca68d -r fa1ace488da3 src/Makefile.am --- a/src/Makefile.am Tue Nov 13 11:14:13 2007 -0500 +++ b/src/Makefile.am Tue Nov 13 11:14:13 2007 -0500 @@ -88,7 +88,7 @@ libVirt_AllocationCapabilities_la_LIBADD libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c -libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD +libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c diff -r bd43a8aca68d -r fa1ace488da3 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include "config.h" @@ -37,8 +39,14 @@ #include "svpc_types.h" #include "Virt_SettingsDefineCapabilities.h" +#include "Virt_DevicePool.h" const static CMPIBroker *_BROKER; + +/* These are used in more than one place so they are defined here. */ +#define SDC_DISK_MIN 2000 +#define SDC_DISK_DEF 5000 +#define SDC_DISK_INC 250 static bool rasd_prop_copy_value(struct sdc_rasd_prop src, struct sdc_rasd_prop *dest) @@ -192,6 +200,145 @@ static struct sdc_rasd_prop *mem_inc(con return rasd; } +static struct sdc_rasd_prop *disk_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t disk_size = SDC_DISK_MIN; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *disk_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + char *inst_id; + CMPIrc prop_ret; + uint16_t free_space; + uint64_t free_64; + virConnectPtr conn; + CMPIInstance *pool_inst; + struct sdc_rasd_prop *rasd = NULL; + + inst_id = cu_get_str_path(ref, "InstanceID"); + if (inst_id == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); + goto out; + } + + conn = lv_connect(_BROKER, s); + if (s->rc != CMPI_RC_OK) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get connection."); + goto out; + } + + /* Getting the relevant resource pool directly finds the free space + for us. It is in the Capacity field. */ + pool_inst = get_pool_by_id(_BROKER, conn, inst_id, NAMESPACE(ref)); + if (pool_inst == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get pool instance."); + goto out; + } + + prop_ret = cu_get_u64_prop(pool_inst, "Capacity", &free_64); + if (prop_ret != CMPI_RC_OK) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get capacity from instance."); + goto out; + } + CU_DEBUG("Got capacity from pool_inst: %lld", free_64); + + free_space = (uint16_t)free_64; + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&free_space, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + out: + free(inst_id); + return rasd; +} + +static struct sdc_rasd_prop *disk_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t disk_size = SDC_DISK_DEF; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *disk_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t disk_size = SDC_DISK_INC; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, + {"AllocationQuantity", (CMPIValue *)"MegaBytes", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&disk_size, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + static struct sdc_rasd mem = { .resource_type = CIM_RASD_TYPE_MEM, .min = mem_min, @@ -200,8 +347,17 @@ static struct sdc_rasd mem = { .inc = mem_inc }; +static struct sdc_rasd disk = { + .resource_type = CIM_RASD_TYPE_DISK, + .min = disk_min, + .max = disk_max, + .def = disk_def, + .inc = disk_inc +}; + static struct sdc_rasd *sdc_rasd_list[] = { &mem, + &disk, NULL }; From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:14 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:14 -0400 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities In-Reply-To: Message-ID: <1cee1dbf1fc9c270ca00.1194970514@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194970453 18000 # Node ID 1cee1dbf1fc9c270ca007f5ebc36138713ffd97f # Parent 5d8e959f6b81f08015e32866a9d2de2506c51762 Add processor support to SettingsDefineCapabilities. Signed-off-by: Jay Gagnon diff -r 5d8e959f6b81 -r 1cee1dbf1fc9 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:13 2007 -0500 @@ -26,6 +26,8 @@ #include #include +#include + #include "config.h" #include "cmpidt.h" @@ -200,6 +202,117 @@ static struct sdc_rasd_prop *mem_inc(con return rasd; } +static struct sdc_rasd_prop *proc_min(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_procs = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Minimum", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *proc_max(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + virConnectPtr conn; + uint16_t num_procs = 0; + struct sdc_rasd_prop *rasd = NULL; + + CU_DEBUG("In proc_max()"); + + conn = lv_connect(_BROKER, s); + if (conn == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not connect to hypervisor."); + goto out; + } + + num_procs = virConnectGetMaxVcpus(conn, NULL); + CU_DEBUG("libvirt says %d max vcpus", num_procs); + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Maximum", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + out: + return rasd; +} + +static struct sdc_rasd_prop *proc_def(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_procs = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Default", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + +static struct sdc_rasd_prop *proc_inc(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + bool ret; + uint16_t num_procs = 1; + struct sdc_rasd_prop *rasd = NULL; + + struct sdc_rasd_prop tmp[] = { + {"InstanceID", (CMPIValue *)"Increment", CMPI_chars}, + {"AllocationUnits", (CMPIValue *)"Processors", CMPI_chars}, + {"VirtualQuantity", (CMPIValue *)&num_procs, CMPI_uint16}, + PROP_END + }; + + ret = dup_rasd_prop_list(tmp, &rasd); + if (!ret) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not copy RASD."); + } + + return rasd; +} + static struct sdc_rasd_prop *net_min(const CMPIObjectPath *ref, CMPIStatus *s) { @@ -455,6 +568,14 @@ static struct sdc_rasd mem = { .inc = mem_inc }; +static struct sdc_rasd processor = { + .resource_type = CIM_RASD_TYPE_PROC, + .min = proc_min, + .max = proc_max, + .def = proc_def, + .inc = proc_inc +}; + static struct sdc_rasd network = { .resource_type = CIM_RASD_TYPE_NET, .min = net_min, @@ -473,6 +594,7 @@ static struct sdc_rasd disk = { static struct sdc_rasd *sdc_rasd_list[] = { &mem, + &processor, &network, &disk, NULL From grendel at linux.vnet.ibm.com Tue Nov 13 15:15:11 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 11:15:11 -0400 Subject: [Libvirt-cim] [PATCH 2 of 6] Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool In-Reply-To: Message-ID: # HG changeset patch # User Jay Gagnon # Date 1194970453 18000 # Node ID bd43a8aca68d8b40186bd3ba51fd966fc02d9560 # Parent 00626d8731495a89a93055be42ac52951f6fbcc7 Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool. Signed-off-by: Jay Gagnon diff -r 00626d873149 -r bd43a8aca68d src/Makefile.am --- a/src/Makefile.am Tue Nov 13 11:14:13 2007 -0500 +++ b/src/Makefile.am Tue Nov 13 11:14:13 2007 -0500 @@ -35,12 +35,12 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_VirtualSystemManagementCapabilities.la \ libVirt_EnabledLogicalElementCapabilities.la \ libVirt_AllocationCapabilities.la \ - libVirt_SettingsDefineCapabilities.la \ libVirt_VSSD.la \ libVirt_HostedDependency.la \ libVirt_RegisteredProfile.la \ libVirt_ElementConformsToProfile.la \ libVirt_DevicePool.la \ + libVirt_SettingsDefineCapabilities.la \ libVirt_HostedResourcePool.la \ libVirt_ElementCapabilities.la \ libVirt_ResourcePoolConfigurationService.la \ From danms at us.ibm.com Tue Nov 13 16:33:02 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 08:33:02 -0800 Subject: [Libvirt-cim] [PATCH 1 of 6] Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree In-Reply-To: <00626d8731495a89a930.1194970510@wulfgar> (Jay Gagnon's message of "Tue, 13 Nov 2007 11:15:10 -0400") References: <00626d8731495a89a930.1194970510@wulfgar> Message-ID: <87ir46yukh.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194970453 18000 JG> # Node ID 00626d8731495a89a93055be42ac52951f6fbcc7 JG> # Parent 146a93bf2b929232c41bf7ed157c0343481d01a3 JG> Turns out that the sdc_rasd_prop functions might need to report status or see the passed in reference. This updates the typedef and the memory functions, since those are already in the tree. Thanks, applied. I do think that the minimum and default memory values need to be #defines but they were already in the tree and I didn't catch them the first time. I think we should plan to pull those out at some point though. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 16:34:16 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 08:34:16 -0800 Subject: [Libvirt-cim] [PATCH 2 of 6] Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool In-Reply-To: (Jay Gagnon's message of "Tue, 13 Nov 2007 11:15:11 -0400") References: Message-ID: <87ejeuyuif.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194970453 18000 JG> # Node ID bd43a8aca68d8b40186bd3ba51fd966fc02d9560 JG> # Parent 00626d8731495a89a93055be42ac52951f6fbcc7 JG> Need to reorder the .la lines in makefile since SettingsDefineCapabilities now depends on DevicePool. Applied. I meant to go ahead and commit this one last time :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 16:35:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 08:35:15 -0800 Subject: [Libvirt-cim] [PATCH 3 of 6] Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional In-Reply-To: (Jay Gagnon's message of "Tue, 13 Nov 2007 11:15:12 -0400") References: Message-ID: <87abpiyugs.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194970453 18000 JG> # Node ID fa1ace488da3c6b98e8b77290860e7ab15e2e8f5 JG> # Parent bd43a8aca68d8b40186bd3ba51fd966fc02d9560 JG> Add Disk support to SettingsDefineCapabilities. Still lacks a bit of polish (i.e. lack of warning when minimum or default is higher than maximum), but is functional. Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 16:49:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 08:49:20 -0800 Subject: [Libvirt-cim] [PATCH 4 of 6] Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic In-Reply-To: <5d8e959f6b81f08015e3.1194970513@wulfgar> (Jay Gagnon's message of "Tue, 13 Nov 2007 11:15:13 -0400") References: <5d8e959f6b81f08015e3.1194970513@wulfgar> Message-ID: <876406yttb.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194970453 18000 JG> # Node ID 5d8e959f6b81f08015e32866a9d2de2506c51762 JG> # Parent fa1ace488da3c6b98e8b77290860e7ab15e2e8f5 JG> Add NetworkPort functionality to SettingsDefineCapabilities. All static, max may become dynamic. Applied. Per our discussion on #virt, we'll augment this with a version that exposes the correct max value for each of xen-3.0.x, xen-3.1.x, and qemu. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 16:52:13 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 08:52:13 -0800 Subject: [Libvirt-cim] [PATCH 6 of 6] Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point In-Reply-To: <6a57bca4ac97fb503e1d.1194970515@wulfgar> (Jay Gagnon's message of "Tue, 13 Nov 2007 11:15:15 -0400") References: <6a57bca4ac97fb503e1d.1194970515@wulfgar> Message-ID: <87wssmxf42.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194970454 18000 JG> # Node ID 6a57bca4ac97fb503e1d32713a3b0155bd4ff322 JG> # Parent 1cee1dbf1fc9c270ca007f5ebc36138713ffd97f JG> Add another relationship to ElementCapabilities, the ResourcePool-AllocationCapabilities connection. Only supports the pool_to_alloc direction, because it is the only one that's terribly interesting, but the other direction will need to be added at some point. Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 16:52:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 08:52:25 -0800 Subject: [Libvirt-cim] [PATCH 5 of 6] Add processor support to SettingsDefineCapabilities References: <1cee1dbf1fc9c270ca00.1194970514@wulfgar> Message-ID: <87pryexf3q.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194970453 18000 JG> # Node ID 1cee1dbf1fc9c270ca007f5ebc36138713ffd97f JG> # Parent 5d8e959f6b81f08015e32866a9d2de2506c51762 JG> Add processor support to SettingsDefineCapabilities. Applied. JG> + num_procs = virConnectGetMaxVcpus(conn, NULL); Ah, even better :) Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 13 18:01:16 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 14:01:16 -0400 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output Message-ID: <49c65d339cc56abfc9dc.1194980476@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194979853 18000 # Node ID 49c65d339cc56abfc9dc3e09c6f894ea88fc169e # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. Signed-off-by: Jay Gagnon diff -r aad2a74321d5 -r 49c65d339cc5 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:14:14 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 13:50:53 2007 -0500 @@ -55,12 +55,10 @@ static bool rasd_prop_copy_value(struct { bool rc = true; - CU_DEBUG("Copying '%s'.\n", src.field); + CU_DEBUG("Copying '%s'.", src.field); if (src.type & CMPI_string) { - CU_DEBUG("String type.\n"); dest->value = (CMPIValue *)strdup((char *)src.value); } else if (src.type & CMPI_INTEGER) { - CU_DEBUG("Integer type.\n"); dest->value = malloc(sizeof(CMPIValue)); memcpy(dest->value, src.value, sizeof(CMPIValue)); } else { @@ -78,7 +76,6 @@ static bool dup_rasd_prop_list(struct sd *dest = NULL; for (i = 0, count = 1; src[i].field != NULL; i++, count++) { - CU_DEBUG("count: %d, i: %d. reallocing.\n", count, i); *dest = realloc(*dest, count * sizeof(struct sdc_rasd_prop)); (*dest)[i].field = strdup(src[i].field); ret = rasd_prop_copy_value(src[i], &(*dest)[i]); @@ -86,7 +83,6 @@ static bool dup_rasd_prop_list(struct sd } /* Make sure to terminate the list. */ - CU_DEBUG("Terminating list. count: %d, i: %d\n", count, i); *dest = realloc(*dest, count * sizeof(struct sdc_rasd_prop)); (*dest)[i] = (struct sdc_rasd_prop)PROP_END; @@ -668,16 +664,15 @@ static CMPIInstance *sdc_rasd_inst(const CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16); for (i = 0; prop_list[i].field != NULL; i++) { - CU_DEBUG("Setting property '%s'.\n", prop_list[i].field); + CU_DEBUG("Setting property '%s'.", prop_list[i].field); CMSetProperty(inst, prop_list[i].field, prop_list[i].value, prop_list[i].type); - CU_DEBUG("Set.\n"); - } - - CU_DEBUG("freeing prop_list.\n"); + } + + CU_DEBUG("freeing prop_list."); free_rasd_prop_list(prop_list); out: - CU_DEBUG("Returning inst.\n"); + CU_DEBUG("Returning inst."); return inst; } @@ -704,17 +699,17 @@ static CMPIStatus sdc_rasds_for_type(con CU_DEBUG("Problem getting inst."); goto out; } - CU_DEBUG("Got inst.\n"); + CU_DEBUG("Got inst."); if (inst != NULL) { inst_list_add(list, inst); - CU_DEBUG("Added inst.\n"); + CU_DEBUG("Added inst."); } else { - CU_DEBUG("Inst is null, not added.\n"); + CU_DEBUG("Inst is null, not added."); } } } else { - CU_DEBUG("Unsupported type.\n"); + CU_DEBUG("Unsupported type."); CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unsupported device type."); } @@ -731,7 +726,7 @@ static CMPIStatus alloc_cap_to_rasd(cons int ret; uint16_t type; - CU_DEBUG("Getting ResourceType.\n"); + CU_DEBUG("Getting ResourceType."); ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != 1) { @@ -740,7 +735,7 @@ static CMPIStatus alloc_cap_to_rasd(cons goto out; } - CU_DEBUG("ResourceType: %hi.\n", type); + CU_DEBUG("ResourceType: %hi.", type); s = sdc_rasds_for_type(ref, list, type); From grendel at linux.vnet.ibm.com Tue Nov 13 18:01:26 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 14:01:26 -0400 Subject: [Libvirt-cim] [PATCH] Remove extra newline characters at end of CU_DEBUG calls Message-ID: # HG changeset patch # User Jay Gagnon # Date 1194980442 18000 # Node ID cd4498fc44de514aed4232f5ee1a9a4828d8e3b1 # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa Remove extra newline characters at end of CU_DEBUG calls. Signed-off-by: Jay Gagnon diff -r 5f84fd6c5cde -r cd4498fc44de std_association.c --- a/std_association.c Thu Nov 08 11:21:50 2007 -0800 +++ b/std_association.c Tue Nov 13 14:00:42 2007 -0500 @@ -139,22 +139,22 @@ static CMPIStatus do_assoc(struct std_as inst_list_init(&list); - CU_DEBUG("Getting handler...\n"); + CU_DEBUG("Getting handler..."); handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - CU_DEBUG("No handler found.\n"); + CU_DEBUG("No handler found."); cu_statusf(ctx->brkr, &s, CMPI_RC_ERR_FAILED, "Unable to handle this association"); goto out; } - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'\n", + CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", handler->source_class, handler->target_class, handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'\n", + CU_DEBUG("Calling match_class: \tinfo->result_class: '%s'", info->result_class); rc = match_class(ctx->brkr, @@ -162,35 +162,35 @@ static CMPIStatus do_assoc(struct std_as info->result_class, handler->target_class); if (!rc) { - CU_DEBUG("Match_class failed.\n"); - goto out; - } - CU_DEBUG("Match_class succeeded.\n"); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'\n", + CU_DEBUG("Match_class failed."); + goto out; + } + CU_DEBUG("Match_class succeeded."); + + CU_DEBUG("Calling match_class: \tinfo->assoc_class: '%s'", info->result_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, handler->assoc_class); if (!rc) { - CU_DEBUG("Match_class failed.\n"); - goto out; - } - CU_DEBUG("Match_class succeeded.\n"); - CU_DEBUG("Calling handler->handler...\n"); + CU_DEBUG("Match_class failed."); + goto out; + } + CU_DEBUG("Match_class succeeded."); + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { - CU_DEBUG("\thandler did not return CMPI_RC_OK.\n"); + CU_DEBUG("Handler did not return CMPI_RC_OK."); goto out; } else { - CU_DEBUG("\thandler returned CMPI_RC_OK.\n"); + CU_DEBUG("Handler returned CMPI_RC_OK."); } if (list.list == NULL) { - CU_DEBUG("\tlist is empty.\n"); + CU_DEBUG("List is empty."); goto out; } @@ -199,15 +199,15 @@ static CMPIStatus do_assoc(struct std_as info->result_class, ctx->brkr); if (s.rc != CMPI_RC_OK) { - CU_DEBUG("\tfilter_results did not return CMPI_RC_OK.\n"); + CU_DEBUG("filter_results did not return CMPI_RC_OK."); goto out; } if (list.list == NULL) { - CU_DEBUG("\tlist is empty.\n"); + CU_DEBUG("list is empty."); goto out; } else { - CU_DEBUG("\treturned %u instance(s).\n", list.cur); + CU_DEBUG("returned %u instance(s).", list.cur); } if (names_only) @@ -218,7 +218,6 @@ static CMPIStatus do_assoc(struct std_as out: inst_list_free(&list); - CU_DEBUG("Returning.\n"); return s; } From grendel at linux.vnet.ibm.com Tue Nov 13 19:04:30 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 14:04:30 -0500 Subject: [Libvirt-cim] [PATCH] Remove extra newline characters at end of CU_DEBUG calls In-Reply-To: References: Message-ID: <4739F53E.3030303@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194980442 18000 > # Node ID cd4498fc44de514aed4232f5ee1a9a4828d8e3b1 > # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa > Remove extra newline characters at end of CU_DEBUG calls. > > Signed-off-by: Jay Gagnon > > > Sorry forgot the [CU] prefix on this one. -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 13 19:05:57 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 14:05:57 -0500 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <49c65d339cc56abfc9dc.1194980476@wulfgar> References: <49c65d339cc56abfc9dc.1194980476@wulfgar> Message-ID: <4739F595.3090500@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194979853 18000 > # Node ID 49c65d339cc56abfc9dc3e09c6f894ea88fc169e > # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 > Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. > > Signed-off-by: Jay Gagnon > > > This originally had some problems being applied so it got resent, but looks like it got lost, so I sent it out again along with the libcmpiutil equivalent. We'll see if it applies better now. -- -Jay From kaitlin at linux.vnet.ibm.com Tue Nov 13 19:13:29 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 13 Nov 2007 11:13:29 -0800 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <4739F595.3090500@linux.vnet.ibm.com> References: <49c65d339cc56abfc9dc.1194980476@wulfgar> <4739F595.3090500@linux.vnet.ibm.com> Message-ID: <4739F759.2080202@linux.vnet.ibm.com> Jay Gagnon wrote: > Jay Gagnon wrote: > >> # HG changeset patch >> # User Jay Gagnon >> # Date 1194979853 18000 >> # Node ID 49c65d339cc56abfc9dc3e09c6f894ea88fc169e >> # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 >> Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. >> >> Signed-off-by: Jay Gagnon >> >> >> >> > This originally had some problems being applied so it got resent, but > looks like it got lost, so I sent it out again along with the > libcmpiutil equivalent. We'll see if it applies better now. Is there also a patch that adds the newline to CU_DEBUG? Or was that an older patch that's already been applied? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Tue Nov 13 19:16:59 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 14:16:59 -0500 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <4739F759.2080202@linux.vnet.ibm.com> References: <49c65d339cc56abfc9dc.1194980476@wulfgar> <4739F595.3090500@linux.vnet.ibm.com> <4739F759.2080202@linux.vnet.ibm.com> Message-ID: <4739F82B.6050102@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Jay Gagnon wrote: >> Jay Gagnon wrote: >> >>> # HG changeset patch >>> # User Jay Gagnon >>> # Date 1194979853 18000 >>> # Node ID 49c65d339cc56abfc9dc3e09c6f894ea88fc169e >>> # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 >>> Remove newline characters from CU_DEBUG calls now that the newline >>> is automatic. Also remove a few debug messages that are no longer >>> necessary and clutter output. >>> >>> Signed-off-by: Jay Gagnon >>> >>> >>> >> This originally had some problems being applied so it got resent, but >> looks like it got lost, so I sent it out again along with the >> libcmpiutil equivalent. We'll see if it applies better now. > Is there also a patch that adds the newline to CU_DEBUG? Or was that > an older patch that's already been applied? > That's already been applied. When exactly, I couldn't tell you, but I made these because after an update I noticed a bunch of blank lines in my output. I believe Dan made that patch. -- -Jay From danms at us.ibm.com Tue Nov 13 18:19:44 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 11:19:44 -0700 Subject: [Libvirt-cim] [PATCH] Fix build of ElementCapabilities Message-ID: # HG changeset patch # User Dan Smith # Date 1194981559 28800 # Node ID a596cc07e24c715faebb498b744637ce7467897c # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 Fix build of ElementCapabilities Signed-off-by: Dan Smith diff -r aad2a74321d5 -r a596cc07e24c src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Tue Nov 13 11:14:14 2007 -0500 +++ b/src/Virt_ElementCapabilities.c Tue Nov 13 11:19:19 2007 -0800 @@ -161,9 +161,9 @@ static CMPIStatus cap_to_cs(const CMPIOb } if (!parse_fq_devid(inst_id, &host, &device)) { - cu_status(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Could not get system name."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get system name."); goto error1; } From kaitlin at linux.vnet.ibm.com Tue Nov 13 19:23:07 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 13 Nov 2007 11:23:07 -0800 Subject: [Libvirt-cim] [PATCH] Remove extra newline characters at end of CU_DEBUG calls In-Reply-To: References: Message-ID: <4739F99B.6000203@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194980442 18000 > # Node ID cd4498fc44de514aed4232f5ee1a9a4828d8e3b1 > # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa > Remove extra newline characters at end of CU_DEBUG calls. > > Signed-off-by: Jay Gagnon > Looks good. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Tue Nov 13 19:24:25 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 13 Nov 2007 11:24:25 -0800 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <49c65d339cc56abfc9dc.1194980476@wulfgar> References: <49c65d339cc56abfc9dc.1194980476@wulfgar> Message-ID: <4739F9E9.606@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194979853 18000 > # Node ID 49c65d339cc56abfc9dc3e09c6f894ea88fc169e > # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 > Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. > > Signed-off-by: Jay Gagnon > This also looks good. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 13 19:31:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 11:31:12 -0800 Subject: [Libvirt-cim] [PATCH] Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output In-Reply-To: <49c65d339cc56abfc9dc.1194980476@wulfgar> (Jay Gagnon's message of "Tue, 13 Nov 2007 14:01:16 -0400") References: <49c65d339cc56abfc9dc.1194980476@wulfgar> Message-ID: <87ve86vt6n.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194979853 18000 JG> # Node ID 49c65d339cc56abfc9dc3e09c6f894ea88fc169e JG> # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 JG> Remove newline characters from CU_DEBUG calls now that the newline is automatic. Also remove a few debug messages that are no longer necessary and clutter output. Applied (without trouble this time). -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 19:35:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 11:35:25 -0800 Subject: [Libvirt-cim] [PATCH] Remove extra newline characters at end of CU_DEBUG calls In-Reply-To: (Jay Gagnon's message of "Tue, 13 Nov 2007 14:01:26 -0400") References: Message-ID: <87r6iuvszm.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194980442 18000 JG> # Node ID cd4498fc44de514aed4232f5ee1a9a4828d8e3b1 JG> # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa JG> Remove extra newline characters at end of CU_DEBUG calls. This one fails to apply for me. Looks like it was made against an old tree. The current one has some cu_statusf() calls in the first rejected hunk that your patch does not. Here is the .rej: *************** static CMPIStatus do_assoc(struct std_as *** 162,196 **** info->result_class, handler->target_class); if (!rc) { - CU_DEBUG("Match_class failed.\n"); - goto out; - } - CU_DEBUG("Match_class succeeded.\n"); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'\n", info->result_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, handler->assoc_class); if (!rc) { - CU_DEBUG("Match_class failed.\n"); - goto out; - } - CU_DEBUG("Match_class succeeded.\n"); - CU_DEBUG("Calling handler->handler...\n"); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { - CU_DEBUG("\thandler did not return CMPI_RC_OK.\n"); goto out; } else { - CU_DEBUG("\thandler returned CMPI_RC_OK.\n"); } if (list.list == NULL) { - CU_DEBUG("\tlist is empty.\n"); goto out; } --- 162,196 ---- info->result_class, handler->target_class); if (!rc) { + CU_DEBUG("Match_class failed."); + goto out; + } + CU_DEBUG("Match_class succeeded."); + + CU_DEBUG("Calling match_class: \tinfo->assoc_class: '%s'", info->result_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, handler->assoc_class); if (!rc) { + CU_DEBUG("Match_class failed."); + goto out; + } + CU_DEBUG("Match_class succeeded."); + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { + CU_DEBUG("Handler did not return CMPI_RC_OK."); goto out; } else { + CU_DEBUG("Handler returned CMPI_RC_OK."); } if (list.list == NULL) { + CU_DEBUG("List is empty."); goto out; } -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 13 20:26:12 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 15:26:12 -0500 Subject: [Libvirt-cim] [PATCH] Remove extra newline characters at end of CU_DEBUG calls In-Reply-To: <87r6iuvszm.fsf@theine.beaverton.ibm.com> References: <87r6iuvszm.fsf@theine.beaverton.ibm.com> Message-ID: <473A0864.1020102@linux.vnet.ibm.com> Dan Smith wrote: > JG> # HG changeset patch > JG> # User Jay Gagnon > JG> # Date 1194980442 18000 > JG> # Node ID cd4498fc44de514aed4232f5ee1a9a4828d8e3b1 > JG> # Parent 5f84fd6c5cdefb2dfe41e4d8ec6ca750d3e69faa > JG> Remove extra newline characters at end of CU_DEBUG calls. > > This one fails to apply for me. Looks like it was made against an old > tree. The current one has some cu_statusf() calls in the first > rejected hunk that your patch does not. > > Oops, that's a bit embarrassing. Looked at the tree a bit and I think I actually just had a slightly outdated version, since the pull URLs and everything were good. At any rate, I'll make sure it's all current and try again. -- -Jay From kaitlin at linux.vnet.ibm.com Tue Nov 13 20:33:19 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 13 Nov 2007 12:33:19 -0800 Subject: [Libvirt-cim] [PATCH] Fix build of ElementCapabilities In-Reply-To: References: Message-ID: <473A0A0F.4020509@linux.vnet.ibm.com> Dan Smith wrote: > if (!parse_fq_devid(inst_id, &host, &device)) { > - cu_status(_BROKER, &s, > - CMPI_RC_ERR_FAILED, > - "Could not get system name."); > + cu_statusf(_BROKER, &s, > + CMPI_RC_ERR_FAILED, > + "Could not get system name."); > goto error1; > } > Oops =) Definitely need that missing "f" +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Tue Nov 13 19:34:09 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 15:34:09 -0400 Subject: [Libvirt-cim] [PATCH] [CU] Remove extra newline characters at end of CU_DEBUG calls Message-ID: <221011f9d887aade0953.1194986049@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1194985986 18000 # Node ID 221011f9d887aade09533310e0e3fae5c51e71ef # Parent 6f09834081cf603e73b82376f738e4384206ffc9 [CU] Remove extra newline characters at end of CU_DEBUG calls. Signed-off-by: Jay Gagnon diff -r 6f09834081cf -r 221011f9d887 std_association.c --- a/std_association.c Mon Nov 12 11:03:04 2007 -0800 +++ b/std_association.c Tue Nov 13 15:33:06 2007 -0500 @@ -139,22 +139,22 @@ static CMPIStatus do_assoc(struct std_as inst_list_init(&list); - CU_DEBUG("Getting handler...\n"); + CU_DEBUG("Getting handler..."); handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - CU_DEBUG("No handler found.\n"); + CU_DEBUG("No handler found."); cu_statusf(ctx->brkr, &s, CMPI_RC_ERR_FAILED, "Unable to handle this association"); goto out; } - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'\n", + CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", handler->source_class, handler->target_class, handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'\n", + CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", info->result_class); rc = match_class(ctx->brkr, @@ -162,42 +162,41 @@ static CMPIStatus do_assoc(struct std_as info->result_class, handler->target_class); if (!rc) { - CU_DEBUG("Match_class failed.\n"); + CU_DEBUG("Match_class failed."); cu_statusf(ctx->brkr, &s, CMPI_RC_ERR_FAILED, "Result class is not valid for this association"); goto out; } - CU_DEBUG("Match_class succeeded.\n"); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'\n", + CU_DEBUG("Match_class succeeded."); + + CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", info->assoc_class); rc = match_class(ctx->brkr, NAMESPACE(ref), info->assoc_class, handler->assoc_class); if (!rc) { - CU_DEBUG("Match_class failed.\n"); + CU_DEBUG("Match_class failed."); cu_statusf(ctx->brkr, &s, CMPI_RC_ERR_FAILED, "Association class given is not valid for" "this association"); goto out; } - CU_DEBUG("Match_class succeeded.\n"); - CU_DEBUG("Calling handler->handler...\n"); + CU_DEBUG("Match_class succeeded, calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { - CU_DEBUG("\thandler did not return CMPI_RC_OK.\n"); + CU_DEBUG("Handler did not return CMPI_RC_OK."); goto out; } else { - CU_DEBUG("\thandler returned CMPI_RC_OK.\n"); + CU_DEBUG("Handler returned CMPI_RC_OK."); } if (list.list == NULL) { - CU_DEBUG("\tlist is empty.\n"); + CU_DEBUG("List is empty."); goto out; } @@ -206,15 +205,15 @@ static CMPIStatus do_assoc(struct std_as info->result_class, ctx->brkr); if (s.rc != CMPI_RC_OK) { - CU_DEBUG("\tfilter_results did not return CMPI_RC_OK.\n"); + CU_DEBUG("filter_results did not return CMPI_RC_OK."); goto out; } if (list.list == NULL) { - CU_DEBUG("\tlist is empty.\n"); + CU_DEBUG("List is empty."); goto out; } else { - CU_DEBUG("\treturned %u instance(s).\n", list.cur); + CU_DEBUG("Returned %u instance(s).", list.cur); } if (names_only) @@ -225,7 +224,6 @@ static CMPIStatus do_assoc(struct std_as out: inst_list_free(&list); - CU_DEBUG("Returning.\n"); return s; } From grendel at linux.vnet.ibm.com Tue Nov 13 20:37:06 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 13 Nov 2007 15:37:06 -0500 Subject: [Libvirt-cim] [PATCH] [CU] Remove extra newline characters at end of CU_DEBUG calls In-Reply-To: <221011f9d887aade0953.1194986049@wulfgar> References: <221011f9d887aade0953.1194986049@wulfgar> Message-ID: <473A0AF2.1080102@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1194985986 18000 > # Node ID 221011f9d887aade09533310e0e3fae5c51e71ef > # Parent 6f09834081cf603e73b82376f738e4384206ffc9 > [CU] Remove extra newline characters at end of CU_DEBUG calls. > > Signed-off-by: Jay Gagnon > > This time I've got the aforementioned cu_statusf() calls in my diff context and the tree is up to date, so should apply cleanly. -- -Jay From danms at us.ibm.com Tue Nov 13 20:39:05 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 12:39:05 -0800 Subject: [Libvirt-cim] [PATCH] [CU] Remove extra newline characters at end of CU_DEBUG calls In-Reply-To: <221011f9d887aade0953.1194986049@wulfgar> (Jay Gagnon's message of "Tue, 13 Nov 2007 15:34:09 -0400") References: <221011f9d887aade0953.1194986049@wulfgar> Message-ID: <87bq9xx4ly.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1194985986 18000 JG> # Node ID 221011f9d887aade09533310e0e3fae5c51e71ef JG> # Parent 6f09834081cf603e73b82376f738e4384206ffc9 JG> [CU] Remove extra newline characters at end of CU_DEBUG calls. Got it that time. Thanks :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 13 21:19:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 14:19:12 -0700 Subject: [Libvirt-cim] [PATCH] Fix RPM dependency in libvirt-cim Message-ID: # HG changeset patch # User Dan Smith # Date 1194992297 28800 # Node ID d2bcdde08df6080caa9ae8d152d516d232fb6345 # Parent 1828b3b30fe476fbae1bf31d99c999ba548911f5 Fix RPM dependency in libvirt-cim Having the sblim-cmpi-devel package installed actually breaks our binary because the sblim broker function table (and many others, probably) does not match what Pegasus uses, making binaries incompatible (which is very disturbing). I was getting a very strange indication trigger crash on F8 because the invokeMethod broker function pointer was off-by-one. Signed-off-by: Dan Smith diff -r 1828b3b30fe4 -r d2bcdde08df6 libvirt-cim.spec.in --- a/libvirt-cim.spec.in Tue Nov 13 11:39:22 2007 -0800 +++ b/libvirt-cim.spec.in Tue Nov 13 14:18:17 2007 -0800 @@ -11,11 +11,12 @@ URL: http://libvirt.org/CIM/ URL: http://libvirt.org/CIM/ Requires: libxml2 Requires: libvirt >= 0.2.3 -BuildRequires: sblim-cmpi-devel +BuildRequires: tog-pegasus-devel BuildRequires: libvirt-devel >= 0.2.3 BuildRequires: e2fsprogs-devel BuildRequires: libxml2-devel BuildRequires: libcmpiutil-devel +BuildConflicts: sblim-cmpi-devel %description Libvirt-cim is a CMPI CIM provider that implements the DMTF SVPC From danms at us.ibm.com Tue Nov 13 21:19:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 14:19:25 -0700 Subject: [Libvirt-cim] [PATCH] Fix RPM dependency in libcmpiutil Message-ID: <6222dfe01952e34740bb.1194992365@theine> # HG changeset patch # User Dan Smith # Date 1194992334 28800 # Node ID 6222dfe01952e34740bb157220f9b33d3a342d29 # Parent c3f816e3ab5ff2a17500d8b48ec601ade58da988 Fix RPM dependency in libcmpiutil Having the sblim-cmpi-devel package installed actually breaks our binary because the sblim broker function table (and many others, probably) does not match what Pegasus uses, making binaries incompatible (which is very disturbing). I was getting a very strange indication trigger crash on F8 because the invokeMethod broker function pointer was off-by-one. Signed-off-by: Dan Smith diff -r c3f816e3ab5f -r 6222dfe01952 libcmpiutil.spec.in --- a/libcmpiutil.spec.in Tue Nov 13 15:33:06 2007 -0500 +++ b/libcmpiutil.spec.in Tue Nov 13 14:18:54 2007 -0800 @@ -9,9 +9,10 @@ Source: libcmpiutil-%{version}.tar.gz Source: libcmpiutil-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root URL: http://libvirt.org/CIM/ -BuildRequires: sblim-cmpi-devel +BuildRequires: tog-pegasus-devel BuildRequires: flex BuildRequires: bison +BuildConflicts: sblim-cmpi-devel %description Libcmpiutil is a library of utility functions for CMPI providers. @@ -23,7 +24,7 @@ instance properties to standardizing met %package devel Summary: Libraries, includes, etc. to use the CMPI utility library Group: Development/Libraries -Requires: sblim-cmpi-devel +Requires: tog-pegasus-devel Requires: pkgconfig %description devel From kaitlin at linux.vnet.ibm.com Tue Nov 13 22:57:14 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 13 Nov 2007 14:57:14 -0800 Subject: [Libvirt-cim] [PATCH] Fix RPM dependency in libvirt-cim In-Reply-To: References: Message-ID: <473A2BCA.4060900@linux.vnet.ibm.com> Dan Smith wrote: > @@ -11,11 +11,12 @@ URL: http://libvirt.org/CIM/ > URL: http://libvirt.org/CIM/ > Requires: libxml2 > Requires: libvirt >= 0.2.3 > -BuildRequires: sblim-cmpi-devel > +BuildRequires: tog-pegasus-devel > BuildRequires: libvirt-devel >= 0.2.3 > BuildRequires: e2fsprogs-devel > BuildRequires: libxml2-devel > BuildRequires: libcmpiutil-devel > +BuildConflicts: sblim-cmpi-devel > Is there a way to make this configurable for those that don't want to use Pegasus? What if you're using Pegasus but you don't have tog-pegasus installed (only sblim-cmpi-devel). Although, forcing Pegasus users to use tog-pegasus-devel instead of sblim-cmpi-devel is probably reasonable. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 13 23:26:43 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 13 Nov 2007 15:26:43 -0800 Subject: [Libvirt-cim] [PATCH] Fix RPM dependency in libvirt-cim In-Reply-To: <473A2BCA.4060900@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Tue, 13 Nov 2007 14:57:14 -0800") References: <473A2BCA.4060900@linux.vnet.ibm.com> Message-ID: <877iklwwuk.fsf@theine.beaverton.ibm.com> KR> Is there a way to make this configurable for those that don't want KR> to use Pegasus? This is only for the RPM, of course, and I'm aiming at the Fedora environment. If any other platforms want to use this spec, then we might need to tweak it, however, I'm not aware of any distros that include sfcb. KR> What if you're using Pegasus but you don't have tog-pegasus KR> installed (only sblim-cmpi-devel). If you're using Pegasus, have sblim-cmpi-devel installed, and try to compile the provider (and libcmpiutil) against it, you'll generate broken binaries. However, I don't think that people who have Pegasus installed from source are likely to try to install/build this RPM, as they would have to disable dependency checking. KR> Although, forcing Pegasus users to use tog-pegasus-devel instead KR> of sblim-cmpi-devel is probably reasonable. In the context of a Fedora build, I think we need to explicitly mark packages that will cause broken binaries to be build as Conflicts. We could, however, make the .spec generated with the correct Requires/Conflicts items based on what CIMOM you told configure to use. Perhaps someone more familiar with RPM building could step in here with an authoritative answer. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From heidieck at linux.vnet.ibm.com Wed Nov 14 09:32:13 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 14 Nov 2007 10:32:13 +0100 Subject: [Libvirt-cim] [PATCH] Updated Copyright Statements and common schema look and feel In-Reply-To: <87mytiywaj.fsf@theine.beaverton.ibm.com> References: <20b83bfd514faa824c55.1194867714@localhost.localdomain> <87r6iv7axj.fsf@theine.beaverton.ibm.com> <47396405.60000@linux.vnet.ibm.com> <87mytiywaj.fsf@theine.beaverton.ibm.com> Message-ID: <473AC09D.2070708@linux.vnet.ibm.com> Dan Smith wrote: > HE> Mhh, applied the patch against the up-to-date tree (clean check > HE> out some minutes ago) without any rejects. > > I looked into it, and the HostedDependency.mof file in the repo was > CRLF terminated, but your patch was not. Maybe the act of emailing it > stripped those off. > > Either way, I commited a little changeset to strip the CR's off the > end of that mof before I committed your patch and it went fine. > > Thanks! > Thanks :) -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 14 09:05:04 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 14 Nov 2007 11:05:04 +0200 Subject: [Libvirt-cim] [PATCH] compare_ref retrieves key count from internal data Message-ID: <785993875a6598c15382.1195034704@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195034692 -3600 # Node ID 785993875a6598c153829a3cfcb5e1088da9971a # Parent c3f816e3ab5ff2a17500d8b48ec601ade58da988 compare_ref retrieves key count from internal data The cu_compare_ref retrieves the key count out of the internal data struct now, instead of the client given object path. Fixes the academical case that a client does not submit the correct number of keys. Signed-off-by: Heidi Eckhart diff -r c3f816e3ab5f -r 785993875a65 instance_util.c --- a/instance_util.c Tue Nov 13 15:33:06 2007 -0500 +++ b/instance_util.c Wed Nov 14 11:04:52 2007 +0100 @@ -89,59 +89,59 @@ static bool _compare_data(const CMPIData } static bool _compare_classname(const CMPIObjectPath *ref, - const CMPIInstance *inst) + const CMPIObjectPath *op) { const char *ref_cn; - const char *inst_cn; - CMPIObjectPath *op; - CMPIStatus s; - - op = CMGetObjectPath(inst, &s); - if ((op == NULL) || (s.rc != CMPI_RC_OK)) - return false; - + const char *op_cn; + ref_cn = CLASSNAME(ref); if (ref_cn == NULL) return false; - - inst_cn = CLASSNAME(op); - if (inst_cn == NULL) + + op_cn = CLASSNAME(op); + if (op_cn == NULL) return false; - - return STREQC(inst_cn, ref_cn); + + return STREQC(op_cn, ref_cn); } const char *cu_compare_ref(const CMPIObjectPath *ref, const CMPIInstance *inst) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *op; + const char *prop = NULL; int i; - CMPIStatus s; int count; - const char *prop = NULL; - count = CMGetKeyCount(ref, &s); + op = CMGetObjectPath(inst, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) + return NULL; + + if (!_compare_classname(ref, op)) + return "CreationClassName"; + + count = CMGetKeyCount(op, &s); if (s.rc != CMPI_RC_OK) { CU_DEBUG("Unable to get key count"); return NULL; } - - if (!_compare_classname(ref, inst)) - return "CreationClassName"; - + CU_DEBUG("Number of keys: %i", count); + for (i = 0; i < count; i++) { CMPIData kd, pd; CMPIString *str; - kd = CMGetKeyAt(ref, i, &str, &s); + kd = CMGetKeyAt(op, i, &str, &s); if (s.rc != CMPI_RC_OK) { CU_DEBUG("Failed to get key %i", i); goto out; } prop = CMGetCharPtr(str); - CU_DEBUG("Comparing key `%s'", prop); + CU_DEBUG("Comparing key %i: `%s'", i, prop); - pd = CMGetProperty(inst, prop, &s); + pd = CMGetKey(ref, prop, &s); if (s.rc != CMPI_RC_OK) { CU_DEBUG("Failed to get property `%s'", prop); goto out; From heidieck at linux.vnet.ibm.com Wed Nov 14 11:19:45 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 14 Nov 2007 13:19:45 +0200 Subject: [Libvirt-cim] [PATCH 0 of 2] ECTP now takes care of Xen and KVM specific requests Message-ID: Changes to association ElementConformsToProfile mof and sources to take care of Xen and KVM specific requests. From heidieck at linux.vnet.ibm.com Wed Nov 14 11:19:46 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 14 Nov 2007 13:19:46 +0200 Subject: [Libvirt-cim] [PATCH 1 of 2] ECTP: Updated Reference properties in mof file to Xen and KVM specific classes In-Reply-To: Message-ID: <3f68d001fb46af7273a4.1195042786@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195041966 -3600 # Node ID 3f68d001fb46af7273a427f54f143e31f3277ecf # Parent bf34b18aba9f05fd04bd5a184ad066adc28f1d6f ECTP: Updated Reference properties in mof file to Xen and KVM specific classes Signed-off-by: Heidi Eckhart diff -r bf34b18aba9f -r 3f68d001fb46 Makefile.am --- a/Makefile.am Wed Nov 14 12:50:38 2007 +0100 +++ b/Makefile.am Wed Nov 14 13:06:06 2007 +0100 @@ -21,6 +21,7 @@ MOFS = \ schema/ProcessorPool.mof \ schema/DiskPool.mof \ schema/HostedResourcePool.mof \ + schema/RegisteredProfile.mof \ schema/ElementConformsToProfile.mof \ schema/ComputerSystemIndication.mof \ schema/ResourceAllocationSettingData.mof \ diff -r bf34b18aba9f -r 3f68d001fb46 schema/ElementConformsToProfile.mof --- a/schema/ElementConformsToProfile.mof Wed Nov 14 12:50:38 2007 +0100 +++ b/schema/ElementConformsToProfile.mof Wed Nov 14 13:06:06 2007 +0100 @@ -6,6 +6,10 @@ ] class Xen_ElementConformsToProfile : CIM_ElementConformsToProfile { + + [Override ("ConformantStandard")] + Xen_RegisteredProfile REF ConformantStandard; + }; [Association, @@ -14,5 +18,9 @@ class Xen_ElementConformsToProfile : CIM ] class KVM_ElementConformsToProfile : CIM_ElementConformsToProfile { + + [Override ("ConformantStandard")] + KVM_RegisteredProfile REF ConformantStandard; + }; From heidieck at linux.vnet.ibm.com Wed Nov 14 11:19:47 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 14 Nov 2007 13:19:47 +0200 Subject: [Libvirt-cim] [PATCH 2 of 2] ECTP: Updated std_assoc structs to reflect changes in mof In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1195042730 -3600 # Node ID c5e23709746cbe95546cf99283ac1143f7684490 # Parent 3f68d001fb46af7273a427f54f143e31f3277ecf ECTP: Updated std_assoc structs to reflect changes in mof Signed-off-by: Heidi Eckhart diff -r 3f68d001fb46 -r c5e23709746c src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 14 13:06:06 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 14 13:18:50 2007 +0100 @@ -192,35 +192,63 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } -struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", +struct std_assoc xen_prof_to_me = { + .source_class = "Xen_RegisteredProfile", .source_prop = "ConformantStandard", .target_class = "CIM_ManagedElement", .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = "Xen_ElementConformsToProfile", .handler = prof_to_elem, .make_ref = make_ref }; -struct std_assoc backward = { +struct std_assoc kvm_prof_to_me = { + .source_class = "KVM_RegisteredProfile", + .source_prop = "ConformantStandard", + + .target_class = "CIM_ManagedElement", + .target_prop = "ManagedElement", + + .assoc_class = "KVM_ElementConformsToProfile", + + .handler = prof_to_elem, + .make_ref = make_ref +}; + +struct std_assoc xen_me_to_prof = { .source_class = "CIM_ManagedElement", .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = "Xen_RegisteredProfile", .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = "Xen_ElementConformsToProfile", .handler = elem_to_prof, .make_ref = make_ref }; +struct std_assoc kvm_me_to_prof = { + .source_class = "CIM_ManagedElement", + .source_prop = "ManagedElement", + + .target_class = "KVM_RegisteredProfile", + .target_prop = "ConformantStandard", + + .assoc_class = "KVM_ElementConformsToProfile", + + .handler = elem_to_prof, + .make_ref = make_ref +}; + struct std_assoc *assoc_handlers[] = { - &forward, - &backward, + &xen_prof_to_me, + &kvm_prof_to_me, + &xen_me_to_prof, + &kvm_me_to_prof, NULL }; From grendel at linux.vnet.ibm.com Wed Nov 14 14:37:02 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 14 Nov 2007 09:37:02 -0500 Subject: [Libvirt-cim] [PATCH 0 of 2] ECTP now takes care of Xen and KVM specific requests In-Reply-To: References: Message-ID: <473B080E.4070104@linux.vnet.ibm.com> Heidi Eckhart wrote: > Changes to association ElementConformsToProfile mof and sources to take care of Xen and KVM specific requests. > > Both of these patches look okay, but all this explicit separation between Xen and KVM has me a little concerned, mainly because I don't understand what makes it necessary here but unnecessary in other providers. Could you explain that a little? -- -Jay From danms at us.ibm.com Wed Nov 14 15:27:46 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 07:27:46 -0800 Subject: [Libvirt-cim] [PATCH] compare_ref retrieves key count from internal data In-Reply-To: <785993875a6598c15382.1195034704@localhost.localdomain> (Heidi Eckhart's message of "Wed, 14 Nov 2007 11:05:04 +0200") References: <785993875a6598c15382.1195034704@localhost.localdomain> Message-ID: <87mytgu9sd.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1195034692 -3600 HE> # Node ID 785993875a6598c153829a3cfcb5e1088da9971a HE> # Parent c3f816e3ab5ff2a17500d8b48ec601ade58da988 HE> compare_ref retrieves key count from internal data Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Nov 14 16:14:22 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 09:14:22 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Updating build scripts to make / install/ and register provider In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195059885 28800 # Node ID dcff5fda5aa96ee449810d2eb37cbf36e5e76eaa # Parent c802d7801234023e14b60f3c2703ec2de063859b Updating build scripts to make / install/ and register provider. Also added the necessary mof /registration files. Signed-off-by: Kaitlin Rupert diff -r c802d7801234 -r dcff5fda5aa9 Makefile.am --- a/Makefile.am Wed Nov 14 09:04:30 2007 -0800 +++ b/Makefile.am Wed Nov 14 09:04:45 2007 -0800 @@ -31,7 +31,8 @@ MOFS = \ schema/NetPool.mof \ schema/ResourceAllocationFromPool.mof \ schema/ElementAllocatedFromPool.mof \ - schema/HostedService.mof + schema/HostedService.mof \ + schema/ElementSettingData.mof INTEROP_MOFS = \ schema/RegisteredProfile.mof \ @@ -67,7 +68,8 @@ REGS = \ schema/NetPool.registration \ schema/ResourceAllocationFromPool.registration \ schema/ElementAllocatedFromPool.registration \ - schema/HostedService.registration + schema/HostedService.registration \ + schema/ElementSettingData.registration INTEROP_REGS = \ schema/RegisteredProfile.registration \ diff -r c802d7801234 -r dcff5fda5aa9 schema/ElementSettingData.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ElementSettingData.mof Wed Nov 14 09:04:45 2007 -0800 @@ -0,0 +1,6 @@ +// Copyright IBM Corp. 2007 +class Xen_ElementSettingData : CIM_ElementSettingData { +}; + +class KVM_ElementSettingData : CIM_ElementSettingData { +}; diff -r c802d7801234 -r dcff5fda5aa9 schema/ElementSettingData.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ElementSettingData.registration Wed Nov 14 09:04:45 2007 -0800 @@ -0,0 +1,4 @@ +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes ... +Xen_ElementSettingData root/virt Xen_ElementSettingDataProvider Virt_ElementSettingData association +KVM_ElementSettingData root/virt KVM_ElementSettingDataProvider Virt_ElementSettingData association diff -r c802d7801234 -r dcff5fda5aa9 src/Makefile.am --- a/src/Makefile.am Wed Nov 14 09:04:30 2007 -0800 +++ b/src/Makefile.am Wed Nov 14 09:04:45 2007 -0800 @@ -49,7 +49,8 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_SettingsDefineState.la \ libVirt_ResourceAllocationFromPool.la \ libVirt_ElementAllocatedFromPool.la \ - libVirt_HostedService.la + libVirt_HostedService.la \ + libVirt_ElementSettingData.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_Device_la_SOURCES = Virt_Device.c @@ -116,3 +117,6 @@ libVirt_ElementAllocatedFromPool_la_LIBA libVirt_HostedService_la_SOURCES = Virt_HostedService.c libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService + +libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD From kaitlin at linux.vnet.ibm.com Wed Nov 14 16:14:23 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 09:14:23 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding ElementSettingData association In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195059870 28800 # Node ID c802d7801234023e14b60f3c2703ec2de063859b # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 Adding ElementSettingData association. This only handles the case defined in section "7.3.4.2 Single-Configuration Implementation Approach" of the VSP. Will update to handle the case(s) defined in the Resource Allocation Profile. The handler name is a bit ugly. I suspect this name will change when I add the RASD pieces. Signed-off-by: Kaitlin Rupert diff -r aad2a74321d5 -r c802d7801234 src/Virt_ElementSettingData.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_ElementSettingData.c Wed Nov 14 09:04:30 2007 -0800 @@ -0,0 +1,182 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Kaitlin Rupert + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include + +#include +#include +#include + +#include "libcmpiutil.h" +#include "std_association.h" +#include "misc_util.h" + +#include "Virt_VSSD.h" + +const static CMPIBroker *_BROKER; + +static CMPIStatus get_dom_name_from_ref(const CMPIObjectPath *ref, + char **dom_name) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + char *id; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID"); + goto out; + } + + *dom_name = strdup(strchr(id, ':') + 1); + if (*dom_name == NULL) + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error retrieving domain name."); + + free(id); + +out: + return s; +} + +static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s; + CMPIInstance *inst; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + char *host = NULL; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + s = get_dom_name_from_ref(ref, &host); + if (s.rc != CMPI_RC_OK) + goto out; + + conn = lv_connect(_BROKER, &s); + if (conn == NULL) + goto out; + + dom = virDomainLookupByName(conn, host); + if (dom == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No such system `%s'", host); + goto out; + } + + inst = get_vssd_instance(dom, _BROKER, ref); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting VSSD for `%s'", host); + goto out; + } + + inst_list_add(list, inst); + + out: + virDomainFree(dom); + virConnectClose(conn); + + return s; +} + +static CMPIInstance *make_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst, + struct std_assoc_info *info, + struct std_assoc *assoc) +{ + CMPIInstance *refinst = NULL; + char *base; + + base = class_base_name(assoc->assoc_class); + if (base == NULL) + goto out; + + refinst = get_typed_instance(_BROKER, + base, + NAMESPACE(ref)); + + if (refinst != NULL) { + CMPIObjectPath *instop; + + instop = CMGetObjectPath(inst, NULL); + + set_reference(assoc, refinst, ref, instop); + + /* Set additional properties with values + * defined in the "Virtual System Profile." + */ + set_reference(assoc, refinst, ref, instop); + unsigned int lValue = 1; + CMSetProperty(refinst, "IsDefault", + (CMPIValue *)&lValue, CMPI_uint16); + + CMSetProperty(refinst, "IsNext", + (CMPIValue *)&lValue, CMPI_uint16); + + CMSetProperty(refinst, "IsMinimum", + (CMPIValue *)&lValue, CMPI_uint16); + + CMSetProperty(refinst, "IsMaximum", + (CMPIValue *)&lValue, CMPI_uint16); + } + +out: + return refinst; +} + +static struct std_assoc vssd_to_sd_fd_bkwd = { + .source_class = "CIM_VirtualSystemSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = vssd_to_sd, + .make_ref = make_ref +}; + +static struct std_assoc *handlers[] = { + &vssd_to_sd_fd_bkwd, + NULL +}; + +STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); + +/* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ From kaitlin at linux.vnet.ibm.com Wed Nov 14 16:14:21 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 09:14:21 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Adding ElementSettingData. Message-ID: From kaitlin at linux.vnet.ibm.com Wed Nov 14 17:05:04 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 09:05:04 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] ECTP: Updated Reference properties in mof file to Xen and KVM specific classes In-Reply-To: <3f68d001fb46af7273a4.1195042786@localhost.localdomain> References: <3f68d001fb46af7273a4.1195042786@localhost.localdomain> Message-ID: <473B2AC0.4040904@linux.vnet.ibm.com> Heidi Eckhart wrote: > ] > class Xen_ElementConformsToProfile : CIM_ElementConformsToProfile > { > + > + [Override ("ConformantStandard")] > + Xen_RegisteredProfile REF ConformantStandard; > + > }; > > [Association, > @@ -14,5 +18,9 @@ class Xen_ElementConformsToProfile : CIM > ] > class KVM_ElementConformsToProfile : CIM_ElementConformsToProfile > { > + > + [Override ("ConformantStandard")] > + KVM_RegisteredProfile REF ConformantStandard; > + > }; > What is override being used for here? Doesn't CIM_ElementConformsToProfile already specify CIM_RegisteredProfile as a conformant standard ref? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Wed Nov 14 18:57:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 10:57:09 -0800 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding ElementSettingData association In-Reply-To: (Kaitlin Rupert's message of "Wed, 14 Nov 2007 09:14:23 -0700") References: Message-ID: <87y7d0sliy.fsf@theine.beaverton.ibm.com> KR> + *dom_name = strdup(strchr(id, ':') + 1); This is a crash waiting to happen. If strchr() returns NULL because the ':' isn't found, then it'll try to strdup(NULL + 1), which will just trample through memory until it hits a '\0' or runs into a segfault. KR> +static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, KR> + struct std_assoc_info *info, KR> + struct inst_list *list) KR> +{ KR> + CMPIStatus s; KR> + CMPIInstance *inst; KR> + virConnectPtr conn = NULL; KR> + virDomainPtr dom = NULL; KR> + char *host = NULL; KR> + KR> + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); KR> + KR> + s = get_dom_name_from_ref(ref, &host); KR> + if (s.rc != CMPI_RC_OK) KR> + goto out; KR> + KR> + conn = lv_connect(_BROKER, &s); KR> + if (conn == NULL) KR> + goto out; KR> + KR> + dom = virDomainLookupByName(conn, host); KR> + if (dom == NULL) { KR> + cu_statusf(_BROKER, &s, KR> + CMPI_RC_ERR_FAILED, KR> + "No such system `%s'", host); KR> + goto out; KR> + } KR> + KR> + inst = get_vssd_instance(dom, _BROKER, ref); KR> + if (inst == NULL) { KR> + cu_statusf(_BROKER, &s, KR> + CMPI_RC_ERR_FAILED, KR> + "Error getting VSSD for `%s'", host); KR> + goto out; KR> + } KR> + KR> + inst_list_add(list, inst); KR> + KR> + out: KR> + virDomainFree(dom); KR> + virConnectClose(conn); KR> + You leak "host" here. KR> +static CMPIInstance *make_ref(const CMPIObjectPath *ref, KR> + const CMPIInstance *inst, KR> + struct std_assoc_info *info, KR> + struct std_assoc *assoc) KR> +{ KR> + CMPIInstance *refinst = NULL; KR> + char *base; KR> + KR> + base = class_base_name(assoc->assoc_class); KR> + if (base == NULL) KR> + goto out; KR> + KR> + refinst = get_typed_instance(_BROKER, KR> + base, KR> + NAMESPACE(ref)); KR> + KR> + if (refinst != NULL) { KR> + CMPIObjectPath *instop; KR> + KR> + instop = CMGetObjectPath(inst, NULL); KR> + KR> + set_reference(assoc, refinst, ref, instop); KR> + KR> + /* Set additional properties with values KR> + * defined in the "Virtual System Profile." KR> + */ KR> + set_reference(assoc, refinst, ref, instop); Are you making the same set_reference() call twice in a row? KR> + unsigned int lValue = 1; Please don't define new variables in the middle of a block. KR> + CMSetProperty(refinst, "IsDefault", KR> + (CMPIValue *)&lValue, CMPI_uint16); "lValue" is an unsigned int, which is not a uint16. Define lValue as a uint16_t. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Nov 14 19:51:53 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 12:51:53 -0700 Subject: [Libvirt-cim] [PATCH] Fix crash and/or error when diskpool.conf does not exist Message-ID: <7798be3698b4a53c1301.1195073513@theine> # HG changeset patch # User Dan Smith # Date 1195073495 28800 # Node ID 7798be3698b4a53c1301dc3e3f4a4bfd1bc9e37b # Parent d2bcdde08df6080caa9ae8d152d516d232fb6345 Fix crash and/or error when diskpool.conf does not exist Previously, a missing diskpool configuration file returned an error, which prevented enumeration of all CIM_ResourcePool objects. This changes that behavior to consider a lack of a diskpool.conf file to mean "no disk pools have been defined", equivalent to how a lack of bridges indicates that no network pools have been defined. Signed-off-by: Dan Smith diff -r d2bcdde08df6 -r 7798be3698b4 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue Nov 13 14:18:17 2007 -0800 +++ b/src/Virt_DevicePool.c Wed Nov 14 12:51:35 2007 -0800 @@ -505,18 +505,14 @@ static CMPIStatus diskpool_instance(virC const char *id, const CMPIBroker *broker) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; struct disk_pool *pools = NULL; int count = 0; int i; count = get_diskpool_config(&pools); - if ((id == NULL) && (count == 0)) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No such pool `%s'", id); - goto out; - } + if ((id == NULL) && (count == 0)) + return s; for (i = 0; i < count; i++) { CMPIInstance *pool; @@ -533,8 +529,6 @@ static CMPIStatus diskpool_instance(virC inst_list_add(list, pool); } - CMSetStatus(&s, CMPI_RC_OK); - out: free_diskpool(pools, count); return s; From danms at us.ibm.com Wed Nov 14 21:22:36 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 14:22:36 -0700 Subject: [Libvirt-cim] [PATCH] Make configure check for broken sblim-cmpi-devel version Message-ID: <9cfd20d3be0e65d695f6.1195078956@theine> # HG changeset patch # User Dan Smith # Date 1195078948 28800 # Node ID 9cfd20d3be0e65d695f6b1ea5b4104c695219aab # Parent 6e221b0af2f4a16fee34213bb6d46a0a3eec4227 Make configure check for broken sblim-cmpi-devel version The sblim version of cmpift.h is broken. We can detect this by checking that the size of the structure on 64-bit platforms meets the CMPI standard of 160 bytes. When sblim fixes their version, this test will start to pass. Testing of this would be appreciated, especially if someone with a 32-bit machine could give it a whirl. Signed-off-by: Dan Smith diff -r 6e221b0af2f4 -r 9cfd20d3be0e acinclude.m4 --- a/acinclude.m4 Wed Nov 14 11:04:52 2007 +0100 +++ b/acinclude.m4 Wed Nov 14 14:22:28 2007 -0800 @@ -71,3 +71,24 @@ AC_DEFUN([CHECK_CMPI], fi ] ) + +AC_DEFUN([CHECK_BROKEN_CMPIFT], + [ + AC_MSG_CHECKING(for a broken cmpift.h) + AC_RUN_IFELSE([ + #include + + int main(void) { + if ((sizeof(unsigned long) == 8) && + (sizeof(struct _CMPIBrokerFT) != 160)) + return 1; + else + return 0; + } + ],[ + AC_MSG_RESULT(no) + ],[ + AC_MSG_ERROR(You have a broken cmpift.h header. Is a broken version of sblim-cmpi-devel installed?) + ] +)]) + diff -r 6e221b0af2f4 -r 9cfd20d3be0e configure.ac --- a/configure.ac Wed Nov 14 11:04:52 2007 +0100 +++ b/configure.ac Wed Nov 14 14:22:28 2007 -0800 @@ -57,6 +57,8 @@ CFLAGS_STRICT="-Werror" CFLAGS_STRICT="-Werror" AC_SUBST(CFLAGS_STRICT) +CHECK_BROKEN_CMPIFT + echo "" echo "Build Embedded Object parser: $eoparser" echo "" From grendel at linux.vnet.ibm.com Wed Nov 14 21:26:53 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 14 Nov 2007 17:26:53 -0400 Subject: [Libvirt-cim] [PATCH] Make net_max callback smarter Message-ID: # HG changeset patch # User Jay Gagnon # Date 1195070622 18000 # Node ID cf3c1b32e71d9a95b3c95ebf3f3622bd39a4a4e3 # Parent 1828b3b30fe476fbae1bf31d99c999ba548911f5 Make net_max callback smarter. Xen 3.0.x supports up to 4 Xen 3.1.x supports up to 8 KVM supports up to 32 Also move a goto that was placed rather poorly. Signed-off-by: Jay Gagnon diff -r 1828b3b30fe4 -r cf3c1b32e71d src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Nov 13 11:39:22 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Nov 14 15:03:42 2007 -0500 @@ -332,27 +332,80 @@ static struct sdc_rasd_prop *net_min(con return rasd; } -static int net_max_xen(const CMPIObjectPath *ref, - CMPIStatus *s) -{ - /* No dynamic lookup for now. */ - return 6; +static uint16_t net_max_kvm(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + /* This appears to not require anything dynamic. */ + return 32; +} +static uint16_t net_max_xen(const CMPIObjectPath *ref, + CMPIStatus *s) +{ + int rc; + virConnectPtr conn; + unsigned long version; + uint16_t num_nics = -1; + + conn = lv_connect(_BROKER, s); + if (s->rc != CMPI_RC_OK) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get connection."); + goto out; + } + + rc = virConnectGetVersion(conn, &version); + CU_DEBUG("libvir : version=%ld, rc=%d", version, rc); + if (rc != 0) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get xen version."); + goto out; + } + + if (version >= 3001000) + num_nics = 8; + else + num_nics = 4; + + out: + virConnectClose(conn); + return num_nics; } static struct sdc_rasd_prop *net_max(const CMPIObjectPath *ref, CMPIStatus *s) { bool ret; + char *prefix; uint16_t num_nics; struct sdc_rasd_prop *rasd = NULL; - /* TODO: relevant functions for KVM etc. and dispatch code. */ - num_nics = net_max_xen(ref, s); + prefix = class_prefix_name(CLASSNAME(ref)); + if (prefix == NULL) { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Could not get prefix from reference."); + goto out; + } + + if (STREQC(prefix, "Xen")) { + num_nics = net_max_xen(ref, s); + } else if (STREQC(prefix, "KVM")) { + num_nics = net_max_kvm(ref, s); + } else { + cu_statusf(_BROKER, s, + CMPI_RC_ERR_NOT_SUPPORTED, + "Unsupported hypervisor: '%s'", prefix); + goto out; + } + + if (s->rc != CMPI_RC_OK) { - goto out; cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, "Could not get max nic count"); + goto out; } struct sdc_rasd_prop tmp[] = { @@ -368,6 +421,7 @@ static struct sdc_rasd_prop *net_max(con "Could not copy RASD."); } out: + free(prefix); return rasd; } From danms at us.ibm.com Wed Nov 14 21:54:05 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 14:54:05 -0700 Subject: [Libvirt-cim] [PATCH] [RFC] Transition back to connect_by_classname() Message-ID: # HG changeset patch # User Dan Smith # Date 1195080791 28800 # Node ID cfb48c67f1e611f10003a6c17ba458080f9d76f4 # Parent c9e977e820e99070f0c0c0397061229f7382ac7b [RFC] Transition back to connect_by_classname() Previously, we used the incoming reference for all operations to determine the URI to pass to libvirt during a connect operation. For some reason, we transitioned away from that to a detection-based mechanism, which would not support multiple technologies to be managed from the provider simultaneously. I think that we have enough other infrastructure in place now that this is no longer a problem. As a test, I offer this patch with a few key instances of lv_connect() replaced with connect_by_classname() for discussion. I have tested that enumeration of Xen_ComputerSystem, KVM_ComputerSystem, and CIM_ComputerSystem are exclusive, and do not return any duplicate results. Further, I have confirmed that resolving Xen_SystemDevice against a KVM_ComputerSystem instance does not work, and that no duplicate results are returned in the case of CIM_SystemDevice. If this looks okay to people (and wider testing supports my findings), I propose we start to convert uses of lv_connect() back to per-class connections until we encounter a problem. Comments welcome. Signed-off-by: Dan Smith diff -r c9e977e820e9 -r cfb48c67f1e6 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Nov 14 13:06:06 2007 +0100 +++ b/libxkutil/misc_util.c Wed Nov 14 14:53:11 2007 -0800 @@ -64,6 +64,8 @@ virConnectPtr connect_by_classname(const return NULL; } + CU_DEBUG("Connecting to libvirt with uri `%s'", uri); + conn = virConnectOpen(uri); if (!conn) { CMSetStatusWithChars(broker, s, @@ -334,28 +336,21 @@ bool provider_is_responsible(const CMPIB const CMPIObjectPath *reference, CMPIStatus *status) { - const char *dft_pfx; char *pfx; - bool rc = false; + bool rc = true; CMSetStatus(status, CMPI_RC_OK); pfx = class_prefix_name(CLASSNAME(reference)); - if (STREQC(pfx, "CIM")) + if (STREQC(pfx, "CIM")) { cu_statusf(broker, status, CMPI_RC_ERR_FAILED, "Please exactly specify the class (check CIMOM behavior!): %s", CLASSNAME(reference)); - - dft_pfx = default_prefix(); - if (dft_pfx == NULL) - goto out; - - if (STREQC(pfx, dft_pfx)) - rc = true; - - out: + rc = false; + } + free(pfx); return rc; } diff -r c9e977e820e9 -r cfb48c67f1e6 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Nov 14 13:06:06 2007 +0100 +++ b/src/Virt_ComputerSystem.c Wed Nov 14 14:53:11 2007 -0800 @@ -346,7 +346,7 @@ static CMPIStatus return_enum_domains(co if (!provider_is_responsible(_BROKER, reference, &s)) return s; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -386,7 +386,7 @@ static CMPIStatus get_domain(const CMPIO return s; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -609,7 +609,7 @@ static CMPIStatus __state_change(char *n virDomainPtr dom = NULL; virDomainInfo info; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; diff -r c9e977e820e9 -r cfb48c67f1e6 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Wed Nov 14 13:06:06 2007 +0100 +++ b/src/Virt_SystemDevice.c Wed Nov 14 14:53:11 2007 -0800 @@ -61,6 +61,7 @@ static int get_dom_devices(const char *n static int get_dom_devices(const char *name, struct inst_list *list, int type, + const char *host_cn, const char *ns) { virConnectPtr conn = NULL; @@ -68,7 +69,7 @@ static int get_dom_devices(const char *n CMPIStatus s; int ret = 0; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -87,17 +88,19 @@ static int get_dom_devices(const char *n static int get_all_devices(const char *name, struct inst_list *list, - char *ns) + const char *host_cn, + const char *ns) { int i; for (i = 0; i < DEV_TYPE_COUNT; i++) - get_dom_devices(name, list, device_types[i], ns); + get_dom_devices(name, list, device_types[i], host_cn, ns); return i; } static CMPIInstance *host_instance(char *name, + const char *host_cn, const char *ns) { CMPIInstance *inst = NULL; @@ -114,7 +117,7 @@ static CMPIInstance *host_instance(char if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -173,9 +176,16 @@ static CMPIStatus sys_to_dev(const CMPIO type = device_type_from_classname(info->result_class); - ret = get_dom_devices(host, list, type, NAMESPACE(ref)); + ret = get_dom_devices(host, + list, + type, + CLASSNAME(ref), + NAMESPACE(ref)); } else { - ret = get_all_devices(host, list, NAMESPACE(ref)); + ret = get_all_devices(host, + list, + CLASSNAME(ref), + NAMESPACE(ref)); } if (ret >= 0) { @@ -218,6 +228,7 @@ static CMPIStatus dev_to_sys(const CMPIO } sys = host_instance(host, + CLASSNAME(ref), NAMESPACE(ref)); if (sys == NULL) From kaitlin at linux.vnet.ibm.com Wed Nov 14 22:34:25 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 15:34:25 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Add function to parse InstanceIDs In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195082890 28800 # Node ID b4f0488c0d16a228a3c6fd6f23f7465cd3944123 # Parent 6dc0a1a05c60ad08738c7c48aa9fb6d7dd7cd8be Add function to parse InstanceIDs. This function currently supports InstanceIDs in the format :, such as "Xen:Domain-0" for VSSD. The functionality is based on the parsing from VSSDComponent, so the code for parsing the InstanceID is replaced by the function. Signed-off-by: Kaitlin Rupert diff -r 6dc0a1a05c60 -r b4f0488c0d16 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Nov 14 15:22:38 2007 -0800 +++ b/libxkutil/misc_util.c Wed Nov 14 15:28:10 2007 -0800 @@ -371,6 +371,27 @@ bool domain_online(virDomainPtr dom) (info.state == VIR_DOMAIN_RUNNING); } +bool parse_id(const CMPIObjectPath *ref, + char **name) +{ + char *id = NULL; + char *pfx = NULL; + int ret; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) + return false; + + ret = sscanf(id, "%a[^:]:%as", &pfx, name); + + free(id); + free(pfx); + + if ((ret != 2) || (*name == NULL)) + return false; + + return true; +} /* * Local Variables: diff -r 6dc0a1a05c60 -r b4f0488c0d16 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Nov 14 15:22:38 2007 -0800 +++ b/libxkutil/misc_util.h Wed Nov 14 15:28:10 2007 -0800 @@ -89,6 +89,8 @@ char *association_prefix(const char *pro char *association_prefix(const char *provider_name); bool match_pn_to_cn(const char *pn, const char *cn); +bool parse_id(const CMPIObjectPath *ref, char **name); + #define ASSOC_MATCH(pn, cn) \ if (!match_pn_to_cn((pn), (cn))) { \ return (CMPIStatus){CMPI_RC_OK, NULL}; \ diff -r 6dc0a1a05c60 -r b4f0488c0d16 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Wed Nov 14 15:22:38 2007 -0800 +++ b/src/Virt_VSSDComponent.c Wed Nov 14 15:28:10 2007 -0800 @@ -41,10 +41,7 @@ static CMPIStatus vssd_to_rasd(const CMP struct inst_list *list) { CMPIStatus s; - char *id = NULL; - char *pfx = NULL; char *name = NULL; - int ret; int i = 0; int types[] = { CIM_RASD_TYPE_PROC, @@ -56,19 +53,10 @@ static CMPIStatus vssd_to_rasd(const CMP ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing InstanceID"); - goto out; - } - - ret = sscanf(id, "%a[^:]:%as", &pfx, &name); - if (ret != 2) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid InstanceID"); + if (!parse_id(ref, &name)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get system name"); goto out; } @@ -83,8 +71,6 @@ static CMPIStatus vssd_to_rasd(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(id); - free(pfx); free(name); return s; From kaitlin at linux.vnet.ibm.com Wed Nov 14 22:34:24 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 15:34:24 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Adding ElementSettingData. Message-ID: Cleaned up previous patch - removed buggy InstanceID parsing code from ElementSettingData. Created a new function in libxutil/misc_util.c based on the InstanceID parsing of VSSDComponent. Cleaned up other bugs / style issues as well. From kaitlin at linux.vnet.ibm.com Wed Nov 14 22:34:27 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 15:34:27 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Adding ElementSettingData association In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195082554 28800 # Node ID c9915bdf44f5cf439c37f87a216116992a604f49 # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 Adding ElementSettingData association. This only handles the case defined in section "7.3.4.2 Single-Configuration Implementation Approach" of the VSP. Will update to handle the case(s) defined in the Resource Allocation Profile. The handler name is a bit ugly. I suspect this name will change when I add the RASD pieces. Signed-off-by: Kaitlin Rupert diff -r aad2a74321d5 -r c9915bdf44f5 src/Virt_ElementSettingData.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_ElementSettingData.c Wed Nov 14 15:22:34 2007 -0800 @@ -0,0 +1,159 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Kaitlin Rupert + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include + +#include +#include +#include + +#include "libcmpiutil.h" +#include "std_association.h" +#include "misc_util.h" + +#include "Virt_VSSD.h" + +const static CMPIBroker *_BROKER; + +static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s; + CMPIInstance *inst; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + char *host = NULL; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + if (!parse_id(ref, &host)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get system name"); + goto out; + } + + conn = lv_connect(_BROKER, &s); + if (conn == NULL) + goto out; + + dom = virDomainLookupByName(conn, host); + if (dom == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No such system `%s'", host); + goto out; + } + + inst = get_vssd_instance(dom, _BROKER, ref); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting VSSD for `%s'", host); + goto out; + } + + inst_list_add(list, inst); + + out: + virDomainFree(dom); + virConnectClose(conn); + free(host); + + return s; +} + +static CMPIInstance *make_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst, + struct std_assoc_info *info, + struct std_assoc *assoc) +{ + CMPIInstance *refinst = NULL; + char *base; + uint16_t prop_value = 1; + + base = class_base_name(assoc->assoc_class); + if (base == NULL) + goto out; + + refinst = get_typed_instance(_BROKER, + base, + NAMESPACE(ref)); + + if (refinst != NULL) { + CMPIObjectPath *instop; + + instop = CMGetObjectPath(inst, NULL); + + set_reference(assoc, refinst, ref, instop); + + /* Set additional properties with values + * defined in the "Virtual System Profile." + */ + CMSetProperty(refinst, "IsDefault", + (CMPIValue *)&prop_value, CMPI_uint16); + + CMSetProperty(refinst, "IsNext", + (CMPIValue *)&prop_value, CMPI_uint16); + + CMSetProperty(refinst, "IsMinimum", + (CMPIValue *)&prop_value, CMPI_uint16); + + CMSetProperty(refinst, "IsMaximum", + (CMPIValue *)&prop_value, CMPI_uint16); + } + +out: + return refinst; +} + +static struct std_assoc vssd_to_sd_fd_bkwd = { + .source_class = "CIM_VirtualSystemSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = vssd_to_sd, + .make_ref = make_ref +}; + +static struct std_assoc *handlers[] = { + &vssd_to_sd_fd_bkwd, + NULL +}; + +STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); + +/* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ From kaitlin at linux.vnet.ibm.com Wed Nov 14 22:34:26 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 15:34:26 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Updating build scripts to make / install/ and register provider In-Reply-To: Message-ID: <6dc0a1a05c60ad08738c.1195083266@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195082558 28800 # Node ID 6dc0a1a05c60ad08738c7c48aa9fb6d7dd7cd8be # Parent c9915bdf44f5cf439c37f87a216116992a604f49 Updating build scripts to make / install/ and register provider. Also added the necessary mof /registration files. Signed-off-by: Kaitlin Rupert diff -r c9915bdf44f5 -r 6dc0a1a05c60 Makefile.am --- a/Makefile.am Wed Nov 14 15:22:34 2007 -0800 +++ b/Makefile.am Wed Nov 14 15:22:38 2007 -0800 @@ -31,7 +31,8 @@ MOFS = \ schema/NetPool.mof \ schema/ResourceAllocationFromPool.mof \ schema/ElementAllocatedFromPool.mof \ - schema/HostedService.mof + schema/HostedService.mof \ + schema/ElementSettingData.mof INTEROP_MOFS = \ schema/RegisteredProfile.mof \ @@ -67,7 +68,8 @@ REGS = \ schema/NetPool.registration \ schema/ResourceAllocationFromPool.registration \ schema/ElementAllocatedFromPool.registration \ - schema/HostedService.registration + schema/HostedService.registration \ + schema/ElementSettingData.registration INTEROP_REGS = \ schema/RegisteredProfile.registration \ diff -r c9915bdf44f5 -r 6dc0a1a05c60 schema/ElementSettingData.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ElementSettingData.mof Wed Nov 14 15:22:38 2007 -0800 @@ -0,0 +1,6 @@ +// Copyright IBM Corp. 2007 +class Xen_ElementSettingData : CIM_ElementSettingData { +}; + +class KVM_ElementSettingData : CIM_ElementSettingData { +}; diff -r c9915bdf44f5 -r 6dc0a1a05c60 schema/ElementSettingData.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ElementSettingData.registration Wed Nov 14 15:22:38 2007 -0800 @@ -0,0 +1,4 @@ +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes ... +Xen_ElementSettingData root/virt Xen_ElementSettingDataProvider Virt_ElementSettingData association +KVM_ElementSettingData root/virt KVM_ElementSettingDataProvider Virt_ElementSettingData association diff -r c9915bdf44f5 -r 6dc0a1a05c60 src/Makefile.am --- a/src/Makefile.am Wed Nov 14 15:22:34 2007 -0800 +++ b/src/Makefile.am Wed Nov 14 15:22:38 2007 -0800 @@ -49,7 +49,8 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_SettingsDefineState.la \ libVirt_ResourceAllocationFromPool.la \ libVirt_ElementAllocatedFromPool.la \ - libVirt_HostedService.la + libVirt_HostedService.la \ + libVirt_ElementSettingData.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_Device_la_SOURCES = Virt_Device.c @@ -116,3 +117,6 @@ libVirt_ElementAllocatedFromPool_la_LIBA libVirt_HostedService_la_SOURCES = Virt_HostedService.c libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService + +libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD From danms at us.ibm.com Wed Nov 14 23:44:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 15:44:06 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Add function to parse InstanceIDs In-Reply-To: (Kaitlin Rupert's message of "Wed, 14 Nov 2007 15:34:25 -0700") References: Message-ID: <87hcjos88p.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1195082890 28800 KR> # Node ID b4f0488c0d16a228a3c6fd6f23f7465cd3944123 KR> # Parent 6dc0a1a05c60ad08738c7c48aa9fb6d7dd7cd8be KR> Add function to parse InstanceIDs. Great! KR> +bool parse_id(const CMPIObjectPath *ref, KR> + char **name) KR> +{ KR> + char *id = NULL; KR> + char *pfx = NULL; KR> + int ret; KR> + KR> + id = cu_get_str_path(ref, "InstanceID"); KR> + if (id == NULL) KR> + return false; KR> + KR> + ret = sscanf(id, "%a[^:]:%as", &pfx, name); KR> + KR> + free(id); KR> + free(pfx); KR> + KR> + if ((ret != 2) || (*name == NULL)) KR> + return false; KR> + KR> + return true; KR> +} What do you think about making parse_id() take a string id, and then also exposing a wrapper function called parse_instanceid() that takes the ref? I'd hate to bundle the actual parsing into a function that takes such a complex type. Also, since this is a library function and it could potentially be used in other places down the road, I think it would be better to make it return both sides of the id, as parse_fq_devid() does now. Yes, it will require the caller to free() another string, but I think its better that way. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Nov 14 23:46:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 15:46:56 -0800 Subject: [Libvirt-cim] [PATCH 3 of 3] Adding ElementSettingData association In-Reply-To: (Kaitlin Rupert's message of "Wed, 14 Nov 2007 15:34:27 -0700") References: Message-ID: <87d4ucs83z.fsf@theine.beaverton.ibm.com> KR> +static CMPIInstance *make_ref(const CMPIObjectPath *ref, KR> + const CMPIInstance *inst, KR> + struct std_assoc_info *info, KR> + struct std_assoc *assoc) KR> +{ KR> + CMPIInstance *refinst = NULL; KR> + char *base; KR> + uint16_t prop_value = 1; KR> + KR> + base = class_base_name(assoc->assoc_class); KR> + if (base == NULL) KR> + goto out; KR> + KR> + refinst = get_typed_instance(_BROKER, KR> + base, KR> + NAMESPACE(ref)); KR> + KR> + if (refinst != NULL) { KR> + CMPIObjectPath *instop; KR> + KR> + instop = CMGetObjectPath(inst, NULL); KR> + KR> + set_reference(assoc, refinst, ref, instop); KR> + KR> + /* Set additional properties with values KR> + * defined in the "Virtual System Profile." KR> + */ KR> + CMSetProperty(refinst, "IsDefault", KR> + (CMPIValue *)&prop_value, CMPI_uint16); KR> + KR> + CMSetProperty(refinst, "IsNext", KR> + (CMPIValue *)&prop_value, CMPI_uint16); KR> + KR> + CMSetProperty(refinst, "IsMinimum", KR> + (CMPIValue *)&prop_value, CMPI_uint16); KR> + KR> + CMSetProperty(refinst, "IsMaximum", KR> + (CMPIValue *)&prop_value, CMPI_uint16); KR> + } KR> + KR> +out: KR> + return refinst; KR> +} You leak "base" here. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 15 00:06:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 16:06:06 -0800 Subject: [Libvirt-cim] [PATCH] Make net_max callback smarter In-Reply-To: (Jay Gagnon's message of "Wed, 14 Nov 2007 17:26:53 -0400") References: Message-ID: <878x50s781.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1195070622 18000 JG> # Node ID cf3c1b32e71d9a95b3c95ebf3f3622bd39a4a4e3 JG> # Parent 1828b3b30fe476fbae1bf31d99c999ba548911f5 JG> Make net_max callback smarter. JG> Xen 3.0.x supports up to 4 JG> Xen 3.1.x supports up to 8 JG> KVM supports up to 32 If there is no way to determine what the current implementation supports via libvirt, I'm inclined to say that we should advertise the maximum as something that is likely to be sane for most installations, since it isn't an enforced limit. Right now, 8 is hardcoded in vl.c. What about putting the Xen (>3.1.0) and QEMU limits in configure and #include here to get the values? That way, we can set them there but make them easily overridable in the case that someone is building the package to run against a modified Xen or QEMU. I'll commit this and cook up a patch for discussion. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Nov 14 23:18:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 14 Nov 2007 16:18:20 -0700 Subject: [Libvirt-cim] [PATCH] Make QEMU and Xen NIC limits configure'able Message-ID: <670294145fcc1a786594.1195085900@theine> # HG changeset patch # User Dan Smith # Date 1195085880 28800 # Node ID 670294145fcc1a786594f5110e2248cd4ec0b7ed # Parent 7a96c19a305233cccd1075cd96fea207954e4890 Make QEMU and Xen NIC limits configure'able Signed-off-by: Dan Smith diff -r 7a96c19a3052 -r 670294145fcc configure.ac --- a/configure.ac Wed Nov 14 15:03:42 2007 -0500 +++ b/configure.ac Wed Nov 14 16:18:00 2007 -0800 @@ -34,6 +34,22 @@ AC_ARG_VAR([LIBVIRTDIR],[the directory w AC_ARG_VAR([LIBVIRTDIR],[the directory where the libvirt package is installed.]) AC_ARG_VAR([TESTSUITEDIR],[the directory where the SBLIM testsuite is installed. ]) + +AC_ARG_WITH([kvm-max-nics], + AC_HELP_STRING([--with-kvm-max-nics=X], + [Maximum NICs to advertise for KVM]), + [test "x$withval" != "x" && KVM_MAX_NICS=$withval], + [KVM_MAX_NICS=8]) +AC_SUBST(KVM_MAX_NICS) +AC_DEFINE_UNQUOTED(KVM_MAX_NICS, $KVM_MAX_NICS, [Maximum NIC limit for KVM]) + +AC_ARG_WITH([xen-max-nics], + AC_HELP_STRING([--with-xen-max-nics=X], + [Maximum NIC limit to advertise for Xen (unless known by the provider)]), + [test "x$withval" != "x" && XEN_MAX_NICS=$withval], + [XEN_MAX_NICS=8]) +AC_SUBST(XEN_MAX_NICS) +AC_DEFINE_UNQUOTED(XEN_MAX_NICS, $XEN_MAX_NICS, [Maximum NIC limit for Xen]) AC_ARG_WITH([namespace], AC_HELP_STRING([--with-namespace=ns], diff -r 7a96c19a3052 -r 670294145fcc src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Nov 14 15:03:42 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Nov 14 16:18:00 2007 -0800 @@ -336,7 +336,7 @@ static uint16_t net_max_kvm(const CMPIOb CMPIStatus *s) { /* This appears to not require anything dynamic. */ - return 32; + return KVM_MAX_NICS; } static uint16_t net_max_xen(const CMPIObjectPath *ref, CMPIStatus *s) @@ -364,7 +364,7 @@ static uint16_t net_max_xen(const CMPIOb } if (version >= 3001000) - num_nics = 8; + num_nics = XEN_MAX_NICS; else num_nics = 4; From kaitlin at linux.vnet.ibm.com Thu Nov 15 01:30:51 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 14 Nov 2007 17:30:51 -0800 Subject: [Libvirt-cim] [PATCH] Fix crash and/or error when diskpool.conf does not exist In-Reply-To: <7798be3698b4a53c1301.1195073513@theine> References: <7798be3698b4a53c1301.1195073513@theine> Message-ID: <473BA14B.5050907@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195073495 28800 > # Node ID 7798be3698b4a53c1301dc3e3f4a4bfd1bc9e37b > # Parent d2bcdde08df6080caa9ae8d152d516d232fb6345 > Fix crash and/or error when diskpool.conf does not exist > > Previously, a missing diskpool configuration file returned an error, which > prevented enumeration of all CIM_ResourcePool objects. This changes that > behavior to consider a lack of a diskpool.conf file to mean "no disk pools > have been defined", equivalent to how a lack of bridges indicates that no > network pools have been defined. > > Signed-off-by: Dan Smith > Seems like a reasonable change. I ran into this issue last week. =) +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From heidieck at linux.vnet.ibm.com Thu Nov 15 08:11:58 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 15 Nov 2007 10:11:58 +0200 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace Message-ID: <937ed1f28893f71163de.1195117918@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195117117 -3600 # Node ID 937ed1f28893f71163de1b673ffaf587d1169db9 # Parent c9e977e820e99070f0c0c0397061229f7382ac7b Add installation instructions for root/interop namespace Signed-off-by: Heidi Eckhart diff -r c9e977e820e9 -r 937ed1f28893 doc/libvirt-cim.html --- a/doc/libvirt-cim.html Wed Nov 14 13:06:06 2007 +0100 +++ b/doc/libvirt-cim.html Thu Nov 15 09:58:37 2007 +0100 @@ -76,6 +76,7 @@ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<

To install the schema in SFCB:

@@ -111,6 +112,23 @@ +//#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")
+//#pragma include ("Security/CIM_IPPacketFilterIndication.mof")
#pragma include ("Support/PRS_ActivityContact.mof")
+

+ +

cimv216-interop.mof is not part of the official DMTF + CIM v2.16 schema package. Please create with the folloing content: +

+ +

+#pragma locale ("en_US")
+#pragma include ("qualifiers.mof")
+#pragma include ("qualifiers_optional.mof")
+#pragma include ("Core/CIM_ManagedElement.mof")
+#pragma include ("Interop/CIM_RegisteredProfile.mof")
+#pragma include ("Interop/CIM_RegisteredSubProfile.mof")
+#pragma include ("Core/CIM_Dependency.mof")
+#pragma include ("Interop/CIM_ElementConformsToProfile.mof")
+#pragma include ("Interop/CIM_ReferencedProfile.mof")
+#pragma include ("Interop/CIM_SubProfileRequiresProfile.mof")

Platform Support

From heidieck at linux.vnet.ibm.com Thu Nov 15 11:38:00 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 15 Nov 2007 12:38:00 +0100 Subject: [Libvirt-cim] [PATCH 2 of 2] ECTP: Updated std_assoc structs to reflect changes in mof In-Reply-To: References: Message-ID: <473C2F98.9080207@linux.vnet.ibm.com> As discussed in yesterday's call, I did some testing against Pegasus and sfcb regarding the necessity of this patch. Neither Pegasus nor sfcb implement that strict input parameter checking on association calls, as it is needed. Requests that do not fulfill the client's requested result set (assocClass, role, resultRole) compared to the association definition (mof) are not filterer out. They are also handed over to the provider. An example: association ElemenentConformsToProfile Xen_RegisteredProfile is ConformantStandard for Xen_ElemenentConformsToProfile KVM_RegisteredProfile is ConformantStandard for KVM_ElemenentConformsToProfile A client request with "assocClass" Xen_ElemenentConformsToProfile and an object path of a KVM_RegisteredProfile is in regard to the mof definition a wrong request. But this request is handed over to the provider, as neither Pegasus nor sfcb does the performance-consuming check if the given object path does fulfill the mof definition. This logic is handed over to the provider code. The std_association library is already prepared for this requirement and partly implements it. The only step that needs to be done in the provider is offering the correct "configuration" to the std_association logic - which is done by this patch now (and I also saw this in some other association providers, e.g. HostedDependency). So yes, this patch duplicates information that was already given in the mof and we could definitely enhance std_association to generically retrieve the class definition from the CIMOM. The behavior seen from the client would be the same. But this minor suggested configuration step uses already existing code by the best performance. So I recommend to apply this patch. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Thu Nov 15 13:19:43 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 15 Nov 2007 14:19:43 +0100 Subject: [Libvirt-cim] [PATCH] [RFC] Transition back to connect_by_classname() In-Reply-To: References: Message-ID: <473C476F.9060000@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195080791 28800 > # Node ID cfb48c67f1e611f10003a6c17ba458080f9d76f4 > # Parent c9e977e820e99070f0c0c0397061229f7382ac7b > [RFC] Transition back to connect_by_classname() > > Previously, we used the incoming reference for all operations to determine > the URI to pass to libvirt during a connect operation. For some reason, > we transitioned away from that to a detection-based mechanism, which would > not support multiple technologies to be managed from the provider > simultaneously. > > I think that we have enough other infrastructure in place now that this is > no longer a problem. As a test, I offer this patch with a few key instances > of lv_connect() replaced with connect_by_classname() for discussion. > > I have tested that enumeration of Xen_ComputerSystem, KVM_ComputerSystem, > and CIM_ComputerSystem are exclusive, and do not return any duplicate > results. > I'm very sorry to tell you, that it does not work with sfcb. [heidineu at localhost ~]$ wbemein http://localhost/root/virt:CIM_ComputerSystem * * wbemein: Cim: (1) CIM_ERR_FAILED: Unable to connect to hypervisor * while the following debug messages are given out: misc_util.c(67): Connecting to libvirt with uri `xen' misc_util.c(67): Connecting to libvirt with uri `qemu:///system' misc_util.c(76): Connected to libvirt with uri `qemu:///system' For me this looks like, that the provider has a problem with being called multiple times (in parallel), because one connection was established with success. > Further, I have confirmed that resolving Xen_SystemDevice against a > KVM_ComputerSystem instance does not work, and that no duplicate results > are returned in the case of CIM_SystemDevice. > > If this looks okay to people (and wider testing supports my findings), > I propose we start to convert uses of lv_connect() back to per-class > connections until we encounter a problem. > > Comments welcome. > -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From grendel at linux.vnet.ibm.com Thu Nov 15 14:56:34 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 09:56:34 -0500 Subject: [Libvirt-cim] [PATCH] Make configure check for broken sblim-cmpi-devel version In-Reply-To: <9cfd20d3be0e65d695f6.1195078956@theine> References: <9cfd20d3be0e65d695f6.1195078956@theine> Message-ID: <473C5E22.6000201@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195078948 28800 > # Node ID 9cfd20d3be0e65d695f6b1ea5b4104c695219aab > # Parent 6e221b0af2f4a16fee34213bb6d46a0a3eec4227 > Make configure check for broken sblim-cmpi-devel version > > The sblim version of cmpift.h is broken. We can detect this by checking > that the size of the structure on 64-bit platforms meets the CMPI standard > of 160 bytes. When sblim fixes their version, this test will start to pass. > > Testing of this would be appreciated, especially if someone with a 32-bit > machine could give it a whirl. > > Signed-off-by: Dan Smith > > > My limited ability to read Linear A -- I mean, m4 -- stops me from being able to comment on the syntax of the patch, but the approach seems sound and we certainly need a check for this. I've got a 32-bit machine I can try and test this on. -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 15 14:57:22 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 09:57:22 -0500 Subject: [Libvirt-cim] [PATCH] Make net_max callback smarter In-Reply-To: <878x50s781.fsf@theine.beaverton.ibm.com> References: <878x50s781.fsf@theine.beaverton.ibm.com> Message-ID: <473C5E52.7010307@linux.vnet.ibm.com> Dan Smith wrote: > JG> # HG changeset patch > JG> # User Jay Gagnon > JG> # Date 1195070622 18000 > JG> # Node ID cf3c1b32e71d9a95b3c95ebf3f3622bd39a4a4e3 > JG> # Parent 1828b3b30fe476fbae1bf31d99c999ba548911f5 > JG> Make net_max callback smarter. > JG> Xen 3.0.x supports up to 4 > JG> Xen 3.1.x supports up to 8 > JG> KVM supports up to 32 > > If there is no way to determine what the current implementation > supports via libvirt, I'm inclined to say that we should advertise the > maximum as something that is likely to be sane for most installations, > since it isn't an enforced limit. Right now, 8 is hardcoded in vl.c. > > What about putting the Xen (>3.1.0) and QEMU limits in configure and > #include here to get the values? That way, we can set them > there but make them easily overridable in the case that someone is > building the package to run against a modified Xen or QEMU. > > I'll commit this and cook up a patch for discussion. > > Okay, that's fine. -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 15 15:01:03 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 10:01:03 -0500 Subject: [Libvirt-cim] [PATCH 1 of 3] Add function to parse InstanceIDs In-Reply-To: <87hcjos88p.fsf@theine.beaverton.ibm.com> References: <87hcjos88p.fsf@theine.beaverton.ibm.com> Message-ID: <473C5F2F.5020001@linux.vnet.ibm.com> Dan Smith wrote: > Also, since this is a library function and it could potentially be > used in other places down the road, I think it would be better to make > it return both sides of the id, as parse_fq_devid() does now. Yes, it > will require the caller to free() another string, but I think its > better that way. > > > Seems like with another 10 minutes ore so you could make it so that passing a NULL pointer in for either side of the id would just mean that part gets ignored, so you only get the side you are actually interested in. It wouldn't force callers to break from convention but would allow for things to be a touch cleaner in the calling function. -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 15 15:15:35 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 10:15:35 -0500 Subject: [Libvirt-cim] [PATCH] Make QEMU and Xen NIC limits configure'able In-Reply-To: <670294145fcc1a786594.1195085900@theine> References: <670294145fcc1a786594.1195085900@theine> Message-ID: <473C6297.8010704@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195085880 28800 > # Node ID 670294145fcc1a786594f5110e2248cd4ec0b7ed > # Parent 7a96c19a305233cccd1075cd96fea207954e4890 > Make QEMU and Xen NIC limits configure'able > > Signed-off-by: Dan Smith > > The m4 seems okay, and the idea is definitely good. +1 -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 15 15:17:06 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 10:17:06 -0500 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: <937ed1f28893f71163de.1195117918@localhost.localdomain> References: <937ed1f28893f71163de.1195117918@localhost.localdomain> Message-ID: <473C62F2.5020601@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1195117117 -3600 > # Node ID 937ed1f28893f71163de1b673ffaf587d1169db9 > # Parent c9e977e820e99070f0c0c0397061229f7382ac7b > Add installation instructions for root/interop namespace > Signed-off-by: Heidi Eckhart > > diff -r c9e977e820e9 -r 937ed1f28893 doc/libvirt-cim.html > --- a/doc/libvirt-cim.html Wed Nov 14 13:06:06 2007 +0100 > +++ b/doc/libvirt-cim.html Thu Nov 15 09:58:37 2007 +0100 > @@ -76,6 +76,7 @@ > $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
> $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
> $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof
> + $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<
>

> > I'm unfamiliar with the pragma include stuff so I can't comment on that, but I think you've got an extra '<' character on the br tag here. -- -Jay From grendel at linux.vnet.ibm.com Thu Nov 15 16:01:20 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 11:01:20 -0500 Subject: [Libvirt-cim] [PATCH] Make configure check for broken sblim-cmpi-devel version In-Reply-To: <473C5E22.6000201@linux.vnet.ibm.com> References: <9cfd20d3be0e65d695f6.1195078956@theine> <473C5E22.6000201@linux.vnet.ibm.com> Message-ID: <473C6D50.3060007@linux.vnet.ibm.com> Jay Gagnon wrote: > Dan Smith wrote: > >> # HG changeset patch >> # User Dan Smith >> # Date 1195078948 28800 >> # Node ID 9cfd20d3be0e65d695f6b1ea5b4104c695219aab >> # Parent 6e221b0af2f4a16fee34213bb6d46a0a3eec4227 >> Make configure check for broken sblim-cmpi-devel version >> >> The sblim version of cmpift.h is broken. We can detect this by checking >> that the size of the structure on 64-bit platforms meets the CMPI standard >> of 160 bytes. When sblim fixes their version, this test will start to pass. >> >> Testing of this would be appreciated, especially if someone with a 32-bit >> machine could give it a whirl. >> >> Signed-off-by: Dan Smith >> >> >> >> > My limited ability to read Linear A -- I mean, m4 -- stops me from being > able to comment on the syntax of the patch, but the approach seems sound > and we certainly need a check for this. I've got a 32-bit machine I can > try and test this on. > > > I'm getting rejects on both files, but my tree is up to date. Does this patch depend on any other patches? -- -Jay From kaitlin at linux.vnet.ibm.com Thu Nov 15 16:37:17 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 08:37:17 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Add function to parse InstanceIDs In-Reply-To: <473C5F2F.5020001@linux.vnet.ibm.com> References: <87hcjos88p.fsf@theine.beaverton.ibm.com> <473C5F2F.5020001@linux.vnet.ibm.com> Message-ID: <473C75BD.1030304@linux.vnet.ibm.com> Jay Gagnon wrote: > Dan Smith wrote: > >> Also, since this is a library function and it could potentially be >> used in other places down the road, I think it would be better to make >> it return both sides of the id, as parse_fq_devid() does now. Yes, it >> will require the caller to free() another string, but I think its >> better that way. >> >> >> >> > Seems like with another 10 minutes ore so you could make it so that > passing a NULL pointer in for either side of the id would just mean that > part gets ignored, so you only get the side you are actually interested > in. It wouldn't force callers to break from convention but would allow > for things to be a touch cleaner in the calling function. > Both seem like good ideas. I'll see if I can write up something reasonable. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 15 16:40:02 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 08:40:02 -0800 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: <937ed1f28893f71163de.1195117918@localhost.localdomain> References: <937ed1f28893f71163de.1195117918@localhost.localdomain> Message-ID: <473C7662.2000000@linux.vnet.ibm.com> Heidi Eckhart wrote: > +

> +#pragma locale ("en_US")
> +#pragma include ("qualifiers.mof")
> +#pragma include ("qualifiers_optional.mof")
> +#pragma include ("Core/CIM_ManagedElement.mof")
> +#pragma include ("Interop/CIM_RegisteredProfile.mof")
> +#pragma include ("Interop/CIM_RegisteredSubProfile.mof")
> +#pragma include ("Core/CIM_Dependency.mof")
> +#pragma include ("Interop/CIM_ElementConformsToProfile.mof")
> +#pragma include ("Interop/CIM_ReferencedProfile.mof")
> +#pragma include ("Interop/CIM_SubProfileRequiresProfile.mof")
>

> From what little experience I have with mof files / pragma.. this part looks fine. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 15 17:13:02 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 10:13:02 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Adding ElementSettingData association In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195148985 28800 # Node ID e2459a1be808c519f2e22a6cc186bd8c9c9f7f12 # Parent aad2a74321d54e26b5b2c89dc8df0e95bd1860f8 Adding ElementSettingData association. This only handles the case defined in section "7.3.4.2 Single-Configuration Implementation Approach" of the VSP. Will update to handle the case(s) defined in the Resource Allocation Profile. The handler name is a bit ugly. I suspect this name will change when I add the RASD pieces. Signed-off-by: Kaitlin Rupert diff -r aad2a74321d5 -r e2459a1be808 src/Virt_ElementSettingData.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_ElementSettingData.c Thu Nov 15 09:49:45 2007 -0800 @@ -0,0 +1,161 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Kaitlin Rupert + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include +#include +#include + +#include +#include +#include + +#include "libcmpiutil.h" +#include "std_association.h" +#include "misc_util.h" + +#include "Virt_VSSD.h" + +const static CMPIBroker *_BROKER; + +static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s; + CMPIInstance *inst; + virConnectPtr conn = NULL; + virDomainPtr dom = NULL; + char *host = NULL; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + if (!parse_instanceid(ref, NULL, &host)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get system name"); + goto out; + } + + conn = lv_connect(_BROKER, &s); + if (conn == NULL) + goto out; + + dom = virDomainLookupByName(conn, host); + if (dom == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No such system `%s'", host); + goto out; + } + + inst = get_vssd_instance(dom, _BROKER, ref); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting VSSD for `%s'", host); + goto out; + } + + inst_list_add(list, inst); + + out: + virDomainFree(dom); + virConnectClose(conn); + free(host); + + return s; +} + +static CMPIInstance *make_ref(const CMPIObjectPath *ref, + const CMPIInstance *inst, + struct std_assoc_info *info, + struct std_assoc *assoc) +{ + CMPIInstance *refinst = NULL; + char *base; + uint16_t prop_value = 1; + + base = class_base_name(assoc->assoc_class); + if (base == NULL) + goto out; + + refinst = get_typed_instance(_BROKER, + base, + NAMESPACE(ref)); + + if (refinst != NULL) { + CMPIObjectPath *instop; + + instop = CMGetObjectPath(inst, NULL); + + set_reference(assoc, refinst, ref, instop); + + /* Set additional properties with values + * defined in the "Virtual System Profile." + */ + CMSetProperty(refinst, "IsDefault", + (CMPIValue *)&prop_value, CMPI_uint16); + + CMSetProperty(refinst, "IsNext", + (CMPIValue *)&prop_value, CMPI_uint16); + + CMSetProperty(refinst, "IsMinimum", + (CMPIValue *)&prop_value, CMPI_uint16); + + CMSetProperty(refinst, "IsMaximum", + (CMPIValue *)&prop_value, CMPI_uint16); + } + +out: + free(base); + + return refinst; +} + +static struct std_assoc vssd_to_sd_fd_bkwd = { + .source_class = "CIM_VirtualSystemSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = vssd_to_sd, + .make_ref = make_ref +}; + +static struct std_assoc *handlers[] = { + &vssd_to_sd_fd_bkwd, + NULL +}; + +STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); + +/* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ From kaitlin at linux.vnet.ibm.com Thu Nov 15 17:12:59 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 10:12:59 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Adding ElementSettingData. Message-ID: Cleaned up previous patch - removed buggy InstanceID parsing code from ElementSettingData. Created a new function in libxutil/misc_util.c based on the InstanceID parsing of VSSDComponent. Enhanced parse_id() functionality to return both pfx and name. Added a parse_instanceid() wrapper function. From kaitlin at linux.vnet.ibm.com Thu Nov 15 17:13:00 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 10:13:00 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Add function to parse InstanceIDs In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195150277 28800 # Node ID e80e9e777ac770ce8e5e9a25883af47eb05a266a # Parent ae4810e6764b1ea14df6f429eab972593e919e37 Add function to parse InstanceIDs. This function currently supports InstanceIDs in the format :, such as "Xen:Domain-0" for VSSD. The functionality is based on the parsing from VSSDComponent, so the code for parsing the InstanceID is replaced by the function. Updated function so that it can return both the InstanceID prefix (org) and the localID. The call has the option of supplying NULL for either argument. Also added a wrapper function that takes a CMPIObjectPath ref, grabs the instanceID, and then calls the parse_id() function. Signed-off-by: Kaitlin Rupert diff -r ae4810e6764b -r e80e9e777ac7 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Thu Nov 15 09:49:47 2007 -0800 +++ b/libxkutil/misc_util.c Thu Nov 15 10:11:17 2007 -0800 @@ -371,6 +371,52 @@ bool domain_online(virDomainPtr dom) (info.state == VIR_DOMAIN_RUNNING); } +int parse_id(char *id, + char **pfx, + char **name) +{ + int ret; + char *tmp_pfx; + char *tmp_name; + + ret = sscanf(id, "%a[^:]:%as", &tmp_pfx, &tmp_name); + if (ret != 2) { + ret = 0; + goto out; + } + + if (pfx) + *pfx = strdup(tmp_pfx); + + if (name) + *name = strdup(tmp_name); + + ret = 1; + + out: + free(tmp_pfx); + free(tmp_name); + + return ret; +} + +bool parse_instanceid(const CMPIObjectPath *ref, + char **pfx, + char **name) +{ + int ret; + char *id = NULL; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) + return false; + + ret = parse_id(id, pfx, name); + if (!ret) + return false; + + return true; +} /* * Local Variables: diff -r ae4810e6764b -r e80e9e777ac7 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Thu Nov 15 09:49:47 2007 -0800 +++ b/libxkutil/misc_util.h Thu Nov 15 10:11:17 2007 -0800 @@ -89,6 +89,9 @@ char *association_prefix(const char *pro char *association_prefix(const char *provider_name); bool match_pn_to_cn(const char *pn, const char *cn); +int parse_id(char *id, char **pfx, char **name); +bool parse_instanceid(const CMPIObjectPath *ref, char **pfx, char **name); + #define ASSOC_MATCH(pn, cn) \ if (!match_pn_to_cn((pn), (cn))) { \ return (CMPIStatus){CMPI_RC_OK, NULL}; \ diff -r ae4810e6764b -r e80e9e777ac7 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Thu Nov 15 09:49:47 2007 -0800 +++ b/src/Virt_VSSDComponent.c Thu Nov 15 10:11:17 2007 -0800 @@ -41,10 +41,7 @@ static CMPIStatus vssd_to_rasd(const CMP struct inst_list *list) { CMPIStatus s; - char *id = NULL; - char *pfx = NULL; char *name = NULL; - int ret; int i = 0; int types[] = { CIM_RASD_TYPE_PROC, @@ -56,19 +53,10 @@ static CMPIStatus vssd_to_rasd(const CMP ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing InstanceID"); - goto out; - } - - ret = sscanf(id, "%a[^:]:%as", &pfx, &name); - if (ret != 2) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid InstanceID"); + if (!parse_instanceid(ref, NULL, &name)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get system name"); goto out; } @@ -83,8 +71,6 @@ static CMPIStatus vssd_to_rasd(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(id); - free(pfx); free(name); return s; From kaitlin at linux.vnet.ibm.com Thu Nov 15 17:13:01 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 10:13:01 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Updating build scripts to make / install/ and register provider In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195148987 28800 # Node ID ae4810e6764b1ea14df6f429eab972593e919e37 # Parent e2459a1be808c519f2e22a6cc186bd8c9c9f7f12 Updating build scripts to make / install/ and register provider. Also added the necessary mof /registration files. Signed-off-by: Kaitlin Rupert diff -r e2459a1be808 -r ae4810e6764b Makefile.am --- a/Makefile.am Thu Nov 15 09:49:45 2007 -0800 +++ b/Makefile.am Thu Nov 15 09:49:47 2007 -0800 @@ -31,7 +31,8 @@ MOFS = \ schema/NetPool.mof \ schema/ResourceAllocationFromPool.mof \ schema/ElementAllocatedFromPool.mof \ - schema/HostedService.mof + schema/HostedService.mof \ + schema/ElementSettingData.mof INTEROP_MOFS = \ schema/RegisteredProfile.mof \ @@ -67,7 +68,8 @@ REGS = \ schema/NetPool.registration \ schema/ResourceAllocationFromPool.registration \ schema/ElementAllocatedFromPool.registration \ - schema/HostedService.registration + schema/HostedService.registration \ + schema/ElementSettingData.registration INTEROP_REGS = \ schema/RegisteredProfile.registration \ diff -r e2459a1be808 -r ae4810e6764b schema/ElementSettingData.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ElementSettingData.mof Thu Nov 15 09:49:47 2007 -0800 @@ -0,0 +1,6 @@ +// Copyright IBM Corp. 2007 +class Xen_ElementSettingData : CIM_ElementSettingData { +}; + +class KVM_ElementSettingData : CIM_ElementSettingData { +}; diff -r e2459a1be808 -r ae4810e6764b schema/ElementSettingData.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ElementSettingData.registration Thu Nov 15 09:49:47 2007 -0800 @@ -0,0 +1,4 @@ +# Copyright IBM Corp. 2007 +# Classname Namespace ProviderName ProviderModule ProviderTypes ... +Xen_ElementSettingData root/virt Xen_ElementSettingDataProvider Virt_ElementSettingData association +KVM_ElementSettingData root/virt KVM_ElementSettingDataProvider Virt_ElementSettingData association diff -r e2459a1be808 -r ae4810e6764b src/Makefile.am --- a/src/Makefile.am Thu Nov 15 09:49:45 2007 -0800 +++ b/src/Makefile.am Thu Nov 15 09:49:47 2007 -0800 @@ -49,7 +49,8 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_SettingsDefineState.la \ libVirt_ResourceAllocationFromPool.la \ libVirt_ElementAllocatedFromPool.la \ - libVirt_HostedService.la + libVirt_HostedService.la \ + libVirt_ElementSettingData.la libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_Device_la_SOURCES = Virt_Device.c @@ -116,3 +117,6 @@ libVirt_ElementAllocatedFromPool_la_LIBA libVirt_HostedService_la_SOURCES = Virt_HostedService.c libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService + +libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD From danms at us.ibm.com Thu Nov 15 18:02:21 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 10:02:21 -0800 Subject: [Libvirt-cim] [PATCH] [RFC] Transition back to connect_by_classname() References: <473C476F.9060000@linux.vnet.ibm.com> Message-ID: <87r6irqtea.fsf@theine.beaverton.ibm.com> HE> I'm very sorry to tell you, that it does not work with sfcb. Well, for what it's worth, I can't get it to fail in this way under sfcb. However, I can get pegasus to exhibit this behavior *some* of the time when forceProviderProcesses=true. It's about 25% of the time, and only seems to fail on the first connection attempt. After this, both connections succeed 100% of the time (AFAICT). I feel confident that this is a libvirt problem, as I've been able to reproduce it (very) occasionally with the attached test program. If I introduce a delay in one of the paths (i.e. KVM) I can't get it to fail, which indicates to me that it is a race condition somewhere. I will follow up on this and try to figure out the problem, but I don't think it should block our conversion to by-classname libvirt connections. It would be good if some other people test this patch and report on its behavior with this wbemcli command: HE> [heidineu at localhost ~]$ wbemein http://localhost/root/virt:CIM_ComputerSystem Reports of libvirt version, bitness, etc would be useful. I'm seeing this on libvirt-0.3.3 on an x86_64 machine. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: parallel.c Type: text/x-csrc Size: 753 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 15 18:22:01 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 10:22:01 -0800 Subject: [Libvirt-cim] [PATCH 2 of 2] ECTP: Updated std_assoc structs to reflect changes in mof In-Reply-To: <473C2F98.9080207@linux.vnet.ibm.com> (Heidi Eckhart's message of "Thu, 15 Nov 2007 12:38:00 +0100") References: <473C2F98.9080207@linux.vnet.ibm.com> Message-ID: <87mytfqshi.fsf@theine.beaverton.ibm.com> HE> A client request with "assocClass" Xen_ElemenentConformsToProfile HE> and an object path of a KVM_RegisteredProfile is in regard to the HE> mof definition a wrong request. Okay, I understand this issue now, thanks for the clarification. What concerns me about the patch is that we have to change CIM_Foo to Xen_Foo and KVM_Foo, thus doubling the number of association descriptor blocks. Could we not solve this with another match macro or helper function that each handler calls to make sure that the prefix of the reference classname matches that of the assocClass? Such a change would add just another line per handler, instead of an entire std_assoc block for *each* new platform we wish to support. Is there any reason not to solve it this way? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 15 18:28:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 11:28:34 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Move to per-classname connections, without the race Message-ID: This should fix the behavior Heidi and I were seeing with connect_by_classname() Comments and test feedback appreciated :) From danms at us.ibm.com Thu Nov 15 18:28:35 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 11:28:35 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195154883 28800 # Node ID ecc46606e90388217b94916c1eab2ceeb051064a # Parent 670294145fcc1a786594f5110e2248cd4ec0b7ed Initialize libvirt early so that we avoid the backend register race This fixes the errant behavior we see with parallel calls to connect_by_classname(). This behavior was certainly possible with lv_connect(), but I imagine we were getting lucky most of the time. Signed-off-by: Dan Smith diff -r 670294145fcc -r ecc46606e903 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Nov 14 16:18:00 2007 -0800 +++ b/src/Virt_ComputerSystem.c Thu Nov 15 11:28:03 2007 -0800 @@ -688,7 +688,7 @@ Virt_ComputerSystemProvider_Create_Insta const CMPIContext *, CMPIStatus *rc); -CMInstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, CMNoHook); +CMInstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, virInitialize()); static struct method_handler RequestStateChange = { .name = "RequestStateChange", From danms at us.ibm.com Thu Nov 15 18:28:36 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 11:28:36 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] [RFC] Transition back to connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195154884 28800 # Node ID ba709792befea803190657550854716fd0e21aec # Parent ecc46606e90388217b94916c1eab2ceeb051064a [RFC] Transition back to connect_by_classname() Previously, we used the incoming reference for all operations to determine the URI to pass to libvirt during a connect operation. For some reason, we transitioned away from that to a detection-based mechanism, which would not support multiple technologies to be managed from the provider simultaneously. I think that we have enough other infrastructure in place now that this is no longer a problem. As a test, I offer this patch with a few key instances of lv_connect() replaced with connect_by_classname() for discussion. I have tested that enumeration of Xen_ComputerSystem, KVM_ComputerSystem, and CIM_ComputerSystem are exclusive, and do not return any duplicate results. Further, I have confirmed that resolving Xen_SystemDevice against a KVM_ComputerSystem instance does not work, and that no duplicate results are returned in the case of CIM_SystemDevice. If this looks okay to people (and wider testing supports my findings), I propose we start to convert uses of lv_connect() back to per-class connections until we encounter a problem. Comments welcome. Signed-off-by: Dan Smith diff -r ecc46606e903 -r ba709792befe libxkutil/misc_util.c --- a/libxkutil/misc_util.c Thu Nov 15 11:28:03 2007 -0800 +++ b/libxkutil/misc_util.c Thu Nov 15 11:28:04 2007 -0800 @@ -64,6 +64,8 @@ virConnectPtr connect_by_classname(const return NULL; } + CU_DEBUG("Connecting to libvirt with uri `%s'", uri); + conn = virConnectOpen(uri); if (!conn) { CMSetStatusWithChars(broker, s, @@ -334,28 +336,21 @@ bool provider_is_responsible(const CMPIB const CMPIObjectPath *reference, CMPIStatus *status) { - const char *dft_pfx; char *pfx; - bool rc = false; + bool rc = true; CMSetStatus(status, CMPI_RC_OK); pfx = class_prefix_name(CLASSNAME(reference)); - if (STREQC(pfx, "CIM")) + if (STREQC(pfx, "CIM")) { cu_statusf(broker, status, CMPI_RC_ERR_FAILED, "Please exactly specify the class (check CIMOM behavior!): %s", CLASSNAME(reference)); - - dft_pfx = default_prefix(); - if (dft_pfx == NULL) - goto out; - - if (STREQC(pfx, dft_pfx)) - rc = true; - - out: + rc = false; + } + free(pfx); return rc; } diff -r ecc46606e903 -r ba709792befe src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Thu Nov 15 11:28:03 2007 -0800 +++ b/src/Virt_ComputerSystem.c Thu Nov 15 11:28:04 2007 -0800 @@ -346,7 +346,7 @@ static CMPIStatus return_enum_domains(co if (!provider_is_responsible(_BROKER, reference, &s)) return s; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -386,7 +386,7 @@ static CMPIStatus get_domain(const CMPIO return s; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -609,7 +609,7 @@ static CMPIStatus __state_change(char *n virDomainPtr dom = NULL; virDomainInfo info; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; diff -r ecc46606e903 -r ba709792befe src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Thu Nov 15 11:28:03 2007 -0800 +++ b/src/Virt_SystemDevice.c Thu Nov 15 11:28:04 2007 -0800 @@ -61,6 +61,7 @@ static int get_dom_devices(const char *n static int get_dom_devices(const char *name, struct inst_list *list, int type, + const char *host_cn, const char *ns) { virConnectPtr conn = NULL; @@ -68,7 +69,7 @@ static int get_dom_devices(const char *n CMPIStatus s; int ret = 0; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -87,17 +88,19 @@ static int get_dom_devices(const char *n static int get_all_devices(const char *name, struct inst_list *list, - char *ns) + const char *host_cn, + const char *ns) { int i; for (i = 0; i < DEV_TYPE_COUNT; i++) - get_dom_devices(name, list, device_types[i], ns); + get_dom_devices(name, list, device_types[i], host_cn, ns); return i; } static CMPIInstance *host_instance(char *name, + const char *host_cn, const char *ns) { CMPIInstance *inst = NULL; @@ -114,7 +117,7 @@ static CMPIInstance *host_instance(char if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -173,9 +176,16 @@ static CMPIStatus sys_to_dev(const CMPIO type = device_type_from_classname(info->result_class); - ret = get_dom_devices(host, list, type, NAMESPACE(ref)); + ret = get_dom_devices(host, + list, + type, + CLASSNAME(ref), + NAMESPACE(ref)); } else { - ret = get_all_devices(host, list, NAMESPACE(ref)); + ret = get_all_devices(host, + list, + CLASSNAME(ref), + NAMESPACE(ref)); } if (ret >= 0) { @@ -218,6 +228,7 @@ static CMPIStatus dev_to_sys(const CMPIO } sys = host_instance(host, + CLASSNAME(ref), NAMESPACE(ref)); if (sys == NULL) From danms at us.ibm.com Thu Nov 15 19:55:45 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 11:55:45 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Add function to parse InstanceIDs References: Message-ID: <877ikjqo5a.fsf@theine.beaverton.ibm.com> KR> +bool parse_instanceid(const CMPIObjectPath *ref, KR> + char **pfx, KR> + char **name) KR> +{ KR> + int ret; KR> + char *id = NULL; KR> + KR> + id = cu_get_str_path(ref, "InstanceID"); KR> + if (id == NULL) KR> + return false; KR> + KR> + ret = parse_id(id, pfx, name); KR> + if (!ret) KR> + return false; KR> + KR> + return true; KR> +} You leak "id" here :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Thu Nov 15 20:22:47 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 15 Nov 2007 15:22:47 -0500 Subject: [Libvirt-cim] [PATCH] Make configure check for broken sblim-cmpi-devel version In-Reply-To: <9cfd20d3be0e65d695f6.1195078956@theine> References: <9cfd20d3be0e65d695f6.1195078956@theine> Message-ID: <473CAA97.5070401@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195078948 28800 > # Node ID 9cfd20d3be0e65d695f6b1ea5b4104c695219aab > # Parent 6e221b0af2f4a16fee34213bb6d46a0a3eec4227 > Make configure check for broken sblim-cmpi-devel version > > The sblim version of cmpift.h is broken. We can detect this by checking > that the size of the structure on 64-bit platforms meets the CMPI standard > of 160 bytes. When sblim fixes their version, this test will start to pass. > > Testing of this would be appreciated, especially if someone with a 32-bit > machine could give it a whirl. > > Signed-off-by: Dan Smith > > > Fixed the reject issue, by applying the patch to the correct tree. Go Jay. Applies fun, and I pass the configure check "checking for a broken cmpift.h... no" which is how it should be. You want me to try to get it to fail? -- -Jay From danms at us.ibm.com Thu Nov 15 21:07:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 13:07:15 -0800 Subject: [Libvirt-cim] [PATCH] Make configure check for broken sblim-cmpi-devel version In-Reply-To: <473CAA97.5070401@linux.vnet.ibm.com> (Jay Gagnon's message of "Thu, 15 Nov 2007 15:22:47 -0500") References: <9cfd20d3be0e65d695f6.1195078956@theine> <473CAA97.5070401@linux.vnet.ibm.com> Message-ID: <873av7qku4.fsf@theine.beaverton.ibm.com> JG> Fixed the reject issue, by applying the patch to the correct tree. JG> Go Jay. Applies fun, and I pass the configure check "checking for JG> a broken cmpift.h... no" which is how it should be. You want me JG> to try to get it to fail? Nope. It only matters on 64-bit anyway, so it shouldn't be fail-able on 32. I just needed to make sure it didn't fail as a false-positive. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Thu Nov 15 22:18:34 2007 From: veillard at redhat.com (Daniel Veillard) Date: Thu, 15 Nov 2007 17:18:34 -0500 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race In-Reply-To: References: Message-ID: <20071115221834.GH8861@redhat.com> On Thu, Nov 15, 2007 at 11:28:35AM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195154883 28800 > # Node ID ecc46606e90388217b94916c1eab2ceeb051064a > # Parent 670294145fcc1a786594f5110e2248cd4ec0b7ed > Initialize libvirt early so that we avoid the backend register race > Yup, if you don't call Initialize() first multiple parallel connect operations may race trying to do the initialization simultaneously. We actually have locks in libvirt (or rather we reuse the ones from libxml2) so we could try to do some locking in Initialize, but I really prefer a model where the init is clearly separated. Looks fine to me even if I don't understand the details of how that patch works. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From kaitlin at linux.vnet.ibm.com Thu Nov 15 23:24:24 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 16:24:24 -0700 Subject: [Libvirt-cim] [PATCH] Add function to parse InstanceIDs Message-ID: <499034149a6bc4072ad7.1195172664@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195172367 28800 # Node ID 499034149a6bc4072ad76f06d107059613277d6a # Parent ae4810e6764b1ea14df6f429eab972593e919e37 Add function to parse InstanceIDs. This function currently supports InstanceIDs in the format :, such as "Xen:Domain-0" for VSSD. The functionality is based on the parsing from VSSDComponent, so the code for parsing the InstanceID is replaced by the function. Updated function so that it can return both the InstanceID prefix (org) and the localID. The call has the option of supplying NULL for either argument. Also added a wrapper function that takes a CMPIObjectPath ref, grabs the instanceID, and then calls the parse_id() function. Fixed memory leak. Signed-off-by: Kaitlin Rupert diff -r ae4810e6764b -r 499034149a6b libxkutil/misc_util.c --- a/libxkutil/misc_util.c Thu Nov 15 09:49:47 2007 -0800 +++ b/libxkutil/misc_util.c Thu Nov 15 16:19:27 2007 -0800 @@ -371,6 +371,55 @@ bool domain_online(virDomainPtr dom) (info.state == VIR_DOMAIN_RUNNING); } +int parse_id(char *id, + char **pfx, + char **name) +{ + int ret; + char *tmp_pfx; + char *tmp_name; + + ret = sscanf(id, "%a[^:]:%as", &tmp_pfx, &tmp_name); + if (ret != 2) { + ret = 0; + goto out; + } + + if (pfx) + *pfx = strdup(tmp_pfx); + + if (name) + *name = strdup(tmp_name); + + ret = 1; + + out: + free(tmp_pfx); + free(tmp_name); + + return ret; +} + +bool parse_instanceid(const CMPIObjectPath *ref, + char **pfx, + char **name) +{ + int ret; + char *id = NULL; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) + return false; + + ret = parse_id(id, pfx, name); + + free(id); + + if (!ret) + return false; + + return true; +} /* * Local Variables: diff -r ae4810e6764b -r 499034149a6b libxkutil/misc_util.h --- a/libxkutil/misc_util.h Thu Nov 15 09:49:47 2007 -0800 +++ b/libxkutil/misc_util.h Thu Nov 15 16:19:27 2007 -0800 @@ -89,6 +89,9 @@ char *association_prefix(const char *pro char *association_prefix(const char *provider_name); bool match_pn_to_cn(const char *pn, const char *cn); +int parse_id(char *id, char **pfx, char **name); +bool parse_instanceid(const CMPIObjectPath *ref, char **pfx, char **name); + #define ASSOC_MATCH(pn, cn) \ if (!match_pn_to_cn((pn), (cn))) { \ return (CMPIStatus){CMPI_RC_OK, NULL}; \ diff -r ae4810e6764b -r 499034149a6b src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Thu Nov 15 09:49:47 2007 -0800 +++ b/src/Virt_VSSDComponent.c Thu Nov 15 16:19:27 2007 -0800 @@ -41,10 +41,7 @@ static CMPIStatus vssd_to_rasd(const CMP struct inst_list *list) { CMPIStatus s; - char *id = NULL; - char *pfx = NULL; char *name = NULL; - int ret; int i = 0; int types[] = { CIM_RASD_TYPE_PROC, @@ -56,19 +53,10 @@ static CMPIStatus vssd_to_rasd(const CMP ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing InstanceID"); - goto out; - } - - ret = sscanf(id, "%a[^:]:%as", &pfx, &name); - if (ret != 2) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid InstanceID"); + if (!parse_instanceid(ref, NULL, &name)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get system name"); goto out; } @@ -83,8 +71,6 @@ static CMPIStatus vssd_to_rasd(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(id); - free(pfx); free(name); return s; From danms at us.ibm.com Fri Nov 16 00:18:41 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 15 Nov 2007 16:18:41 -0800 Subject: [Libvirt-cim] [PATCH] Add function to parse InstanceIDs In-Reply-To: <499034149a6bc4072ad7.1195172664@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Thu, 15 Nov 2007 16:24:24 -0700") References: <499034149a6bc4072ad7.1195172664@elm3b41.beaverton.ibm.com> Message-ID: <87sl37oxem.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1195172367 28800 KR> # Node ID 499034149a6bc4072ad76f06d107059613277d6a KR> # Parent ae4810e6764b1ea14df6f429eab972593e919e37 KR> Add function to parse InstanceIDs. Okay, I think we've beat this one to death enough. Applied :) Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 16 00:31:24 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 15 Nov 2007 16:31:24 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race In-Reply-To: References: Message-ID: <473CE4DC.7050308@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195154883 28800 > # Node ID ecc46606e90388217b94916c1eab2ceeb051064a > # Parent 670294145fcc1a786594f5110e2248cd4ec0b7ed > Initialize libvirt early so that we avoid the backend register race > > This fixes the errant behavior we see with parallel calls to > connect_by_classname(). This behavior was certainly possible with lv_connect(), > but I imagine we were getting lucky most of the time. > > Signed-off-by: Dan Smith > I was also seeing the same issue after applying the connect_by_classname(). I'm using Pegasus with forceProviderProcesses=true. I would see the issue the first call after restarting Pegasus. After applying this patch, I haven't seen the error. I've tried restarting Pegasus about 10 times, no error yet. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From lizg at cn.ibm.com Fri Nov 16 07:51:12 2007 From: lizg at cn.ibm.com (lizg at cn.ibm.com) Date: Fri, 16 Nov 2007 15:51:12 +0800 Subject: [Libvirt-cim] [PATCH] Add bridge network type Message-ID: # HG changeset patch # User Zhengang Li # Date 1195194642 -28800 # Node ID fcc119ccdfa54df6f6296d2174670042b7b6d75a # Parent 99988c7788133e216451cc0c1f3440260e996fbf Add bridge network type Signed-off-by: Zhengang Li diff -r 99988c778813 -r fcc119ccdfa5 src/Virt_Device.c --- a/src/Virt_Device.c Fri Nov 16 14:24:36 2007 +0800 +++ b/src/Virt_Device.c Fri Nov 16 14:30:42 2007 +0800 @@ -47,7 +47,8 @@ static int net_set_type(CMPIInstance *in { uint16_t cim_type; - if (STREQC(dev->type, "ethernet")) + if (STREQC(dev->type, "ethernet") || + STREQC(dev->type, "bridge")) cim_type = CIM_NET_ETHERNET; else cim_type = CIM_NET_UNKNOWN; From heidieck at linux.vnet.ibm.com Fri Nov 16 08:57:19 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 16 Nov 2007 10:57:19 +0200 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace Message-ID: <15cc86eee7e50fb5b6dd.1195207039@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195206999 -3600 # Node ID 15cc86eee7e50fb5b6dd648d519013327b8e8c57 # Parent c9e977e820e99070f0c0c0397061229f7382ac7b Add installation instructions for root/interop namespace Signed-off-by: Heidi Eckhart diff -r c9e977e820e9 -r 15cc86eee7e5 doc/libvirt-cim.html --- a/doc/libvirt-cim.html Wed Nov 14 13:06:06 2007 +0100 +++ b/doc/libvirt-cim.html Fri Nov 16 10:56:39 2007 +0100 @@ -76,6 +76,7 @@ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<

To install the schema in SFCB:

@@ -111,6 +112,23 @@ +//#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")
+//#pragma include ("Security/CIM_IPPacketFilterIndication.mof")
#pragma include ("Support/PRS_ActivityContact.mof")
+

+ +

cimv216-interop.mof is not part of the official DMTF + CIM v2.16 schema package. Please create with the folloing content: +

+ +

+#pragma locale ("en_US")
+#pragma include ("qualifiers.mof")
+#pragma include ("qualifiers_optional.mof")
+#pragma include ("Core/CIM_ManagedElement.mof")
+#pragma include ("Interop/CIM_RegisteredProfile.mof")
+#pragma include ("Interop/CIM_RegisteredSubProfile.mof")
+#pragma include ("Core/CIM_Dependency.mof")
+#pragma include ("Interop/CIM_ElementConformsToProfile.mof")
+#pragma include ("Interop/CIM_ReferencedProfile.mof")
+#pragma include ("Interop/CIM_SubProfileRequiresProfile.mof")

Platform Support

From heidieck at linux.vnet.ibm.com Fri Nov 16 10:12:03 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 16 Nov 2007 11:12:03 +0100 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: <473C62F2.5020601@linux.vnet.ibm.com> References: <937ed1f28893f71163de.1195117918@localhost.localdomain> <473C62F2.5020601@linux.vnet.ibm.com> Message-ID: <473D6CF3.2000500@linux.vnet.ibm.com> Jay Gagnon wrote: > I'm unfamiliar with the pragma include stuff so I can't comment on that, > but I think you've got an extra '<' character on the br tag here. Thanks - updated patch went out. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 16 12:55:54 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 16 Nov 2007 13:55:54 +0100 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race In-Reply-To: <473CE4DC.7050308@linux.vnet.ibm.com> References: <473CE4DC.7050308@linux.vnet.ibm.com> Message-ID: <473D935A.7030903@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> # HG changeset patch >> # User Dan Smith >> # Date 1195154883 28800 >> # Node ID ecc46606e90388217b94916c1eab2ceeb051064a >> # Parent 670294145fcc1a786594f5110e2248cd4ec0b7ed >> Initialize libvirt early so that we avoid the backend register race >> >> This fixes the errant behavior we see with parallel calls to >> connect_by_classname(). This behavior was certainly possible with >> lv_connect(), >> but I imagine we were getting lucky most of the time. >> >> Signed-off-by: Dan Smith >> > > I was also seeing the same issue after applying the > connect_by_classname(). I'm using Pegasus with > forceProviderProcesses=true. I would see the issue the first call > after restarting Pegasus. > After applying this patch, I haven't seen the error. I've tried > restarting Pegasus about 10 times, no error yet. :( ... I'm still getting this error and reproducible for each request (not only the first one) and each CIMOM (pegasus and sfcb). Both patches have been applied to the latest tree from repository. FC6, Centrino Duo, 32 bit sfcb 1.2.4, Pegasus tog-pegasus-2.5.2-2.fc6, libvirt-0.3.1-1.fc6, libxml2-2.6.29-1.fc6 But I found the reason for this: I do only have KVM on my machine and the error message is the result of the Xen_ComputerSystem request. A CIMOM does not have the possibility to return different return codes, meaning the error for Xen_ComputerSystem and the instances for KVM_ComputerSystem. In the case where one request returned with an error, this one is reported back to the client and all returned instances are revoked. The attached patch fixes this problem by adding debug messages instead of setting a FAILED status, when trying to connect to libvirt. The current implementation does also handle it like this, with the difference that an attempt to connect to libvirt is not necessary, as lv_connect already checks before, which hypervisor type is available. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: libvirt-init URL: From danms at us.ibm.com Fri Nov 16 14:28:07 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 06:28:07 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race In-Reply-To: <473D935A.7030903@linux.vnet.ibm.com> (Heidi Eckhart's message of "Fri, 16 Nov 2007 13:55:54 +0100") References: <473CE4DC.7050308@linux.vnet.ibm.com> <473D935A.7030903@linux.vnet.ibm.com> Message-ID: <87lk8y464o.fsf@theine.beaverton.ibm.com> HE> A CIMOM does not have the possibility to return different return HE> codes, meaning the error for Xen_ComputerSystem and the instances HE> for KVM_ComputerSystem. In the case where one request returned HE> with an error, this one is reported back to the client and all HE> returned instances are revoked. Ah, okay. It seems a little weird to solve this by not returning failure if you try to enumerate a class that can't possibly exist on a particular system. However, I'm not sure there is any reasonable way around this. I'll wrap this into my patch set with some other changes I think I need to make and re-submit to the list. Thanks Heidi! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 16 14:53:14 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 06:53:14 -0800 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: <15cc86eee7e50fb5b6dd.1195207039@localhost.localdomain> (Heidi Eckhart's message of "Fri, 16 Nov 2007 10:57:19 +0200") References: <15cc86eee7e50fb5b6dd.1195207039@localhost.localdomain> Message-ID: <87640244yt.fsf@theine.beaverton.ibm.com> HE> + $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<
I don't think this got updated correctly. I get this error when trying to build the web pages: > ../doc/libvirt-cim.html:79: HTML parser error : htmlParseStartTag: invalid element name > $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<< > ^ > Generating the Web pages After you make a change, just type "make" in the doc/ directory and it will regenerate and validate the pages. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 16 15:49:24 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 08:49:24 -0700 Subject: [Libvirt-cim] [PATCH] Make libcmpiutil spec include %{release} in BuildRoot Message-ID: <18403e085eaab25596f6.1195231764@theine> # HG changeset patch # User Dan Smith # Date 1195231755 28800 # Node ID 18403e085eaab25596f65d3273ad56befeb46463 # Parent dde4ae874d36a23fb3f4e1ec6ffea308aa0e7daa Make libcmpiutil spec include %{release} in BuildRoot Per the Fedora packaging guidelines. Signed-off-by: Dan Smith diff -r dde4ae874d36 -r 18403e085eaa libcmpiutil.spec.in --- a/libcmpiutil.spec.in Fri Nov 16 08:04:48 2007 -0800 +++ b/libcmpiutil.spec.in Fri Nov 16 08:49:15 2007 -0800 @@ -7,7 +7,7 @@ License: LGPL License: LGPL Group: Development/Libraries Source: libcmpiutil-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-root +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/CIM/ BuildRequires: tog-pegasus-devel BuildRequires: flex From kaitlin at linux.vnet.ibm.com Fri Nov 16 16:55:25 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 16 Nov 2007 08:55:25 -0800 Subject: [Libvirt-cim] [PATCH] Make libcmpiutil spec include %{release} in BuildRoot In-Reply-To: <18403e085eaab25596f6.1195231764@theine> References: <18403e085eaab25596f6.1195231764@theine> Message-ID: <473DCB7D.3070303@linux.vnet.ibm.com> Dan Smith wrote: > -BuildRoot: %{_tmppath}/%{name}-%{version}-root > +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root > This seems reasonable to me. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From veillard at redhat.com Fri Nov 16 17:08:17 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 16 Nov 2007 12:08:17 -0500 Subject: [Libvirt-cim] [PATCH] Make libcmpiutil spec include %{release} in BuildRoot In-Reply-To: <18403e085eaab25596f6.1195231764@theine> References: <18403e085eaab25596f6.1195231764@theine> Message-ID: <20071116170816.GB21441@redhat.com> On Fri, Nov 16, 2007 at 08:49:24AM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195231755 28800 > # Node ID 18403e085eaab25596f65d3273ad56befeb46463 > # Parent dde4ae874d36a23fb3f4e1ec6ffea308aa0e7daa > Make libcmpiutil spec include %{release} in BuildRoot > > Per the Fedora packaging guidelines. Oops +1, my bad :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Fri Nov 16 19:26:35 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 12:26:35 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] Changes to misc_utils.c for connect_by_classname() In-Reply-To: Message-ID: <86766ef3c2479a9a5f61.1195244795@theine> # HG changeset patch # User Dan Smith # Date 1195244698 28800 # Node ID 86766ef3c2479a9a5f6146e1865d94d17768a5a8 # Parent f6c11dd07703ae3f398592143b4fd31fc78f3a5d Changes to misc_utils.c for connect_by_classname() Includes Heidi's change to not return an error on failed connect. I chose to leave the failure in place if a proper URI could not be determined because this really means we were called for a prefix we don't support, which /is/ a problem. If we need to iterate over subclasses later down the road for differing CIMOM behavior, we should do it before we get here. Signed-off-by: Dan Smith diff -r f6c11dd07703 -r 86766ef3c247 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Fri Nov 16 12:24:53 2007 -0800 +++ b/libxkutil/misc_util.c Fri Nov 16 12:24:58 2007 -0800 @@ -56,6 +56,8 @@ virConnectPtr connect_by_classname(const const char *uri; virConnectPtr conn; + CMSetStatus(s, CMPI_RC_OK); + uri = cn_to_uri(classname); if (!uri) { CMSetStatusWithChars(broker, s, @@ -64,11 +66,11 @@ virConnectPtr connect_by_classname(const return NULL; } + CU_DEBUG("Connecting to libvirt with uri `%s'", uri); + conn = virConnectOpen(uri); if (!conn) { - CMSetStatusWithChars(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to connect to hypervisor"); + CU_DEBUG("Unable to connect to `%s'", uri); return NULL; } @@ -334,28 +336,21 @@ bool provider_is_responsible(const CMPIB const CMPIObjectPath *reference, CMPIStatus *status) { - const char *dft_pfx; char *pfx; - bool rc = false; + bool rc = true; CMSetStatus(status, CMPI_RC_OK); pfx = class_prefix_name(CLASSNAME(reference)); - if (STREQC(pfx, "CIM")) + if (STREQC(pfx, "CIM")) { cu_statusf(broker, status, CMPI_RC_ERR_FAILED, "Please exactly specify the class (check CIMOM behavior!): %s", CLASSNAME(reference)); - - dft_pfx = default_prefix(); - if (dft_pfx == NULL) - goto out; - - if (STREQC(pfx, dft_pfx)) - rc = true; - - out: + rc = false; + } + free(pfx); return rc; } From danms at us.ibm.com Fri Nov 16 19:26:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 12:26:34 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] Initialize libvirt at provider load In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195244693 28800 # Node ID f6c11dd07703ae3f398592143b4fd31fc78f3a5d # Parent bb9245e8f41c56ced574551677534f24071fa48d Initialize libvirt at provider load This defines a function in the utility librart that does the libvirt initialization, and could be extended to do anything else we need in the future. This replaces CMNoHook in all of the providers with a call to this function. This fixes the errant behavior we see with parallel calls to connect_by_classname(). This behavior was certainly possible with lv_connect(), but I imagine we were getting lucky most of the time. Also in this patch is a change to all non-association providers to use a #define for the provider name to avoid duplication and improve readability. I figured I'd make this cleanup while I was touching every MIStub in the tree. As a part of this, I fixed the provider name of VSMS, which means there is an associated schema change. Signed-off-by: Dan Smith diff -r bb9245e8f41c -r f6c11dd07703 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Fri Nov 16 10:22:13 2007 -0800 +++ b/libxkutil/misc_util.c Fri Nov 16 12:24:53 2007 -0800 @@ -421,6 +421,11 @@ bool parse_instanceid(const CMPIObjectPa return true; } +bool libvirt_cim_init(void) +{ + return virInitialize == 0; +} + /* * Local Variables: * mode: C diff -r bb9245e8f41c -r f6c11dd07703 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Fri Nov 16 10:22:13 2007 -0800 +++ b/libxkutil/misc_util.h Fri Nov 16 12:24:53 2007 -0800 @@ -92,6 +92,8 @@ int parse_id(char *id, char **pfx, char int parse_id(char *id, char **pfx, char **name); bool parse_instanceid(const CMPIObjectPath *ref, char **pfx, char **name); +bool libvirt_cim_init(void); + #define ASSOC_MATCH(pn, cn) \ if (!match_pn_to_cn((pn), (cn))) { \ return (CMPIStatus){CMPI_RC_OK, NULL}; \ diff -r bb9245e8f41c -r f6c11dd07703 schema/VirtualSystemManagementService.registration --- a/schema/VirtualSystemManagementService.registration Fri Nov 16 10:22:13 2007 -0800 +++ b/schema/VirtualSystemManagementService.registration Fri Nov 16 12:24:53 2007 -0800 @@ -1,4 +1,4 @@ # Copyright IBM Corp. 2007 # Classname Namespace ProviderName ProviderModule ProviderTypes -Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance -KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementService Virt_VirtualSystemManagementService method instance +Xen_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementServiceProvider Virt_VirtualSystemManagementService method instance +KVM_VirtualSystemManagementService root/virt Virt_VirtualSystemManagementServiceProvider Virt_VirtualSystemManagementService method instance diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_AllocationCapabilities.c Fri Nov 16 12:24:53 2007 -0800 @@ -30,6 +30,8 @@ #include "Virt_AllocationCapabilities.h" #include "Virt_RASD.h" + +#define PN Virt_AllocationCapabilitiesProvider const static CMPIBroker *_BROKER; @@ -103,12 +105,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_AllocationCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); -CMInstanceMIStub(, Virt_AllocationCapabilitiesProvider, _BROKER, - CMNoHook); +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ComputerSystem.c Fri Nov 16 12:24:53 2007 -0800 @@ -37,6 +37,8 @@ #include "Virt_ComputerSystem.h" +#define PN Virt_ComputerSystemProvider + const static CMPIBroker *_BROKER; enum CIM_state { @@ -684,11 +686,11 @@ static CMPIStatus state_change(CMPIMetho /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_ComputerSystemProvider_Create_InstanceMI(const CMPIBroker *, +PN_Create_InstanceMI(const CMPIBroker *, const CMPIContext *, CMPIStatus *rc); -CMInstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, CMNoHook); +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); static struct method_handler RequestStateChange = { .name = "RequestStateChange", @@ -704,11 +706,7 @@ static struct method_handler *my_handler NULL }; -STDIM_MethodMIStub(, - Virt_ComputerSystemProvider, - _BROKER, - CMNoHook, - my_handlers); +STDIM_MethodMIStub(, PN, _BROKER, libvirt_cim_init(), my_handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_Device.c --- a/src/Virt_Device.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_Device.c Fri Nov 16 12:24:53 2007 -0800 @@ -36,6 +36,8 @@ #include "Virt_Device.h" +#define PN Virt_DeviceProvider + #define CIM_NET_UNKNOWN 0 #define CIM_NET_ETHERNET 2 @@ -533,11 +535,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_DeviceProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_DeviceProvider, _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_DevicePool.c Fri Nov 16 12:24:53 2007 -0800 @@ -43,6 +43,8 @@ #include "Virt_DevicePool.h" #include "svpc_types.h" +#define PN Virt_DevicePoolProvider + static const CMPIBroker *_BROKER; char *device_pool_names[] = {"ProcessorPool", @@ -720,11 +722,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_DevicePoolProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_DevicePoolProvider, _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Fri Nov 16 12:24:53 2007 -0800 @@ -292,8 +292,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Fri Nov 16 12:24:53 2007 -0800 @@ -358,8 +358,8 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); -STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: * mode: C diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 16 12:24:53 2007 -0800 @@ -225,7 +225,7 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: * mode: C diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ElementSettingData.c Fri Nov 16 12:24:53 2007 -0800 @@ -147,8 +147,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 16 12:24:53 2007 -0800 @@ -31,6 +31,8 @@ #include "device_parsing.h" #include "Virt_EnabledLogicalElementCapabilities.h" + +#define PN Virt_EnabledLogicalElementCapabilities const static CMPIBroker *_BROKER; @@ -203,12 +205,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_EnabledLogicalElementCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_EnabledLogicalElementCapabilitiesProvider, _BROKER, - CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_HostSystem.c Fri Nov 16 12:24:53 2007 -0800 @@ -31,6 +31,8 @@ #include "misc_util.h" #include "Virt_HostSystem.h" + +#define PN Virt_HostSystem const static CMPIBroker *_BROKER; @@ -157,11 +159,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_HostSystemProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); -CMInstanceMIStub(, Virt_HostSystemProvider, _BROKER, CMNoHook); +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_HostedDependency.c Fri Nov 16 12:24:53 2007 -0800 @@ -150,7 +150,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Virt_HostedDependencyProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Virt_HostedDependencyProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Fri Nov 16 12:24:53 2007 -0800 @@ -151,7 +151,7 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Virt_HostedResourcePoolProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Virt_HostedResourcePoolProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_HostedService.c Fri Nov 16 12:24:53 2007 -0800 @@ -160,8 +160,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_RASD.c Fri Nov 16 12:24:53 2007 -0800 @@ -34,6 +34,8 @@ #include "Virt_RASD.h" #include "svpc_types.h" + +#define PN Virt_RASDProvider const static CMPIBroker *_BROKER; @@ -315,11 +317,11 @@ DEFAULT_EQ(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_RASDProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_RASDProvider, _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_RegisteredProfile.c Fri Nov 16 12:24:53 2007 -0800 @@ -35,6 +35,8 @@ #include "profiles.h" #include "Virt_RegisteredProfile.h" + +#define PN Virt_RegisteredProfileProvider const static CMPIBroker *_BROKER; @@ -188,11 +190,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_RegisteredProfileProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_RegisteredProfileProvider, _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Fri Nov 16 12:24:53 2007 -0800 @@ -277,8 +277,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ResourcePoolConfigurationCapabilities.c --- a/src/Virt_ResourcePoolConfigurationCapabilities.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationCapabilities.c Fri Nov 16 12:24:53 2007 -0800 @@ -29,6 +29,8 @@ #include "libcmpiutil.h" #include "misc_util.h" +#define PN Virt_ResourcePoolConfigurationCapabilitiesProvider + const static CMPIBroker *_BROKER; enum {CreateResourcePool = 2, @@ -38,6 +40,7 @@ enum {CreateResourcePool = RemoveResourcesFromResourcePool = 6, ChangeParentResourcePool = 7, }; + DEFAULT_CI(); DEFAULT_MI(); @@ -114,12 +117,11 @@ static CMPIStatus GetInstance(CMPIInstan /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_ResourcePoolConfigurationCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); -CMInstanceMIStub(, Virt_ResourcePoolConfigurationCapabilitiesProvider, _BROKER, - CMNoHook); +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationService.c Fri Nov 16 12:24:53 2007 -0800 @@ -30,6 +30,8 @@ #include "Virt_HostSystem.h" #include "Virt_ResourcePoolConfigurationService.h" +#define PN Virt_ResourcePoolConfigurationServiceProvider + const static CMPIBroker *_BROKER; static CMPIStatus dummy_handler(CMPIMethodMI *self, @@ -81,8 +83,7 @@ static struct method_handler *my_handler NULL, }; -STDIM_MethodMIStub(, Virt_ResourcePoolConfigurationServiceProvider, - _BROKER, CMNoHook, my_handlers); +STDIM_MethodMIStub(, PN, _BROKER, libvirt_cim_init(), my_handlers); DEFAULT_CI(); DEFAULT_MI(); @@ -204,12 +205,11 @@ static CMPIStatus EnumInstances(CMPIInst CMPIInstanceMI * -Virt_ResourcePoolConfigurationServiceProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_ResourcePoolConfigurationServiceProvider, - _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Fri Nov 16 12:24:53 2007 -0800 @@ -872,8 +872,8 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); -STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Fri Nov 16 12:24:53 2007 -0800 @@ -365,8 +365,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_SystemDevice.c Fri Nov 16 12:24:53 2007 -0800 @@ -265,8 +265,8 @@ static struct std_assoc *assoc_handlers[ NULL }; -STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, CMNoHook, assoc_handlers); -STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_VSSD.c Fri Nov 16 12:24:53 2007 -0800 @@ -34,6 +34,8 @@ #include "Virt_VSSD.h" +#define PN Virt_VSSDProvider + const static CMPIBroker *_BROKER; static int instance_from_dom(virDomainPtr dom, @@ -262,11 +264,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_VSSDProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_VSSDProvider, _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_VSSDComponent.c Fri Nov 16 12:24:53 2007 -0800 @@ -202,8 +202,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 16 12:24:53 2007 -0800 @@ -31,6 +31,8 @@ #include "device_parsing.h" #include "Virt_VirtualSystemManagementCapabilities.h" + +#define PN Virt_VirtualSystemManagementCapabilitiesProvider const static CMPIBroker *_BROKER; @@ -190,12 +192,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_VirtualSystemManagementCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_VirtualSystemManagementCapabilitiesProvider, _BROKER, - CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Nov 16 10:22:13 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Fri Nov 16 12:24:53 2007 -0800 @@ -48,6 +48,8 @@ #include "Virt_HostSystem.h" #include "svpc_types.h" +#define PN VirtualSystemManagementServiceProvider + const static CMPIBroker *_BROKER; enum ResourceAction { @@ -1019,8 +1021,7 @@ static struct method_handler *my_handler NULL, }; -STDIM_MethodMIStub(, Virt_VirtualSystemManagementService, - _BROKER, CMNoHook, my_handlers); +STDIM_MethodMIStub(, PN, _BROKER, libvirt_cim_init(), my_handlers); CMPIStatus get_vsms(const CMPIObjectPath *reference, CMPIInstance **_inst, @@ -1152,11 +1153,11 @@ DEFAULT_INST_CLEANUP(); /* Avoid a warning in the stub macro below */ CMPIInstanceMI * -Virt_VirtualSystemManagementService_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_VirtualSystemManagementService, _BROKER, CMNoHook); +PN_Create_InstanceMI(const CMPIBroker *, + const CMPIContext *, + CMPIStatus *rc); + +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); /* From danms at us.ibm.com Fri Nov 16 19:26:36 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 12:26:36 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Transition back to connect_by_classname() In-Reply-To: Message-ID: <5ccd8aa18359f59d02f6.1195244796@theine> # HG changeset patch # User Dan Smith # Date 1195244699 28800 # Node ID 5ccd8aa18359f59d02f664ec9ebd9f07b422a698 # Parent 86766ef3c2479a9a5f6146e1865d94d17768a5a8 Transition back to connect_by_classname() This patch contains the previously-discussed changes to ComputerSystem and SystemDevice (including Heidi's change to remove provider_is_responsible()). If this looks okay to people, then I'll start in on provider-by-provider conversions. Previously, we used the incoming reference for all operations to determine the URI to pass to libvirt during a connect operation. For some reason, we transitioned away from that to a detection-based mechanism, which would not support multiple technologies to be managed from the provider simultaneously. I think that we have enough other infrastructure in place now that this is no longer a problem. As a test, I offer this patch with a few key instances of lv_connect() replaced with connect_by_classname() for discussion. I have tested that enumeration of Xen_ComputerSystem, KVM_ComputerSystem, and CIM_ComputerSystem are exclusive, and do not return any duplicate results. Further, I have confirmed that resolving Xen_SystemDevice against a KVM_ComputerSystem instance does not work, and that no duplicate results are returned in the case of CIM_SystemDevice. Signed-off-by: Dan Smith diff -r 86766ef3c247 -r 5ccd8aa18359 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 16 12:24:58 2007 -0800 +++ b/src/Virt_ComputerSystem.c Fri Nov 16 12:24:59 2007 -0800 @@ -345,10 +345,7 @@ static CMPIStatus return_enum_domains(co virConnectPtr conn = NULL; int ret; - if (!provider_is_responsible(_BROKER, reference, &s)) - return s; - - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -388,7 +385,7 @@ static CMPIStatus get_domain(const CMPIO return s; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -611,7 +608,7 @@ static CMPIStatus __state_change(char *n virDomainPtr dom = NULL; virDomainInfo info; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; diff -r 86766ef3c247 -r 5ccd8aa18359 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Fri Nov 16 12:24:58 2007 -0800 +++ b/src/Virt_SystemDevice.c Fri Nov 16 12:24:59 2007 -0800 @@ -61,6 +61,7 @@ static int get_dom_devices(const char *n static int get_dom_devices(const char *name, struct inst_list *list, int type, + const char *host_cn, const char *ns) { virConnectPtr conn = NULL; @@ -68,7 +69,7 @@ static int get_dom_devices(const char *n CMPIStatus s; int ret = 0; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -87,17 +88,19 @@ static int get_dom_devices(const char *n static int get_all_devices(const char *name, struct inst_list *list, - char *ns) + const char *host_cn, + const char *ns) { int i; for (i = 0; i < DEV_TYPE_COUNT; i++) - get_dom_devices(name, list, device_types[i], ns); + get_dom_devices(name, list, device_types[i], host_cn, ns); return i; } static CMPIInstance *host_instance(char *name, + const char *host_cn, const char *ns) { CMPIInstance *inst = NULL; @@ -114,7 +117,7 @@ static CMPIInstance *host_instance(char if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -173,9 +176,16 @@ static CMPIStatus sys_to_dev(const CMPIO type = device_type_from_classname(info->result_class); - ret = get_dom_devices(host, list, type, NAMESPACE(ref)); + ret = get_dom_devices(host, + list, + type, + CLASSNAME(ref), + NAMESPACE(ref)); } else { - ret = get_all_devices(host, list, NAMESPACE(ref)); + ret = get_all_devices(host, + list, + CLASSNAME(ref), + NAMESPACE(ref)); } if (ret >= 0) { @@ -218,6 +228,7 @@ static CMPIStatus dev_to_sys(const CMPIO } sys = host_instance(host, + CLASSNAME(ref), NAMESPACE(ref)); if (sys == NULL) From danms at us.ibm.com Fri Nov 16 19:26:33 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 12:26:33 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Transition back to connect_by_classname() Message-ID: A more formal version of the last set, this time as a proposed change instead of an RFC. Some testing of the first patch would be good to make sure that I didn't change a provider name to be incongruent with what is in the registration files. From kaitlin at linux.vnet.ibm.com Fri Nov 16 21:35:45 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 16 Nov 2007 13:35:45 -0800 Subject: [Libvirt-cim] [PATCH 0 of 3] Transition back to connect_by_classname() In-Reply-To: References: Message-ID: <473E0D31.5080006@linux.vnet.ibm.com> Dan Smith wrote: > A more formal version of the last set, this time as a proposed change > instead of an RFC. Some testing of the first patch would be good to make > sure that I didn't change a provider name to be incongruent with what is > in the registration files. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > I think this set looks good - using the libvirt_cim_init() call is a nice way to handle this. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 16 21:31:37 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 14:31:37 -0700 Subject: [Libvirt-cim] [PATCH] Fix up the src/Makefile.am to support parallel builds Message-ID: <4fa05e74894807d8fa5e.1195252297@theine> # HG changeset patch # User Dan Smith # Date 1195252274 28800 # Node ID 4fa05e74894807d8fa5e76f8dda6aad9b31ddd2b # Parent 5ccd8aa18359f59d02f664ec9ebd9f07b422a698 Fix up the src/Makefile.am to support parallel builds Fedora packaging guidelines suggest using parallel make where possible, and we were pretty broken in that regard. Signed-off-by: Dan Smith diff -r 5ccd8aa18359 -r 4fa05e748948 src/Makefile.am --- a/src/Makefile.am Fri Nov 16 12:24:59 2007 -0800 +++ b/src/Makefile.am Fri Nov 16 14:31:14 2007 -0800 @@ -55,68 +55,84 @@ libVirt_ComputerSystem_la_SOURCES = Virt libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c libVirt_Device_la_SOURCES = Virt_Device.c +libVirt_ComputerSystemIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemIndication_la_SOURCES = Virt_ComputerSystemIndication.c libVirt_ComputerSystemIndication_la_LIBADD = -lVirt_ComputerSystem -lpthread -lrt +libVirt_VirtualSystemManagementService_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_ComputerSystemIndication.la libVirt_RASD.la libVirt_HostSystem.la libVirt_VirtualSystemManagementService_la_SOURCES = Virt_VirtualSystemManagementService.c libVirt_VirtualSystemManagementService_la_LIBADD = -lVirt_ComputerSystem -lVirt_ComputerSystemIndication -lVirt_RASD -lVirt_HostSystem libVirt_VirtualSystemManagementCapabilities_la_SOURCES = Virt_VirtualSystemManagementCapabilities.c +libVirt_SystemDevice_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_Device.la libVirt_SystemDevice_la_SOURCES = Virt_SystemDevice.c libVirt_SystemDevice_la_LIBADD = -lVirt_ComputerSystem -lVirt_Device libVirt_VSSD_la_SOURCES = Virt_VSSD.c libVirt_HostSystem_la_SOURCES = Virt_HostSystem.c +libVirt_HostedDependency_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_HostedDependency_la_SOURCES = Virt_HostedDependency.c libVirt_HostedDependency_la_LIBADD = -lVirt_ComputerSystem -lVirt_HostSystem libVirt_DevicePool_la_SOURCES = Virt_DevicePool.c +libVirt_ElementConformsToProfile_la_DEPENDENCIES = libVirt_RegisteredProfile.la libVirt_ElementConformsToProfile_la_SOURCES = Virt_ElementConformsToProfile.c libVirt_ElementConformsToProfile_la_LIBADD = -lVirt_RegisteredProfile libVirt_EnabledLogicalElementCapabilities_la_SOURCES = Virt_EnabledLogicalElementCapabilities.c +libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_ElementCapabilities_la_SOURCES = Virt_ElementCapabilities.c libVirt_ElementCapabilities_la_LIBADD = -lVirt_VirtualSystemManagementCapabilities \ -lVirt_EnabledLogicalElementCapabilities \ -lVirt_ComputerSystem \ -lVirt_HostSystem +libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD +libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c libVirt_SettingsDefineCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool libVirt_RegisteredProfile_la_SOURCES = Virt_RegisteredProfile.c +libVirt_HostedResourcePool_la_DEPENDENCIES = libVirt_DevicePool.la libVirt_HostSystem.la libVirt_HostedResourcePool_la_SOURCES = Virt_HostedResourcePool.c libVirt_HostedResourcePool_la_LIBADD = -lVirt_DevicePool -lVirt_HostSystem libVirt_RASD_la_SOURCES = Virt_RASD.c +libVirt_ResourcePoolConfigurationService_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_ResourcePoolConfigurationService_la_SOURCES = Virt_ResourcePoolConfigurationService.c libVirt_ResourcePoolConfigurationService_la_LIBADD = -lVirt_HostSystem libVirt_ResourcePoolConfigurationCapabilities_la_SOURCES = Virt_ResourcePoolConfigurationCapabilities.c +libVirt_VSSDComponent_la_DEPENDENCIES = libVirt_VSSD.la libVirt_RASD.la libVirt_VSSDComponent_la_SOURCES = Virt_VSSDComponent.c libVirt_VSSDComponent_la_LIBADD = -lVirt_VSSD -lVirt_RASD +libVirt_SettingsDefineState_la_DEPENDENCIES = libVirt_Device.la libVirt_RASD.la libVirt_VSSD.la libVirt_ComputerSystem.la libVirt_SettingsDefineState_la_SOURCES = Virt_SettingsDefineState.c libVirt_SettingsDefineState_la_LIBADD = -lVirt_Device -lVirt_RASD -lVirt_VSSD -lVirt_ComputerSystem +libVirt_ResourceAllocationFromPool_la_DEPENDENCIES = libVirt_DevicePool.la libVirt_RASD.la libVirt_ResourceAllocationFromPool_la_SOURCES = Virt_ResourceAllocationFromPool.c libVirt_ResourceAllocationFromPool_la_LIBADD = -lVirt_DevicePool -lVirt_RASD +libVirt_ElementAllocatedFromPool_la_DEPENDENCIES = libVirt_DevicePool.la libVirt_Device.la libVirt_ElementAllocatedFromPool_la_SOURCES = Virt_ElementAllocatedFromPool.c libVirt_ElementAllocatedFromPool_la_LIBADD = -lVirt_DevicePool -lVirt_Device +libVirt_HostedService_la_DEPENDENCIES = libVirt_VirtualSystemManagementService.la libVirt_ResourcePoolConfigurationService.la libVirt_HostedService_la_SOURCES = Virt_HostedService.c libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService +libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD From kaitlin at linux.vnet.ibm.com Fri Nov 16 21:57:27 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 16 Nov 2007 14:57:27 -0700 Subject: [Libvirt-cim] [PATCH] Add ASSOC_MATCH() to HostedService to prevent duplicate classes from being returned if CIM_HostedService is used as the association class option during an association related query Message-ID: <92c1de7f036cf77048be.1195253847@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195253640 28800 # Node ID 92c1de7f036cf77048be756ddc79c0b2fd88b79e # Parent 006c7d27c968fb509fc667f4d5513cd79a9c197a Add ASSOC_MATCH() to HostedService to prevent duplicate classes from being returned if CIM_HostedService is used as the association class option during an association related query. Signed-off-by: Kaitlin Rupert diff -r 006c7d27c968 -r 92c1de7f036c src/Virt_HostedService.c --- a/src/Virt_HostedService.c Thu Nov 15 09:49:45 2007 -0800 +++ b/src/Virt_HostedService.c Fri Nov 16 14:54:00 2007 -0800 @@ -43,6 +43,8 @@ static CMPIStatus service_to_host(const CMPIStatus s; CMPIInstance *instance; + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + s = get_host_cs(_BROKER, ref, &instance); if (s.rc == CMPI_RC_OK) inst_list_add(list, instance); @@ -56,6 +58,8 @@ static CMPIStatus host_to_service(const { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); s = rpcs_instance(ref, &inst, _BROKER); if (s.rc != CMPI_RC_OK) From danms at us.ibm.com Fri Nov 16 22:46:59 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 16 Nov 2007 14:46:59 -0800 Subject: [Libvirt-cim] [PATCH] Add ASSOC_MATCH() to HostedService to prevent duplicate classes from being returned if CIM_HostedService is used as the association class option during an association related query In-Reply-To: <92c1de7f036cf77048be.1195253847@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Fri, 16 Nov 2007 14:57:27 -0700") References: <92c1de7f036cf77048be.1195253847@elm3b41.beaverton.ibm.com> Message-ID: <87mytd3j18.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1195253640 28800 KR> # Node ID 92c1de7f036cf77048be756ddc79c0b2fd88b79e KR> # Parent 006c7d27c968fb509fc667f4d5513cd79a9c197a KR> Add ASSOC_MATCH() to HostedService to prevent duplicate classes KR> from being returned if CIM_HostedService is used as the KR> association class option during an association related query. Applied, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Sat Nov 17 22:12:51 2007 From: veillard at redhat.com (Daniel Veillard) Date: Sat, 17 Nov 2007 17:12:51 -0500 Subject: [Libvirt-cim] [PATCH] Fix up the src/Makefile.am to support parallel builds In-Reply-To: <4fa05e74894807d8fa5e.1195252297@theine> References: <4fa05e74894807d8fa5e.1195252297@theine> Message-ID: <20071117221251.GB12832@redhat.com> On Fri, Nov 16, 2007 at 02:31:37PM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195252274 28800 > # Node ID 4fa05e74894807d8fa5e76f8dda6aad9b31ddd2b > # Parent 5ccd8aa18359f59d02f664ec9ebd9f07b422a698 > Fix up the src/Makefile.am to support parallel builds > > Fedora packaging guidelines suggest using parallel make where possible, > and we were pretty broken in that regard. yes looks fine to me +1, I must admit I never use make -j Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From heidieck at linux.vnet.ibm.com Mon Nov 19 10:28:28 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 19 Nov 2007 12:28:28 +0200 Subject: [Libvirt-cim] [PATCH] Add STD_InstanceMIStub to avoid warnings during compile time Message-ID: <4a0c7a2052a8da406217.1195471708@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195471122 -3600 # Node ID 4a0c7a2052a8da4062177a29d5bd02c6b5a551d1 # Parent 18403e085eaab25596f65d3273ad56befeb46463 Add STD_InstanceMIStub to avoid warnings during compile time Signed-off-by: Heidi Eckhart diff -r 18403e085eaa -r 4a0c7a2052a8 libcmpiutil.h --- a/libcmpiutil.h Fri Nov 16 08:49:15 2007 -0800 +++ b/libcmpiutil.h Mon Nov 19 12:18:42 2007 +0100 @@ -464,6 +464,52 @@ const char *cu_compare_ref(const CMPIObj const CMPIContext *ctx) \ { return; } +/** + * Generates the function table and initialization stub for an + * instance provider. + * @param pfx The prefix for all mandatory association provider + * functions. + * @param pn The provider name under which this provider is + * registered. + * @param broker The CMPIBroker pointer. + * @param hook Perform additional initialization functions. + * @return The function table of this instance provider. + */ +#define STD_InstanceMIStub(pfx, pn, broker, hook) \ + static CMPIInstanceMIFT instMIFT__={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ + "instance" #pn, \ + pfx##Cleanup, \ + pfx##EnumInstanceNames, \ + pfx##EnumInstances, \ + pfx##GetInstance, \ + pfx##CreateInstance, \ + pfx##ModifyInstance, \ + pfx##DeleteInstance, \ + pfx##ExecQuery, \ + }; \ + \ + CMPIInstanceMI * \ + pn##_Create_InstanceMI(const CMPIBroker *, \ + const CMPIContext *, \ + CMPIStatus *rc); \ + \ + \ + CMPI_EXTERN_C \ + CMPIInstanceMI* pn##_Create_InstanceMI(const CMPIBroker* brkr, \ + const CMPIContext *ctx, \ + CMPIStatus *rc) \ + { \ + static CMPIInstanceMI mi={ \ + NULL, \ + &instMIFT__, \ + }; \ + broker=brkr; \ + hook; \ + return &mi; \ + } + #endif /* From heidieck at linux.vnet.ibm.com Mon Nov 19 11:53:22 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 19 Nov 2007 12:53:22 +0100 Subject: [Libvirt-cim] [PATCH 1 of 3] Initialize libvirt at provider load In-Reply-To: References: Message-ID: <47417932.7040004@linux.vnet.ibm.com> Dan Smith wrote: > This defines a function in the utility librart that does the libvirt > initialization, and could be extended to do anything else we need in the > future. This replaces CMNoHook in all of the providers with a call to > this function. > Great :). > Also in this patch is a change to all non-association providers to use > a #define for the provider name to avoid duplication and improve > readability. I figured I'd make this cleanup while I was touching every > MIStub in the tree. > With sfcb and the #define approach the following error is thrown: *** Inconsistent provider registration for Virt_ComputerSystemProvider (2) This is caused by a non-resolved PN variable. PN is taken as "PN" and not resolved to the string as in the #define. +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); I do not have that many experiences with macros, but the PN approach did not work for me, no matter in how many different ways I tried it. PN was not resolved to the string defined at the beginning of the provider. So I had to switch back to -CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); +CMInstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, libvirt_cim_init()); Maybe someone else has some more experiences here and knows a solution ? On the other hand, I sent out a patch to libcmpiutil some minutes ago, which adds a STD_InstanceMIStub macro to libcmpiutil.h . This macro avoids now the warning in the original stub macro, which removes the responsibility from each provider to define it by itself. The patches below show the difference (first one is yours with PN approach, second one is removing the PN approach and using STD_InstanceMIStub macro). Now that you touched each MI stub, this might also be a good point in time to resolve this (now very old ;) ... sorry for my delay) problem. > diff -r bb9245e8f41c -r f6c11dd07703 src/Virt_ComputerSystem.c > --- a/src/Virt_ComputerSystem.c Fri Nov 16 10:22:13 2007 -0800 > +++ b/src/Virt_ComputerSystem.c Fri Nov 16 12:24:53 2007 -0800 > @@ -37,6 +37,8 @@ > > #include "Virt_ComputerSystem.h" > > +#define PN Virt_ComputerSystemProvider > + > const static CMPIBroker *_BROKER; > > enum CIM_state { > @@ -684,11 +686,11 @@ static CMPIStatus state_change(CMPIMetho > > /* Avoid a warning in the stub macro below */ > CMPIInstanceMI * > -Virt_ComputerSystemProvider_Create_InstanceMI(const CMPIBroker *, > +PN_Create_InstanceMI(const CMPIBroker *, > const CMPIContext *, > CMPIStatus *rc); > > -CMInstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, CMNoHook); > +CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); > > static struct method_handler RequestStateChange = { > .name = "RequestStateChange", > @@ -704,11 +706,7 @@ static struct method_handler *my_handler > NULL > }; > > -STDIM_MethodMIStub(, > - Virt_ComputerSystemProvider, > - _BROKER, > - CMNoHook, > - my_handlers); > +STDIM_MethodMIStub(, PN, _BROKER, libvirt_cim_init(), my_handlers); > > /* > * Local Variables: > > diff -r 599292e408aa src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 16 12:24:59 2007 -0800 +++ b/src/Virt_ComputerSystem.c Mon Nov 19 12:41:48 2007 +0100 @@ -37,8 +37,6 @@ #include "Virt_ComputerSystem.h" -#define PN Virt_ComputerSystemProvider - const static CMPIBroker *_BROKER; enum CIM_state { @@ -681,13 +679,7 @@ static CMPIStatus state_change(CMPIMetho return s; } -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -PN_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, PN, _BROKER, libvirt_cim_init()); +STD_InstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, libvirt_cim_init()); static struct method_handler RequestStateChange = { .name = "RequestStateChange", @@ -703,7 +695,7 @@ static struct method_handler *my_handler NULL }; -STDIM_MethodMIStub(, PN, _BROKER, libvirt_cim_init(), my_handlers); +STDIM_MethodMIStub(, Virt_ComputerSystemProvider, _BROKER, libvirt_cim_init(), my_handlers); /* * Local Variables: -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Mon Nov 19 12:19:32 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 19 Nov 2007 13:19:32 +0100 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race In-Reply-To: <87lk8y464o.fsf@theine.beaverton.ibm.com> References: <473CE4DC.7050308@linux.vnet.ibm.com> <473D935A.7030903@linux.vnet.ibm.com> <87lk8y464o.fsf@theine.beaverton.ibm.com> Message-ID: <47417F54.106@linux.vnet.ibm.com> Dan Smith wrote: > HE> A CIMOM does not have the possibility to return different return > HE> codes, meaning the error for Xen_ComputerSystem and the instances > HE> for KVM_ComputerSystem. In the case where one request returned > HE> with an error, this one is reported back to the client and all > HE> returned instances are revoked. > > Ah, okay. It seems a little weird to solve this by not returning > failure if you try to enumerate a class that can't possibly exist on a > particular system. That's how the providers also behave with the lv_connect() approach. > However, I'm not sure there is any reasonable way > around this. > The question a client is asking is - are there instances of Xen_ComputerSystems on this machine. If there are none, than a result of 0 instances is valid. If the client is interested in the question "why there are none", then he has to ask the VirtualSystemManagementService, if Xen is running or not. If Xen is not running on this machine, then also here no instance for Xen is returned. Then the client knows, that Xen is not available on this machine and all requests against Xen classes will return 0 instances. If VirtualSystemManagementService returns an instance for Xen, then the client knows, that currently no Xen_ComputerSystems are defined, but he can work on this machine to create one/some Xen instances. So the question for a provider is - are there instances of the class I'm responsible for or not ? This one is answered with yes (returning instances) or no (returning no instances). The reason why there are no instances, is resolved by the client itself with the evaluation of the model for existing and non-existing instances. This means for the provider programmer that he has to tolerate a - at a first view - light-weight error reporting. To answer your question - no, there is no reasonable way around this ;). Its the clients responsibility to traverse and interpret the model and instances. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Mon Nov 19 14:32:37 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 06:32:37 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Initialize libvirt early so that we avoid the backend register race References: <473CE4DC.7050308@linux.vnet.ibm.com> <473D935A.7030903@linux.vnet.ibm.com> <87lk8y464o.fsf@theine.beaverton.ibm.com> <47417F54.106@linux.vnet.ibm.com> Message-ID: <878x4u2tmi.fsf@theine.beaverton.ibm.com> HE> If there are none, than a result of 0 instances is valid. If the HE> client is interested in the question "why there are none", then he HE> has to ask the VirtualSystemManagementService, if Xen is running HE> or not. Okay, then I guess we can go forward with converting the rest of the classes as long as we mimic this behavior elsewhere. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 15:13:17 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 07:13:17 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Initialize libvirt at provider load In-Reply-To: <47417932.7040004@linux.vnet.ibm.com> (Heidi Eckhart's message of "Mon, 19 Nov 2007 12:53:22 +0100") References: <47417932.7040004@linux.vnet.ibm.com> Message-ID: <874pfi2rqq.fsf@theine.beaverton.ibm.com> HE> This is caused by a non-resolved PN variable. PN is taken as "PN" HE> and not resolved to the string as in the #define. Yes, I just looked at the CPP output and I see that it's not correct. I have tried a bit, but I can't get the existing MIStub macros to behave like I want, since they assume that their "provider name" parameter is not a CPP macro :( ... HE> On the other hand, I sent out a patch to libcmpiutil some minutes HE> ago, which adds a STD_InstanceMIStub macro to libcmpiutil.h . This HE> macro avoids now the warning in the original stub macro, which HE> removes the responsibility from each provider to define it by HE> itself. The patches below show the difference (first one is yours HE> with PN approach, second one is removing the PN approach and using HE> STD_InstanceMIStub macro). Yeah, my goal with this was not to simply merge the name in the prototype and the macro, but rather to unify the name used for provider with multiple MIStub calls. If someone updates these in the future, they could update one and not the other and break things. However, I don't see an easy way around this. HE> Now that you touched each MI stub, this might also be a good point HE> in time to resolve this (now very old ;) ... sorry for my delay) HE> problem. Yeah, I can apply and re-roll this patch with just the required libvirt initialization and changes to use your updated macro. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 15:15:57 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 07:15:57 -0800 Subject: [Libvirt-cim] [PATCH] Add STD_InstanceMIStub to avoid warnings during compile time In-Reply-To: <4a0c7a2052a8da406217.1195471708@localhost.localdomain> (Heidi Eckhart's message of "Mon, 19 Nov 2007 12:28:28 +0200") References: <4a0c7a2052a8da406217.1195471708@localhost.localdomain> Message-ID: <87zlxa1d1u.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1195471122 -3600 HE> # Node ID 4a0c7a2052a8da4062177a29d5bd02c6b5a551d1 HE> # Parent 18403e085eaab25596f65d3273ad56befeb46463 HE> Add STD_InstanceMIStub to avoid warnings during compile time HE> Signed-off-by: Heidi Eckhart HE> libcmpiutil.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ HE> 1 file changed, 46 insertions(+) Actually, can we put this in a std_instance.h like the rest of them? I'll include this change in front of my updated patch set for comments. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 15:01:13 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 08:01:13 -0700 Subject: [Libvirt-cim] [PATCH] Add std_instance.h with updated MIStub macro Message-ID: <25497386647b6e757ed5.1195488073@theine> # HG changeset patch # User Dan Smith # Date 1195488042 28800 # Node ID 25497386647b6e757ed5c8893f2a4c648543829b # Parent 18403e085eaab25596f65d3273ad56befeb46463 Add std_instance.h with updated MIStub macro Signed-off-by: Heidi Eckhart Signed-off-by: Dan Smith diff -r 18403e085eaa -r 25497386647b Makefile.am --- a/Makefile.am Fri Nov 16 08:49:15 2007 -0800 +++ b/Makefile.am Mon Nov 19 08:00:42 2007 -0800 @@ -13,7 +13,8 @@ libcmpiutilinc_HEADERS = libcmpiutil.h \ libcmpiutilinc_HEADERS = libcmpiutil.h \ std_invokemethod.h \ std_association.h \ - std_indication.h + std_indication.h \ + std_instance.h libcmpiutil_la_SOURCES = args_util.c instance_util.c std_invokemethod.c \ std_association.c inst_list.c std_indication.c \ diff -r 18403e085eaa -r 25497386647b std_instance.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/std_instance.h Mon Nov 19 08:00:42 2007 -0800 @@ -0,0 +1,72 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Heidi Eckhart + * Dan Smith + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __STD_INSTANCE_H +#define __STD_INSTANCE_H + +/** + * Generates the function table and initialization stub for an + * instance provider. + * @param pfx The prefix for all mandatory association provider + * functions. + * @param pn The provider name under which this provider is + * registered. + * @param broker The CMPIBroker pointer. + * @param hook Perform additional initialization functions. + * @return The function table of this instance provider. + */ +#define STD_InstanceMIStub(pfx, pn, broker, hook) \ + static CMPIInstanceMIFT instMIFT__={ \ + CMPICurrentVersion, \ + CMPICurrentVersion, \ + "instance" #pn, \ + pfx##Cleanup, \ + pfx##EnumInstanceNames, \ + pfx##EnumInstances, \ + pfx##GetInstance, \ + pfx##CreateInstance, \ + pfx##ModifyInstance, \ + pfx##DeleteInstance, \ + pfx##ExecQuery, \ + }; \ + \ + CMPIInstanceMI * \ + pn##_Create_InstanceMI(const CMPIBroker *, \ + const CMPIContext *, \ + CMPIStatus *rc); \ + \ + \ + CMPI_EXTERN_C \ + CMPIInstanceMI* pn##_Create_InstanceMI(const CMPIBroker* brkr, \ + const CMPIContext *ctx, \ + CMPIStatus *rc) \ + { \ + static CMPIInstanceMI mi={ \ + NULL, \ + &instMIFT__, \ + }; \ + broker=brkr; \ + hook; \ + return &mi; \ + } + + #endif From danms at us.ibm.com Mon Nov 19 15:19:35 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 08:19:35 -0700 Subject: [Libvirt-cim] [PATCH 4 of 4] Transition back to connect_by_classname() In-Reply-To: Message-ID: <66f0dde5f3fd81a495a1.1195489175@theine> # HG changeset patch # User Dan Smith # Date 1195488003 28800 # Node ID 66f0dde5f3fd81a495a1597033e180e251817054 # Parent ef1552498688b0892f2c8d65c238da1d4a765e9c Transition back to connect_by_classname() This patch contains the previously-discussed changes to ComputerSystem and SystemDevice (including Heidi's change to remove provider_is_responsible()). If this looks okay to people, then I'll start in on provider-by-provider conversions. Previously, we used the incoming reference for all operations to determine the URI to pass to libvirt during a connect operation. For some reason, we transitioned away from that to a detection-based mechanism, which would not support multiple technologies to be managed from the provider simultaneously. I think that we have enough other infrastructure in place now that this is no longer a problem. As a test, I offer this patch with a few key instances of lv_connect() replaced with connect_by_classname() for discussion. I have tested that enumeration of Xen_ComputerSystem, KVM_ComputerSystem, and CIM_ComputerSystem are exclusive, and do not return any duplicate results. Further, I have confirmed that resolving Xen_SystemDevice against a KVM_ComputerSystem instance does not work, and that no duplicate results are returned in the case of CIM_SystemDevice. Signed-off-by: Dan Smith diff -r ef1552498688 -r 66f0dde5f3fd src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Nov 19 07:59:54 2007 -0800 +++ b/src/Virt_ComputerSystem.c Mon Nov 19 08:00:03 2007 -0800 @@ -344,10 +344,7 @@ static CMPIStatus return_enum_domains(co virConnectPtr conn = NULL; int ret; - if (!provider_is_responsible(_BROKER, reference, &s)) - return s; - - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -387,7 +384,7 @@ static CMPIStatus get_domain(const CMPIO return s; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) return s; @@ -610,7 +607,7 @@ static CMPIStatus __state_change(char *n virDomainPtr dom = NULL; virDomainInfo info; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; diff -r ef1552498688 -r 66f0dde5f3fd src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Mon Nov 19 07:59:54 2007 -0800 +++ b/src/Virt_SystemDevice.c Mon Nov 19 08:00:03 2007 -0800 @@ -61,6 +61,7 @@ static int get_dom_devices(const char *n static int get_dom_devices(const char *name, struct inst_list *list, int type, + const char *host_cn, const char *ns) { virConnectPtr conn = NULL; @@ -68,7 +69,7 @@ static int get_dom_devices(const char *n CMPIStatus s; int ret = 0; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -87,17 +88,19 @@ static int get_dom_devices(const char *n static int get_all_devices(const char *name, struct inst_list *list, - char *ns) + const char *host_cn, + const char *ns) { int i; for (i = 0; i < DEV_TYPE_COUNT; i++) - get_dom_devices(name, list, device_types[i], ns); + get_dom_devices(name, list, device_types[i], host_cn, ns); return i; } static CMPIInstance *host_instance(char *name, + const char *host_cn, const char *ns) { CMPIInstance *inst = NULL; @@ -114,7 +117,7 @@ static CMPIInstance *host_instance(char if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, host_cn, &s); if (conn == NULL) goto out; @@ -173,9 +176,16 @@ static CMPIStatus sys_to_dev(const CMPIO type = device_type_from_classname(info->result_class); - ret = get_dom_devices(host, list, type, NAMESPACE(ref)); + ret = get_dom_devices(host, + list, + type, + CLASSNAME(ref), + NAMESPACE(ref)); } else { - ret = get_all_devices(host, list, NAMESPACE(ref)); + ret = get_all_devices(host, + list, + CLASSNAME(ref), + NAMESPACE(ref)); } if (ret >= 0) { @@ -218,6 +228,7 @@ static CMPIStatus dev_to_sys(const CMPIO } sys = host_instance(host, + CLASSNAME(ref), NAMESPACE(ref)); if (sys == NULL) From danms at us.ibm.com Mon Nov 19 15:19:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 08:19:34 -0700 Subject: [Libvirt-cim] [PATCH 3 of 4] Changes to misc_utils.c for connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195487994 28800 # Node ID ef1552498688b0892f2c8d65c238da1d4a765e9c # Parent b9d3217689a1335a1a1c2eded1f52ad36f91e978 Changes to misc_utils.c for connect_by_classname() Includes Heidi's change to not return an error on failed connect. I chose to leave the failure in place if a proper URI could not be determined because this really means we were called for a prefix we don't support, which /is/ a problem. If we need to iterate over subclasses later down the road for differing CIMOM behavior, we should do it before we get here. Signed-off-by: Dan Smith diff -r b9d3217689a1 -r ef1552498688 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Mon Nov 19 07:59:52 2007 -0800 +++ b/libxkutil/misc_util.c Mon Nov 19 07:59:54 2007 -0800 @@ -56,6 +56,8 @@ virConnectPtr connect_by_classname(const const char *uri; virConnectPtr conn; + CMSetStatus(s, CMPI_RC_OK); + uri = cn_to_uri(classname); if (!uri) { CMSetStatusWithChars(broker, s, @@ -64,11 +66,11 @@ virConnectPtr connect_by_classname(const return NULL; } + CU_DEBUG("Connecting to libvirt with uri `%s'", uri); + conn = virConnectOpen(uri); if (!conn) { - CMSetStatusWithChars(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to connect to hypervisor"); + CU_DEBUG("Unable to connect to `%s'", uri); return NULL; } @@ -334,28 +336,21 @@ bool provider_is_responsible(const CMPIB const CMPIObjectPath *reference, CMPIStatus *status) { - const char *dft_pfx; char *pfx; - bool rc = false; + bool rc = true; CMSetStatus(status, CMPI_RC_OK); pfx = class_prefix_name(CLASSNAME(reference)); - if (STREQC(pfx, "CIM")) + if (STREQC(pfx, "CIM")) { cu_statusf(broker, status, CMPI_RC_ERR_FAILED, "Please exactly specify the class (check CIMOM behavior!): %s", CLASSNAME(reference)); - - dft_pfx = default_prefix(); - if (dft_pfx == NULL) - goto out; - - if (STREQC(pfx, dft_pfx)) - rc = true; - - out: + rc = false; + } + free(pfx); return rc; } From danms at us.ibm.com Mon Nov 19 15:19:33 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 08:19:33 -0700 Subject: [Libvirt-cim] [PATCH 2 of 4] Make providers initialize library at load In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195487992 28800 # Node ID b9d3217689a1335a1a1c2eded1f52ad36f91e978 # Parent baa6107cec2c6211c262750c097eb2c552816268 Make providers initialize library at load Also change instance providers to new macro to avoid warnings Signed-off-by: Dan Smith diff -r baa6107cec2c -r b9d3217689a1 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_AllocationCapabilities.c Mon Nov 19 07:59:52 2007 -0800 @@ -26,6 +26,8 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" + #include "misc_util.h" #include "Virt_AllocationCapabilities.h" @@ -101,14 +103,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_AllocationCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_AllocationCapabilitiesProvider, _BROKER, - CMNoHook); +STD_InstanceMIStub(, Virt_AllocationCapabilitiesProvider, _BROKER, + libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ComputerSystem.c Mon Nov 19 07:59:52 2007 -0800 @@ -34,6 +34,7 @@ #include "libcmpiutil.h" #include "misc_util.h" #include "std_invokemethod.h" +#include "std_instance.h" #include "Virt_ComputerSystem.h" @@ -682,13 +683,7 @@ static CMPIStatus state_change(CMPIMetho return s; } -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_ComputerSystemProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_ComputerSystemProvider, _BROKER, libvirt_cim_init()); static struct method_handler RequestStateChange = { .name = "RequestStateChange", @@ -707,7 +702,7 @@ STDIM_MethodMIStub(, STDIM_MethodMIStub(, Virt_ComputerSystemProvider, _BROKER, - CMNoHook, + libvirt_cim_init(), my_handlers); /* diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ComputerSystemIndication.c Mon Nov 19 07:59:52 2007 -0800 @@ -301,7 +301,7 @@ DEFAULT_MP(); DEFAULT_MP(); STDI_IndicationMIStub(, Virt_ComputerSystemIndicationProvider, - _BROKER, CMNoHook, &csi); + _BROKER, libvirt_cim_init(), &csi); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_Device.c --- a/src/Virt_Device.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_Device.c Mon Nov 19 07:59:52 2007 -0800 @@ -30,6 +30,7 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" #include "cs_util.h" #include "misc_util.h" #include "device_parsing.h" @@ -531,13 +532,7 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_DeviceProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_DeviceProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_DeviceProvider, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_DevicePool.c Mon Nov 19 07:59:52 2007 -0800 @@ -39,6 +39,7 @@ #include "device_parsing.h" #include +#include #include "Virt_DevicePool.h" #include "svpc_types.h" @@ -718,13 +719,7 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_DevicePoolProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_DevicePoolProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_DevicePoolProvider, _BROKER, libvirt_cim_init()); /* diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 07:59:52 2007 -0800 @@ -292,8 +292,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Mon Nov 19 07:59:52 2007 -0800 @@ -358,8 +358,8 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); -STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: * mode: C diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Mon Nov 19 07:59:52 2007 -0800 @@ -225,7 +225,7 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: * mode: C diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ElementSettingData.c Mon Nov 19 07:59:52 2007 -0800 @@ -147,8 +147,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Mon Nov 19 07:59:52 2007 -0800 @@ -27,6 +27,8 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" + #include "misc_util.h" #include "device_parsing.h" @@ -201,14 +203,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_EnabledLogicalElementCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_EnabledLogicalElementCapabilitiesProvider, _BROKER, - CMNoHook); +STD_InstanceMIStub(, Virt_EnabledLogicalElementCapabilitiesProvider, _BROKER, + libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_HostSystem.c Mon Nov 19 07:59:52 2007 -0800 @@ -28,6 +28,8 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" + #include "misc_util.h" #include "Virt_HostSystem.h" @@ -155,13 +157,7 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_HostSystemProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_HostSystemProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_HostSystemProvider, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_HostedDependency.c Mon Nov 19 07:59:52 2007 -0800 @@ -150,7 +150,7 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Virt_HostedDependencyProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Virt_HostedDependencyProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Mon Nov 19 07:59:52 2007 -0800 @@ -151,7 +151,7 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Virt_HostedResourcePoolProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Virt_HostedResourcePoolProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_HostedService.c Mon Nov 19 07:59:52 2007 -0800 @@ -164,8 +164,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_RASD.c Mon Nov 19 07:59:52 2007 -0800 @@ -29,6 +29,8 @@ #include #include +#include + #include "device_parsing.h" #include "misc_util.h" @@ -313,13 +315,7 @@ DEFAULT_INST_CLEANUP(); DEFAULT_INST_CLEANUP(); DEFAULT_EQ(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_RASDProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_RASDProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_RASDProvider, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_RegisteredProfile.c Mon Nov 19 07:59:52 2007 -0800 @@ -29,8 +29,10 @@ #include #include +#include "libcmpiutil.h" +#include "std_instance.h" + #include "cs_util.h" -#include "libcmpiutil.h" #include "misc_util.h" #include "profiles.h" @@ -186,13 +188,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_RegisteredProfileProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_RegisteredProfileProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_RegisteredProfileProvider, _BROKER, + libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 07:59:52 2007 -0800 @@ -277,8 +277,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ResourcePoolConfigurationCapabilities.c --- a/src/Virt_ResourcePoolConfigurationCapabilities.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationCapabilities.c Mon Nov 19 07:59:52 2007 -0800 @@ -27,6 +27,8 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" + #include "misc_util.h" const static CMPIBroker *_BROKER; @@ -112,14 +114,8 @@ static CMPIStatus GetInstance(CMPIInstan } -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_ResourcePoolConfigurationCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_ResourcePoolConfigurationCapabilitiesProvider, _BROKER, - CMNoHook); +STD_InstanceMIStub(, Virt_ResourcePoolConfigurationCapabilitiesProvider, + _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationService.c Mon Nov 19 07:59:52 2007 -0800 @@ -24,6 +24,7 @@ #include #include +#include #include "misc_util.h" @@ -82,7 +83,7 @@ static struct method_handler *my_handler }; STDIM_MethodMIStub(, Virt_ResourcePoolConfigurationServiceProvider, - _BROKER, CMNoHook, my_handlers); + _BROKER, libvirt_cim_init(), my_handlers); DEFAULT_CI(); DEFAULT_MI(); @@ -203,13 +204,8 @@ static CMPIStatus EnumInstances(CMPIInst } -CMPIInstanceMI * -Virt_ResourcePoolConfigurationServiceProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_ResourcePoolConfigurationServiceProvider, - _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_ResourcePoolConfigurationServiceProvider, + _BROKER, libvirt_cim_init()); /* diff -r baa6107cec2c -r b9d3217689a1 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Nov 19 07:59:52 2007 -0800 @@ -872,8 +872,8 @@ struct std_assoc *assoc_handlers[] = { }; -STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); -STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Mon Nov 19 07:59:52 2007 -0800 @@ -365,8 +365,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_SystemDevice.c Mon Nov 19 07:59:52 2007 -0800 @@ -265,8 +265,8 @@ static struct std_assoc *assoc_handlers[ NULL }; -STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, CMNoHook, assoc_handlers); -STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, CMNoHook, assoc_handlers); +STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); +STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_VSSD.c Mon Nov 19 07:59:52 2007 -0800 @@ -28,6 +28,8 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" + #include "cs_util.h" #include "misc_util.h" #include "device_parsing.h" @@ -260,13 +262,7 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_VSSDProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_VSSDProvider, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_VSSDProvider, _BROKER, libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_VSSDComponent.c Mon Nov 19 07:59:52 2007 -0800 @@ -202,8 +202,8 @@ static struct std_assoc *handlers[] = { NULL }; -STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, CMNoHook, handlers); -STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, CMNoHook, handlers); +STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); +STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Mon Nov 19 07:59:52 2007 -0800 @@ -27,6 +27,8 @@ #include #include "libcmpiutil.h" +#include "std_instance.h" + #include "misc_util.h" #include "device_parsing.h" @@ -188,14 +190,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_VirtualSystemManagementCapabilitiesProvider_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_VirtualSystemManagementCapabilitiesProvider, _BROKER, - CMNoHook); +STD_InstanceMIStub(, Virt_VirtualSystemManagementCapabilitiesProvider, _BROKER, + libvirt_cim_init()); /* * Local Variables: diff -r baa6107cec2c -r b9d3217689a1 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 19 07:59:44 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 19 07:59:52 2007 -0800 @@ -36,9 +36,10 @@ #include "xmlgen.h" #include "libcmpiutil.h" - #include "std_invokemethod.h" #include "std_indication.h" +#include "std_instance.h" + #include "misc_util.h" #include "Virt_VirtualSystemManagementService.h" @@ -1020,7 +1021,7 @@ static struct method_handler *my_handler }; STDIM_MethodMIStub(, Virt_VirtualSystemManagementService, - _BROKER, CMNoHook, my_handlers); + _BROKER, libvirt_cim_init(), my_handlers); CMPIStatus get_vsms(const CMPIObjectPath *reference, CMPIInstance **_inst, @@ -1150,13 +1151,8 @@ DEFAULT_EQ(); DEFAULT_EQ(); DEFAULT_INST_CLEANUP(); -/* Avoid a warning in the stub macro below */ -CMPIInstanceMI * -Virt_VirtualSystemManagementService_Create_InstanceMI(const CMPIBroker *, - const CMPIContext *, - CMPIStatus *rc); - -CMInstanceMIStub(, Virt_VirtualSystemManagementService, _BROKER, CMNoHook); +STD_InstanceMIStub(, Virt_VirtualSystemManagementService, _BROKER, + libvirt_cim_init()); /* From danms at us.ibm.com Mon Nov 19 15:19:31 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 08:19:31 -0700 Subject: [Libvirt-cim] [PATCH 0 of 4] Transition to connect_by_classname() Message-ID: Updated set to not use PN macro, and fix the instance warnings. From danms at us.ibm.com Mon Nov 19 15:19:32 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 08:19:32 -0700 Subject: [Libvirt-cim] [PATCH 1 of 4] Add function to initialize libvirt In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195487984 28800 # Node ID baa6107cec2c6211c262750c097eb2c552816268 # Parent a8e5699b3e0cb6342837442a184f01083ebdb924 Add function to initialize libvirt Signed-off-by: Dan Smith diff -r a8e5699b3e0c -r baa6107cec2c libxkutil/misc_util.c --- a/libxkutil/misc_util.c Mon Nov 19 06:40:37 2007 -0800 +++ b/libxkutil/misc_util.c Mon Nov 19 07:59:44 2007 -0800 @@ -421,6 +421,11 @@ bool parse_instanceid(const CMPIObjectPa return true; } +bool libvirt_cim_init(void) +{ + return virInitialize == 0; +} + /* * Local Variables: * mode: C diff -r a8e5699b3e0c -r baa6107cec2c libxkutil/misc_util.h --- a/libxkutil/misc_util.h Mon Nov 19 06:40:37 2007 -0800 +++ b/libxkutil/misc_util.h Mon Nov 19 07:59:44 2007 -0800 @@ -92,6 +92,8 @@ int parse_id(char *id, char **pfx, char int parse_id(char *id, char **pfx, char **name); bool parse_instanceid(const CMPIObjectPath *ref, char **pfx, char **name); +bool libvirt_cim_init(void); + #define ASSOC_MATCH(pn, cn) \ if (!match_pn_to_cn((pn), (cn))) { \ return (CMPIStatus){CMPI_RC_OK, NULL}; \ From danms at us.ibm.com Mon Nov 19 16:52:52 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:52 -0700 Subject: [Libvirt-cim] [PATCH 01 of 12] Make parse_fq_devid() take a const char * In-Reply-To: Message-ID: <7a114401c8ede2268fb2.1195494772@theine> # HG changeset patch # User Dan Smith # Date 1195491599 28800 # Node ID 7a114401c8ede2268fb291d713c0b1e4715b0b8d # Parent 66f0dde5f3fd81a495a1597033e180e251817054 Make parse_fq_devid() take a const char * ...like it should have from the beginning Signed-off-by: Dan Smith diff -r 66f0dde5f3fd -r 7a114401c8ed libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Mon Nov 19 08:00:03 2007 -0800 +++ b/libxkutil/device_parsing.c Mon Nov 19 08:59:59 2007 -0800 @@ -447,7 +447,7 @@ char *get_fq_devid(char *host, char *_de return devid; } -int parse_fq_devid(char *devid, char **host, char **device) +int parse_fq_devid(const char *devid, char **host, char **device) { int ret; diff -r 66f0dde5f3fd -r 7a114401c8ed libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Mon Nov 19 08:00:03 2007 -0800 +++ b/libxkutil/device_parsing.h Mon Nov 19 08:59:59 2007 -0800 @@ -109,7 +109,7 @@ void cleanup_virt_devices(struct virt_de void cleanup_virt_devices(struct virt_device **devs, int count); char *get_fq_devid(char *host, char *_devid); -int parse_fq_devid(char *devid, char **host, char **device); +int parse_fq_devid(const char *devid, char **host, char **device); int attach_device(virDomainPtr dom, struct virt_device *dev); int detach_device(virDomainPtr dom, struct virt_device *dev); From danms at us.ibm.com Mon Nov 19 16:52:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:54 -0700 Subject: [Libvirt-cim] [PATCH 03 of 12] Make ElementAllocatedFromPool use connect_by_classname() In-Reply-To: Message-ID: <63881b803abfa7a29108.1195494774@theine> # HG changeset patch # User Dan Smith # Date 1195492220 28800 # Node ID 63881b803abfa7a291082191fb245f26731c7d7c # Parent 59abf0e63644d8c306492645f9291718c35e40d5 Make ElementAllocatedFromPool use connect_by_classname() Signed-off-by: Dan Smith diff -r 59abf0e63644 -r 63881b803abf src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 09:04:50 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 09:10:20 2007 -0800 @@ -92,7 +92,7 @@ static CMPIStatus vdev_to_pool(const CMP goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; @@ -147,7 +147,7 @@ static int filter_by_pool(struct inst_li } static int devs_from_pool(uint16_t type, - const char *ns, + const CMPIObjectPath *ref, const char *poolid, struct inst_list *list) { @@ -156,8 +156,10 @@ static int devs_from_pool(uint16_t type, virDomainPtr *doms = NULL; int count; int i; - - conn = lv_connect(_BROKER, &s); + const char *ns = NAMESPACE(ref); + const char *cn = CLASSNAME(ref); + + conn = connect_by_classname(_BROKER, cn, &s); if (conn == NULL) return 0; @@ -200,7 +202,6 @@ static CMPIStatus pool_to_vdev(const CMP { char *poolid; CMPIStatus s; - const char *ns = NAMESPACE(ref); poolid = cu_get_str_path(ref, "InstanceID"); if (poolid == NULL) { @@ -215,22 +216,22 @@ static CMPIStatus pool_to_vdev(const CMP /* FIXME, make this shared with the RAFP version */ if (STARTS_WITH(poolid, "ProcessorPool")) devs_from_pool(CIM_RASD_TYPE_PROC, - ns, + ref, poolid, list); else if (STARTS_WITH(poolid, "MemoryPool")) devs_from_pool(CIM_RASD_TYPE_MEM, - ns, + ref, poolid, list); else if (STARTS_WITH(poolid, "NetworkPool")) devs_from_pool(CIM_RASD_TYPE_NET, - ns, + ref, poolid, list); else if (STARTS_WITH(poolid, "DiskPool")) devs_from_pool(CIM_RASD_TYPE_DISK, - ns, + ref, poolid, list); else { From danms at us.ibm.com Mon Nov 19 16:52:55 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:55 -0700 Subject: [Libvirt-cim] [PATCH 04 of 12] Make ElementCapabilities use connect_by_classname() In-Reply-To: Message-ID: <0257746b9ab4cdda63bd.1195494775@theine> # HG changeset patch # User Dan Smith # Date 1195492278 28800 # Node ID 0257746b9ab4cdda63bd9a793b87d240dc6ca17d # Parent 63881b803abfa7a291082191fb245f26731c7d7c Make ElementCapabilities use connect_by_classname() Signed-off-by: Dan Smith diff -r 63881b803abf -r 0257746b9ab4 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Mon Nov 19 09:10:20 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Mon Nov 19 09:11:18 2007 -0800 @@ -167,7 +167,7 @@ static CMPIStatus cap_to_cs(const CMPIOb goto error1; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (s.rc != CMPI_RC_OK) goto error1; From danms at us.ibm.com Mon Nov 19 16:53:03 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:53:03 -0700 Subject: [Libvirt-cim] [PATCH 12 of 12] Make VSSDComponent use connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195493902 28800 # Node ID e1423289fc1dfd4b326c2d79c715ad1246be1cfa # Parent 3957678edbd4b7ed01011ac08a0771529a8c335b Make VSSDComponent use connect_by_classname() Signed-off-by: Dan Smith diff -r 3957678edbd4 -r e1423289fc1d src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Mon Nov 19 09:37:31 2007 -0800 +++ b/src/Virt_VSSDComponent.c Mon Nov 19 09:38:22 2007 -0800 @@ -84,7 +84,7 @@ static CMPIStatus vssd_for_name(const ch virDomainPtr dom = NULL; CMPIStatus s; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; From danms at us.ibm.com Mon Nov 19 16:53:02 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:53:02 -0700 Subject: [Libvirt-cim] [PATCH 11 of 12] Make VSMS use connect_by_classname() In-Reply-To: Message-ID: <3957678edbd4b7ed0101.1195494782@theine> # HG changeset patch # User Dan Smith # Date 1195493851 28800 # Node ID 3957678edbd4b7ed01011ac08a0771529a8c335b # Parent ea31aaa60fb3f4164ee296c349d45e73a36149a5 Make VSMS use connect_by_classname() Signed-off-by: Dan Smith diff -r ea31aaa60fb3 -r 3957678edbd4 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 19 09:32:33 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 19 09:37:31 2007 -0800 @@ -482,7 +482,7 @@ static CMPIStatus update_system_settings goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; @@ -587,7 +587,8 @@ static struct virt_device **find_list(st static CMPIStatus _resource_dynamic(struct domain *dominfo, struct virt_device *dev, - enum ResourceAction action) + enum ResourceAction action, + const char *refcn) { CMPIStatus s; virConnectPtr conn; @@ -608,7 +609,7 @@ static CMPIStatus _resource_dynamic(stru return s; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, refcn, &s); if (conn == NULL) { CU_DEBUG("Failed to connect"); return s; @@ -653,11 +654,16 @@ static CMPIStatus resource_del(struct do const char *devid) { CMPIStatus s; + CMPIObjectPath *op; struct virt_device **_list; struct virt_device *list; int *count; int i; + op = CMGetObjectPath(rasd, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) + goto out; + _list = find_list(dominfo, type, &count); if ((type == CIM_RASD_TYPE_MEM) || (_list != NULL)) list = *_list; @@ -677,7 +683,10 @@ static CMPIStatus resource_del(struct do struct virt_device *dev = &list[i]; if (STREQ(dev->id, devid)) { - s = _resource_dynamic(dominfo, dev, RESOURCE_DEL); + s = _resource_dynamic(dominfo, + dev, + RESOURCE_DEL, + CLASSNAME(op)); dev->type = VIRT_DEV_UNKNOWN; break; } @@ -693,11 +702,16 @@ static CMPIStatus resource_add(struct do const char *devid) { CMPIStatus s; + CMPIObjectPath *op; struct virt_device **_list; struct virt_device *list; struct virt_device *dev; int *count; + op = CMGetObjectPath(rasd, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) + goto out; + _list = find_list(dominfo, type, &count); if ((type == CIM_RASD_TYPE_MEM) || (_list == NULL)) { cu_statusf(_BROKER, &s, @@ -734,7 +748,7 @@ static CMPIStatus resource_add(struct do dev->id = strdup(devid); rasd_to_vdev(rasd, dev); - s = _resource_dynamic(dominfo, dev, RESOURCE_ADD); + s = _resource_dynamic(dominfo, dev, RESOURCE_ADD, CLASSNAME(op)); if (s.rc != CMPI_RC_OK) goto out; @@ -751,11 +765,16 @@ static CMPIStatus resource_mod(struct do const char *devid) { CMPIStatus s; + CMPIObjectPath *op; struct virt_device **_list; struct virt_device *list; int *count; int i; + op = CMGetObjectPath(rasd, &s); + if ((op == NULL) || (s.rc != CMPI_RC_OK)) + goto out; + _list = find_list(dominfo, type, &count); if (_list != NULL) list = *_list; @@ -776,7 +795,10 @@ static CMPIStatus resource_mod(struct do if (STREQ(dev->id, devid)) { rasd_to_vdev(rasd, dev); - s = _resource_dynamic(dominfo, dev, RESOURCE_MOD); + s = _resource_dynamic(dominfo, + dev, + RESOURCE_MOD, + CLASSNAME(op)); break; } } @@ -850,7 +872,7 @@ static CMPIStatus _update_resource_setti virConnectPtr conn = NULL; CMPIStatus s; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; From danms at us.ibm.com Mon Nov 19 16:52:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:58 -0700 Subject: [Libvirt-cim] [PATCH 07 of 12] Make RASD use connect_by_classname() In-Reply-To: Message-ID: <00deec21b241f4f29207.1195494778@theine> # HG changeset patch # User Dan Smith # Date 1195493224 28800 # Node ID 00deec21b241f4f29207138456f3623b7867d04f # Parent cfc79d123d0a9760c8c6c1e3d81ef4683e93b988 Make RASD use connect_by_classname() Signed-off-by: Dan Smith diff -r cfc79d123d0a -r 00deec21b241 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Nov 19 09:12:49 2007 -0800 +++ b/src/Virt_RASD.c Mon Nov 19 09:27:04 2007 -0800 @@ -175,7 +175,7 @@ static CMPIInstance *rasd_from_vdev(cons } static CMPIInstance *get_rasd_instance(const CMPIContext *context, - const CMPIObjectPath *ns, + const CMPIObjectPath *ref, const char *id, const uint16_t type) { @@ -191,13 +191,13 @@ static CMPIInstance *get_rasd_instance(c if (!ret) return NULL; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; dev = find_dev(conn, type, host, devid); if (dev) - inst = rasd_from_vdev(_BROKER, dev, host, NAMESPACE(ns)); + inst = rasd_from_vdev(_BROKER, dev, host, NAMESPACE(ref)); out: virConnectClose(conn); @@ -276,7 +276,7 @@ int rasds_for_domain(const CMPIBroker *b int rasds_for_domain(const CMPIBroker *broker, const char *name, const uint16_t type, - const char *ns, + const CMPIObjectPath *ref, struct inst_list *_list) { struct virt_device *list; @@ -284,8 +284,10 @@ int rasds_for_domain(const CMPIBroker *b int i; virConnectPtr conn; CMPIStatus s; - - conn = lv_connect(_BROKER, &s); + const char *ns = NAMESPACE(ref); + const char *cn = CLASSNAME(ref); + + conn = connect_by_classname(broker, cn, &s); if (conn == NULL) return 0; diff -r cfc79d123d0a -r 00deec21b241 src/Virt_RASD.h --- a/src/Virt_RASD.h Mon Nov 19 09:12:49 2007 -0800 +++ b/src/Virt_RASD.h Mon Nov 19 09:27:04 2007 -0800 @@ -22,11 +22,23 @@ #define __VIRT_RASD_H char *rasd_to_xml(CMPIInstance *rasd); + +/** + * Get a list of RASDs for a given domain + * + * @param broker The current broker + * @param name The name of the domain in question + * @param type The ResourceType of the desired RASDs + * @param ref A reference used for hypervisor connection and namespace + * setting of the resulting instances + * @param _list The list of instances to populate + */ int rasds_for_domain(const CMPIBroker *broker, const char *name, const uint16_t type, - const char *ns, + const CMPIObjectPath *ref, struct inst_list *_list); + CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); #endif diff -r cfc79d123d0a -r 00deec21b241 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 09:12:49 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 09:27:04 2007 -0800 @@ -134,7 +134,7 @@ static int filter_by_pool(struct inst_li } static int rasds_from_pool(uint16_t type, - const char *ns, + const CMPIObjectPath *ref, const char *poolid, struct inst_list *list) { @@ -161,7 +161,7 @@ static int rasds_from_pool(uint16_t type rasds_for_domain(_BROKER, name, type, - ns, + ref, &tmp); filter_by_pool(list, &tmp, poolid); @@ -194,22 +194,22 @@ static CMPIStatus pool_to_rasd(const CMP if (STARTS_WITH(poolid, "ProcessorPool")) rasds_from_pool(CIM_RASD_TYPE_PROC, - NAMESPACE(ref), + ref, poolid, list); else if (STARTS_WITH(poolid, "MemoryPool")) rasds_from_pool(CIM_RASD_TYPE_MEM, - NAMESPACE(ref), + ref, poolid, list); else if (STARTS_WITH(poolid, "NetworkPool")) rasds_from_pool(CIM_RASD_TYPE_NET, - NAMESPACE(ref), + ref, poolid, list); else if (STARTS_WITH(poolid, "DiskPool")) rasds_from_pool(CIM_RASD_TYPE_DISK, - NAMESPACE(ref), + ref, poolid, list); else { diff -r cfc79d123d0a -r 00deec21b241 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Mon Nov 19 09:12:49 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Mon Nov 19 09:27:04 2007 -0800 @@ -99,7 +99,7 @@ static CMPIStatus dev_to_rasd(const CMPI ret = rasds_for_domain(_BROKER, name, device_type_from_classname(CLASSNAME(ref)), - NAMESPACE(ref), + ref, &rasds); rasd = find_rasd(&rasds, id); diff -r cfc79d123d0a -r 00deec21b241 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Mon Nov 19 09:12:49 2007 -0800 +++ b/src/Virt_VSSDComponent.c Mon Nov 19 09:27:04 2007 -0800 @@ -64,7 +64,7 @@ static CMPIStatus vssd_to_rasd(const CMP rasds_for_domain(_BROKER, name, types[i], - NAMESPACE(ref), + ref, list); } From danms at us.ibm.com Mon Nov 19 16:53:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:53:00 -0700 Subject: [Libvirt-cim] [PATCH 09 of 12] Make SettingsDefineState use connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195493466 28800 # Node ID ca32e4299b0944be44ec5bf9821a087857ca37a9 # Parent c5a2fc3f7a6c13f19c06c528026d1dca2becba00 Make SettingsDefineState use connect_by_classname() Signed-off-by: Dan Smith diff -r c5a2fc3f7a6c -r ca32e4299b09 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Mon Nov 19 09:28:21 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Mon Nov 19 09:31:06 2007 -0800 @@ -118,14 +118,14 @@ static CMPIStatus dev_to_rasd(const CMPI static CMPIInstance *_get_typed_device(char *id, int type, - const char *ns, + const CMPIObjectPath *ref, CMPIStatus *s) { virConnectPtr conn = NULL; CMPIInstance *dev = NULL; const char *typestr; - conn = lv_connect(_BROKER, s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); if (conn == NULL) goto out; @@ -147,7 +147,7 @@ static CMPIInstance *_get_typed_device(c dev = instance_from_devid(_BROKER, conn, id, - ns, + NAMESPACE(ref), device_type_from_classname(typestr)); out: virConnectClose(conn); @@ -181,7 +181,7 @@ static CMPIStatus rasd_to_dev(const CMPI goto out; } - dev = _get_typed_device(id, type, NAMESPACE(ref), &s); + dev = _get_typed_device(id, type, ref, &s); if (dev == NULL) goto out; @@ -205,7 +205,7 @@ static CMPIStatus vs_to_vssd(const CMPIO CMPIInstance *vssd; CMPIStatus s; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) return s; @@ -268,7 +268,7 @@ static CMPIStatus vssd_to_vs(const CMPIO goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; From danms at us.ibm.com Mon Nov 19 16:52:59 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:59 -0700 Subject: [Libvirt-cim] [PATCH 08 of 12] Make ResourceAllocationFromPool use connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195493301 28800 # Node ID c5a2fc3f7a6c13f19c06c528026d1dca2becba00 # Parent 00deec21b241f4f29207138456f3623b7867d04f Make ResourceAllocationFromPool use connect_by_classname() Signed-off-by: Dan Smith diff -r 00deec21b241 -r c5a2fc3f7a6c src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 09:27:04 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 09:28:21 2007 -0800 @@ -74,7 +74,7 @@ static CMPIStatus rasd_to_pool(const CMP goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; @@ -144,7 +144,7 @@ static int rasds_from_pool(uint16_t type int count; int i; - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) return 0; From danms at us.ibm.com Mon Nov 19 16:52:53 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:53 -0700 Subject: [Libvirt-cim] [PATCH 02 of 12] Make DevicePool use connect_by_classname() In-Reply-To: Message-ID: <59abf0e63644d8c30649.1195494773@theine> # HG changeset patch # User Dan Smith # Date 1195491890 28800 # Node ID 59abf0e63644d8c306492645f9291718c35e40d5 # Parent 7a114401c8ede2268fb291d713c0b1e4715b0b8d Make DevicePool use connect_by_classname() Signed-off-by: Dan Smith diff -r 7a114401c8ed -r 59abf0e63644 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Nov 19 08:59:59 2007 -0800 +++ b/src/Virt_DevicePool.c Mon Nov 19 09:04:50 2007 -0800 @@ -148,7 +148,9 @@ static char *_diskpool_member_of(const c return pool; } -static char *diskpool_member_of(const CMPIBroker *broker, char *rasd_id) +static char *diskpool_member_of(const CMPIBroker *broker, + const char *rasd_id, + const char *refcn) { char *host = NULL; char *dev = NULL; @@ -165,7 +167,7 @@ static char *diskpool_member_of(const CM if (!ret) goto out; - conn = lv_connect(broker, &s); + conn = connect_by_classname(broker, refcn, &s); if (conn == NULL) goto out; @@ -194,7 +196,9 @@ static char *diskpool_member_of(const CM return pool; } -static char *netpool_member_of(const CMPIBroker *broker, char *rasd_id) +static char *netpool_member_of(const CMPIBroker *broker, + const char *rasd_id, + const char *refcn) { char *host = NULL; char *dev = NULL; @@ -211,7 +215,7 @@ static char *netpool_member_of(const CMP if (!ret) goto out; - conn = lv_connect(broker, &s); + conn = connect_by_classname(broker, refcn, &s); if (conn == NULL) goto out; @@ -243,7 +247,10 @@ static char *netpool_member_of(const CMP return result; } -char *pool_member_of(const CMPIBroker *broker, uint16_t type, char *id) +char *pool_member_of(const CMPIBroker *broker, + const char *refcn, + uint16_t type, + const char *id) { char *poolid = NULL; @@ -252,9 +259,9 @@ char *pool_member_of(const CMPIBroker *b else if (type == CIM_RASD_TYPE_MEM) poolid = strdup("MemoryPool/0"); else if (type == CIM_RASD_TYPE_NET) - poolid = netpool_member_of(broker, id); + poolid = netpool_member_of(broker, id, refcn); else if (type == CIM_RASD_TYPE_DISK) - poolid = diskpool_member_of(broker, id); + poolid = diskpool_member_of(broker, id, refcn); else return NULL; @@ -630,7 +637,7 @@ static CMPIStatus return_pool(const CMPI inst_list_init(&list); - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; @@ -691,7 +698,7 @@ static CMPIStatus GetInstance(CMPIInstan goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(reference), &s); if (conn == NULL) goto out; diff -r 7a114401c8ed -r 59abf0e63644 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Mon Nov 19 08:59:59 2007 -0800 +++ b/src/Virt_DevicePool.h Mon Nov 19 09:04:50 2007 -0800 @@ -39,7 +39,21 @@ CMPIInstance *get_pool_by_id(const CMPIB const char *id, const char *ns); -char *pool_member_of(const CMPIBroker *broker, uint16_t type, char *id); + +/** + * Get the InstanceID of a pool that a given RASD id (for type) is in + * + * @param broker The current Broker + * @param refcn A reference classname to be used for libvirt + * connections. This can be anything as long as the + * prefix is correct. + * @param type The ResourceType of the RASD + * @param id The InstanceID of the RASD + */ +char *pool_member_of(const CMPIBroker *broker, + const char *refcn, + uint16_t type, + const char *id); #endif diff -r 7a114401c8ed -r 59abf0e63644 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 08:59:59 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 09:04:50 2007 -0800 @@ -84,7 +84,7 @@ static CMPIStatus vdev_to_pool(const CMP goto out; } - poolid = pool_member_of(_BROKER, type, id); + poolid = pool_member_of(_BROKER, CLASSNAME(ref), type, id); if (poolid == NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -120,21 +120,27 @@ static int filter_by_pool(struct inst_li const char *_poolid) { int i; - char *dev_id = NULL; char *poolid = NULL; for (i = 0; i < src->cur; i++) { CMPIInstance *inst = src->list[i]; - + char *cn = NULL; + char *dev_id = NULL; + + cu_get_str_prop(inst, "CreationClassName", &cn); cu_get_str_prop(inst, "DeviceID", &dev_id); + if ((dev_id == NULL) || (cn == NULL)) + goto end; + printf("Device %hhi:%s", type, dev_id); - poolid = pool_member_of(_BROKER, type, dev_id); + poolid = pool_member_of(_BROKER, cn, type, dev_id); if (poolid && STREQ(poolid, _poolid)) inst_list_add(dest, inst); - + end: free(dev_id); + free(cn); } return dest->cur; diff -r 7a114401c8ed -r 59abf0e63644 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 08:59:59 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 09:04:50 2007 -0800 @@ -66,7 +66,7 @@ static CMPIStatus rasd_to_pool(const CMP goto out; } - poolid = pool_member_of(_BROKER, type, id); + poolid = pool_member_of(_BROKER, CLASSNAME(ref), type, id); if (poolid == NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -123,7 +123,7 @@ static int filter_by_pool(struct inst_li cu_get_str_prop(inst, "InstanceID", &rasd_id); - poolid = pool_member_of(_BROKER, type, rasd_id); + poolid = pool_member_of(_BROKER, CLASSNAME(op), type, rasd_id); if (STREQ(poolid, _poolid)) inst_list_add(dest, inst); From danms at us.ibm.com Mon Nov 19 16:52:51 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:51 -0700 Subject: [Libvirt-cim] [PATCH 00 of 12] Finish out the conversion to classname connections Message-ID: This fixes the remaining uses of lv_connect() (except for ComputerSystemIndication, which I'll deal with later). A quick poke seems to indicate that things still work, but testing would be good. Next, I will work on get_typed_instance(), which also needs a per-classname change so that we don't return Xen_foo instances for non-xen cases. There are also a lot of fixes needed to prevent classes from returning instances for the incorrect platform. These would be any that don't depend on a valid libvirt connection for their work. From danms at us.ibm.com Mon Nov 19 16:53:01 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:53:01 -0700 Subject: [Libvirt-cim] [PATCH 10 of 12] Make SettingsDefineCapabilities use connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195493553 28800 # Node ID ea31aaa60fb3f4164ee296c349d45e73a36149a5 # Parent ca32e4299b0944be44ec5bf9821a087857ca37a9 Make SettingsDefineCapabilities use connect_by_classname() Signed-off-by: Dan Smith diff -r ca32e4299b09 -r ea31aaa60fb3 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 19 09:31:06 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Nov 19 09:32:33 2007 -0800 @@ -232,7 +232,7 @@ static struct sdc_rasd_prop *proc_max(co CU_DEBUG("In proc_max()"); - conn = lv_connect(_BROKER, s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); if (conn == NULL) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, @@ -346,7 +346,7 @@ static uint16_t net_max_xen(const CMPIOb unsigned long version; uint16_t num_nics = -1; - conn = lv_connect(_BROKER, s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); if (s->rc != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, @@ -515,7 +515,7 @@ static struct sdc_rasd_prop *disk_max(co goto out; } - conn = lv_connect(_BROKER, s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), s); if (s->rc != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, From danms at us.ibm.com Mon Nov 19 16:52:57 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:57 -0700 Subject: [Libvirt-cim] [PATCH 06 of 12] Make HostedResourcePool use connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195492369 28800 # Node ID cfc79d123d0a9760c8c6c1e3d81ef4683e93b988 # Parent ca9fa1774a7bf967dd12da8e2d57f1b467db354c Make HostedResourcePool use connect_by_classname() Signed-off-by: Dan Smith diff -r ca9fa1774a7b -r cfc79d123d0a src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Mon Nov 19 09:12:02 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Mon Nov 19 09:12:49 2007 -0800 @@ -76,7 +76,7 @@ static CMPIStatus sys_to_pool(const CMPI return s; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) return s; From danms at us.ibm.com Mon Nov 19 16:52:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 09:52:56 -0700 Subject: [Libvirt-cim] [PATCH 05 of 12] Make ElementSettingData use connect_by_classname() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195492322 28800 # Node ID ca9fa1774a7bf967dd12da8e2d57f1b467db354c # Parent 0257746b9ab4cdda63bd9a793b87d240dc6ca17d Make ElementSettingData use connect_by_classname() Signed-off-by: Dan Smith diff -r 0257746b9ab4 -r ca9fa1774a7b src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Mon Nov 19 09:11:18 2007 -0800 +++ b/src/Virt_ElementSettingData.c Mon Nov 19 09:12:02 2007 -0800 @@ -53,7 +53,7 @@ static CMPIStatus vssd_to_sd(const CMPIO goto out; } - conn = lv_connect(_BROKER, &s); + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) goto out; From kaitlin at linux.vnet.ibm.com Mon Nov 19 18:16:59 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 10:16:59 -0800 Subject: [Libvirt-cim] [PATCH 0 of 4] Transition to connect_by_classname() In-Reply-To: References: Message-ID: <4741D31B.2060105@linux.vnet.ibm.com> Dan Smith wrote: > Updated set to not use PN macro, and fix the instance warnings. > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > This looks good. I also applied the patch set to my tree. Was able to compile and test just fine. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Mon Nov 19 18:17:38 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 10:17:38 -0800 Subject: [Libvirt-cim] [PATCH] Add std_instance.h with updated MIStub macro In-Reply-To: <25497386647b6e757ed5.1195488073@theine> References: <25497386647b6e757ed5.1195488073@theine> Message-ID: <4741D342.5060702@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195488042 28800 > # Node ID 25497386647b6e757ed5c8893f2a4c648543829b > # Parent 18403e085eaab25596f65d3273ad56befeb46463 > Add std_instance.h with updated MIStub macro > This also looks fine and applied fine. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Mon Nov 19 18:17:55 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 11:17:55 -0700 Subject: [Libvirt-cim] [PATCH] Removing pre-existing parse InstanceID function (parse_instance_id()). This function should have been used instead of writing a new one, however, it doesn't support NULL parameters for the prefix and the local_id Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195499749 28800 # Node ID a38c8fc56e5787d3cadde11cccba37cbfc6926ac # Parent f3e1a5e15e27a2014a9fc382a40d74d476eaa76d Removing pre-existing parse InstanceID function (parse_instance_id()). This function should have been used instead of writing a new one, however, it doesn't support NULL parameters for the prefix and the local_id. Also replacing any calls to parse_instance_id() and replaced with parse_instanceid(). Signed-off-by: Kaitlin Rupert diff -r f3e1a5e15e27 -r a38c8fc56e57 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Mon Nov 19 10:08:54 2007 -0800 +++ b/libxkutil/misc_util.c Mon Nov 19 11:15:49 2007 -0800 @@ -155,29 +155,6 @@ bool match_pn_to_cn(const char *pn, cons return result; } -int parse_instance_id(char *_iid, char **orgid, char **locid) -{ - char *iid = NULL; - char *delim = NULL; - int ret = 0; - - iid = strdup(_iid); - - delim = strchr(iid, ':'); - if (!delim) { - free(iid); - goto out; - } - - *delim = '\0'; - *orgid = iid; - *locid = strdup(delim+1); - - ret = 1; - out: - return ret; -} - static const char *prefix_from_uri(const char *uri) { if (strstr(uri, "xen")) diff -r f3e1a5e15e27 -r a38c8fc56e57 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Nov 19 10:08:54 2007 -0800 +++ b/src/Virt_VSSD.c Mon Nov 19 11:15:49 2007 -0800 @@ -223,23 +223,12 @@ static CMPIStatus GetInstance(CMPIInstan { CMPIStatus s; CMPIInstance *inst; - char *iid; - char *orgid; char *locid; - iid = cu_get_str_path(reference, "InstanceID"); - if (iid == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "InstanceID not specified"); - return s; - } - - if (!parse_instance_id(iid, &orgid, &locid)) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, + if (!parse_instanceid(reference, NULL, &locid)) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, "Invalid InstanceID specified"); - free(iid); return s; } @@ -249,8 +238,6 @@ static CMPIStatus GetInstance(CMPIInstan CMSetStatus(&s, CMPI_RC_OK); - free(iid); - free(orgid); free(locid); return s; From heidieck at linux.vnet.ibm.com Mon Nov 19 19:14:05 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Mon, 19 Nov 2007 20:14:05 +0100 Subject: [Libvirt-cim] [PATCH] Add STD_InstanceMIStub to avoid warnings during compile time In-Reply-To: <87zlxa1d1u.fsf@theine.beaverton.ibm.com> References: <4a0c7a2052a8da406217.1195471708@localhost.localdomain> <87zlxa1d1u.fsf@theine.beaverton.ibm.com> Message-ID: <4741E07D.4050005@linux.vnet.ibm.com> Dan Smith wrote: > HE> # HG changeset patch > HE> # User Heidi Eckhart > HE> # Date 1195471122 -3600 > HE> # Node ID 4a0c7a2052a8da4062177a29d5bd02c6b5a551d1 > HE> # Parent 18403e085eaab25596f65d3273ad56befeb46463 > HE> Add STD_InstanceMIStub to avoid warnings during compile time > HE> Signed-off-by: Heidi Eckhart > > HE> libcmpiutil.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > HE> 1 file changed, 46 insertions(+) > > Actually, can we put this in a std_instance.h like the rest of them? > I'll include this change in front of my updated patch set for > comments. Sure, much better than adding this to libcmpiutil.h :) ! -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From kaitlin at linux.vnet.ibm.com Mon Nov 19 19:17:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 11:17:49 -0800 Subject: [Libvirt-cim] [PATCH 03 of 12] Make ElementAllocatedFromPool use connect_by_classname() In-Reply-To: <63881b803abfa7a29108.1195494774@theine> References: <63881b803abfa7a29108.1195494774@theine> Message-ID: <4741E15D.50902@linux.vnet.ibm.com> Dan Smith wrote: > { > @@ -156,8 +156,10 @@ static int devs_from_pool(uint16_t type, > virDomainPtr *doms = NULL; > int count; > int i; > - > - conn = lv_connect(_BROKER, &s); > + const char *ns = NAMESPACE(ref); > + const char *cn = CLASSNAME(ref); > + > + conn = connect_by_classname(_BROKER, cn, &s); > if (conn == NULL) > return 0; > This is terribly nit-picky.. but why use variables for ns and cn? They only get used once in this function, right? I suppose it does look cleaner though. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Mon Nov 19 18:25:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:56 -0700 Subject: [Libvirt-cim] [PATCH 04 of 27] Fix uses of get_typed_*() in SystemDevice In-Reply-To: Message-ID: <2baab0636245ee278bcd.1195500356@theine> # HG changeset patch # User Dan Smith # Date 1195497544 28800 # Node ID 2baab0636245ee278bcddd63dfdd4dffbb8698ba # Parent 430b7fab22f00f2d86ba9587e4e98af4b47881a3 Fix uses of get_typed_*() in SystemDevice Signed-off-by: Dan Smith diff -r 430b7fab22f0 -r 2baab0636245 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Mon Nov 19 10:33:50 2007 -0800 +++ b/src/Virt_SystemDevice.c Mon Nov 19 10:39:04 2007 -0800 @@ -100,8 +100,7 @@ static int get_all_devices(const char *n } static CMPIInstance *host_instance(char *name, - const char *host_cn, - const char *ns) + const CMPIObjectPath *ref) { CMPIInstance *inst = NULL; virConnectPtr conn = NULL; @@ -109,15 +108,16 @@ static CMPIInstance *host_instance(char CMPIObjectPath *op; char *host_class; - host_class = get_typed_class("ComputerSystem"); + host_class = get_typed_class(CLASSNAME(ref), + "ComputerSystem"); if (host_class == NULL) goto out; - op = CMNewObjectPath(_BROKER, ns, host_class, &s); + op = CMNewObjectPath(_BROKER, NAMESPACE(ref), host_class, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) goto out; - conn = connect_by_classname(_BROKER, host_cn, &s); + conn = connect_by_classname(_BROKER, host_class, &s); if (conn == NULL) goto out; @@ -139,6 +139,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *refinst = NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), "SystemDevice", NAMESPACE(ref)); @@ -227,9 +228,7 @@ static CMPIStatus dev_to_sys(const CMPIO goto out; } - sys = host_instance(host, - CLASSNAME(ref), - NAMESPACE(ref)); + sys = host_instance(host, ref); if (sys == NULL) cu_statusf(_BROKER, &s, From danms at us.ibm.com Mon Nov 19 18:25:57 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:57 -0700 Subject: [Libvirt-cim] [PATCH 05 of 27] Hack up ComputerSystemIndication to work with the new prototype In-Reply-To: Message-ID: <2f6d7ab90c35f7a7be35.1195500357@theine> # HG changeset patch # User Dan Smith # Date 1195497844 28800 # Node ID 2f6d7ab90c35f7a7be3555c945e412f098ad51e6 # Parent 2baab0636245ee278bcddd63dfdd4dffbb8698ba Hack up ComputerSystemIndication to work with the new prototype ...I'll fix it later when I figure out how we're going to do all of the per-class stuff in indications. Signed-off-by: Dan Smith diff -r 2baab0636245 -r 2f6d7ab90c35 src/Virt_ComputerSystemIndication.c --- a/src/Virt_ComputerSystemIndication.c Mon Nov 19 10:39:04 2007 -0800 +++ b/src/Virt_ComputerSystemIndication.c Mon Nov 19 10:44:04 2007 -0800 @@ -71,7 +71,10 @@ static bool _lifecycle_indication(const CMPIInstance *ind; CMPIStatus s; - ind = get_typed_instance(broker, type, NAMESPACE(newsystem)); + ind = get_typed_instance(broker, + "Xen", /* Temporary hack */ + type, + NAMESPACE(newsystem)); if (ind == NULL) { printf("Failed to create ind\n"); return false; @@ -148,12 +151,12 @@ static bool async_ind(CMPIContext *conte if (type == CS_CREATED) { type_name = "ComputerSystemCreatedIndication"; - type_cn = get_typed_class(type_name); + type_cn = get_typed_class(pfx_from_conn(conn), type_name); op = CMNewObjectPath(_BROKER, ns, type_cn, &s); } else if (type == CS_DELETED) { type_name = "ComputerSystemDeletedIndication"; - type_cn = get_typed_class(type_name); + type_cn = get_typed_class(pfx_from_conn(conn), type_name); op = CMNewObjectPath(_BROKER, ns, type_cn, &s); } else { From danms at us.ibm.com Mon Nov 19 18:26:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:06 -0700 Subject: [Libvirt-cim] [PATCH 14 of 27] Hack up RegisteredProfile to work with the new prototype In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499075 28800 # Node ID efeaecd744af8a062b02b5b6614fd80bc7a7cc48 # Parent f328924600e90f76f360e19c40b30cd63bc40801 Hack up RegisteredProfile to work with the new prototype ...I'll fix it later when I figure out how we're going to do all of the per-class stuff in profiles. Signed-off-by: Dan Smith diff -r f328924600e9 -r efeaecd744af src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Mon Nov 19 11:02:29 2007 -0800 +++ b/src/Virt_RegisteredProfile.c Mon Nov 19 11:04:35 2007 -0800 @@ -50,7 +50,7 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *instance = NULL; char *classname; - classname = get_typed_class("RegisteredProfile"); + classname = get_typed_class("Xen", "RegisteredProfile"); if (classname == NULL) { goto out; } From danms at us.ibm.com Mon Nov 19 18:25:52 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:52 -0700 Subject: [Libvirt-cim] [PATCH 00 of 27] Fix uses of get_typed_*() Message-ID: This is a huge set that changes the semantics of get_typed_class() and get_typed_instance() to take a reference class name for proper typing. I have only smoke-tested it, but it fixes several issues with returning incorrectly-typed instances that I know of. A healthy amount of testing would be appreciated :) From danms at us.ibm.com Mon Nov 19 18:25:59 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:59 -0700 Subject: [Libvirt-cim] [PATCH 07 of 27] Fix uses of get_typed_*() in HostSystem In-Reply-To: Message-ID: <4304ba0c1cedd5401ae3.1195500359@theine> # HG changeset patch # User Dan Smith # Date 1195498359 28800 # Node ID 4304ba0c1cedd5401ae3fb24e4edc1a2291f770f # Parent 5de7d5dad0a016a8bcd1ae6ad443726d880ecda3 Fix uses of get_typed_*() in HostSystem Signed-off-by: Dan Smith diff -r 5de7d5dad0a0 -r 4304ba0c1ced src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Mon Nov 19 10:46:48 2007 -0800 +++ b/src/Virt_HostSystem.c Mon Nov 19 10:52:39 2007 -0800 @@ -65,7 +65,7 @@ CMPIStatus get_host_cs(const CMPIBroker ns = NAMESPACE(reference); - classname = get_typed_class("HostSystem"); + classname = get_typed_class(CLASSNAME(reference), "HostSystem"); if (classname == NULL) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, From danms at us.ibm.com Mon Nov 19 18:26:05 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:05 -0700 Subject: [Libvirt-cim] [PATCH 13 of 27] Fix uses of get_typed_*() in HostedDependency In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195498949 28800 # Node ID f328924600e90f76f360e19c40b30cd63bc40801 # Parent 30e1598a81c47ec7794f232cfff1cfbdaa5a5387 Fix uses of get_typed_*() in HostedDependency Signed-off-by: Dan Smith diff -r 30e1598a81c4 -r f328924600e9 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Mon Nov 19 11:01:51 2007 -0800 +++ b/src/Virt_HostedDependency.c Mon Nov 19 11:02:29 2007 -0800 @@ -84,6 +84,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *refinst = NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), "HostedDependency", NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:15 -0700 Subject: [Libvirt-cim] [PATCH 23 of 27] Fix uses of get_typed_*() in SettingsDefineState In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499692 28800 # Node ID ec285ccf09c150d0f7a374a650043cc46401fcc2 # Parent 906da584d07d8b15e324222de57beeff241aca38 Fix uses of get_typed_*() in SettingsDefineState Signed-off-by: Dan Smith diff -r 906da584d07d -r ec285ccf09c1 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Mon Nov 19 11:14:19 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Mon Nov 19 11:14:52 2007 -0800 @@ -299,6 +299,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *refinst = NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), "SettingsDefineState", NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:07 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:07 -0700 Subject: [Libvirt-cim] [PATCH 15 of 27] Hack up ElementConformsToProfile to work with the new prototype In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499129 28800 # Node ID b58e0f79b99e8c9eaedb7a9c2b4dbd194afc2a8d # Parent efeaecd744af8a062b02b5b6614fd80bc7a7cc48 Hack up ElementConformsToProfile to work with the new prototype ...I'll fix it later when I figure out how we're going to do all of the per-class stuff in profiles. Signed-off-by: Dan Smith diff -r efeaecd744af -r b58e0f79b99e src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Mon Nov 19 11:04:35 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Mon Nov 19 11:05:29 2007 -0800 @@ -58,7 +58,7 @@ static CMPIStatus elem_instances(const C CMPIData data ; char *classname; - classname = get_typed_class(profile->provider_name); + classname = get_typed_class("Xen", profile->provider_name); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -176,6 +176,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *assoc_inst; assoc_inst = get_typed_instance(_BROKER, + "Xen", "ElementConformsToProfile", NAMESPACE(source_op)); From danms at us.ibm.com Mon Nov 19 18:26:19 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:19 -0700 Subject: [Libvirt-cim] [PATCH 27 of 27] Fix uses of get_typed_*() in ElementSettingData In-Reply-To: Message-ID: <5cba4b046c9c91c502c9.1195500379@theine> # HG changeset patch # User Dan Smith # Date 1195499849 28800 # Node ID 5cba4b046c9c91c502c93ce1042872f1eaeecb3b # Parent 1911ceb455c3a0ed249e4d0eaad750ef8a46aaf8 Fix uses of get_typed_*() in ElementSettingData Signed-off-by: Dan Smith diff -r 1911ceb455c3 -r 5cba4b046c9c src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Mon Nov 19 11:16:58 2007 -0800 +++ b/src/Virt_ElementSettingData.c Mon Nov 19 11:17:29 2007 -0800 @@ -97,6 +97,7 @@ static CMPIInstance *make_ref(const CMPI goto out; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), base, NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:25:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:54 -0700 Subject: [Libvirt-cim] [PATCH 02 of 27] Fix uses of get_typed_*() in ComputerSystem In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195496766 28800 # Node ID aca1440f3971d2f4068fa0c957a7729428af8b1d # Parent b1d53e304e5dc88a3f57b303838926d31c8f0a7e Fix uses of get_typed_*() in ComputerSystem Signed-off-by: Dan Smith diff -r b1d53e304e5d -r aca1440f3971 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Nov 19 10:24:48 2007 -0800 +++ b/src/Virt_ComputerSystem.c Mon Nov 19 10:26:06 2007 -0800 @@ -288,6 +288,7 @@ CMPIInstance *instance_from_name(const C return 0; instance = get_typed_instance(broker, + pfx_from_conn(conn), "ComputerSystem", NAMESPACE(op)); if (instance == NULL) @@ -319,7 +320,10 @@ int enum_domains(const CMPIBroker *broke for (i = 0; i < count; i++) { CMPIInstance *inst; - inst = get_typed_instance(broker, "ComputerSystem", ns); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "ComputerSystem", + ns); if (inst == NULL) goto end; From danms at us.ibm.com Mon Nov 19 18:26:17 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:17 -0700 Subject: [Libvirt-cim] [PATCH 25 of 27] Fix uses of get_typed_*() in ElementAllocatedFromPool In-Reply-To: Message-ID: <13dd8a2a47e9227b8cf3.1195500377@theine> # HG changeset patch # User Dan Smith # Date 1195499766 28800 # Node ID 13dd8a2a47e9227b8cf34852914d6f1ca0d61db0 # Parent 2669d79e2d2959da0de8d7709d66bad9fb36a2ec Fix uses of get_typed_*() in ElementAllocatedFromPool Signed-off-by: Dan Smith diff -r 2669d79e2d29 -r 13dd8a2a47e9 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 11:15:22 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Mon Nov 19 11:16:06 2007 -0800 @@ -257,6 +257,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *refinst = NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), "ElementAllocatedFromPool", NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:25:53 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:53 -0700 Subject: [Libvirt-cim] [PATCH 01 of 27] Change the behavior of get_typed_{instance, class}() In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195496688 28800 # Node ID b1d53e304e5dc88a3f57b303838926d31c8f0a7e # Parent e1423289fc1dfd4b326c2d79c715ad1246be1cfa Change the behavior of get_typed_{instance,class}() so that they take a proper prefix. Signed-off-by: Dan Smith diff -r e1423289fc1d -r b1d53e304e5d libxkutil/misc_util.c --- a/libxkutil/misc_util.c Mon Nov 19 09:38:22 2007 -0800 +++ b/libxkutil/misc_util.c Mon Nov 19 10:24:48 2007 -0800 @@ -178,43 +178,6 @@ int parse_instance_id(char *_iid, char * return ret; } -static const char *prefix_from_uri(const char *uri) -{ - if (strstr(uri, "xen")) - return "Xen"; - else if (strstr(uri, "qemu")) - return "KVM"; - else - return NULL; -} - -static bool is_xen(void) -{ - return access("/proc/xen/privcmd", R_OK) == 0; -} - -static bool is_kvm(void) -{ - return access("/sys/module/kvm", R_OK) == 0; -} - -static bool is_user(void) -{ - return getenv(URI_ENV) != NULL; -} - -static const char *default_prefix(void) -{ - if (is_user()) - return prefix_from_uri(getenv(URI_ENV)); - else if (is_xen()) - return "Xen"; - else if (is_kvm()) - return "KVM"; - else - return NULL; -} - uint64_t allocated_memory(virConnectPtr conn) { virDomainPtr *list; @@ -241,24 +204,61 @@ uint64_t allocated_memory(virConnectPtr return memory; } +const char *pfx_from_conn(virConnectPtr conn) +{ + char *uri; + const char *pfx = "Xen"; + + uri = virConnectGetURI(conn); + if (uri == NULL) + return pfx; /* Default/Error case */ + + CU_DEBUG("URI of connection is: %s", uri); + + if (STARTS_WITH(uri, "xen")) + pfx = "Xen"; + else if (STARTS_WITH(uri, "qemu")) + pfx = "KVM"; + + free(uri); + + return pfx; +} + +char *get_typed_class(const char *refcn, const char *new_base) +{ + char *class = NULL; + char *pfx; + + if (strchr(refcn, '_')) + pfx = class_prefix_name(refcn); + else + pfx = strdup(refcn); + + if (pfx == NULL) + return NULL; + + if (asprintf(&class, "%s_%s", pfx, new_base) == -1) + class = NULL; + + free(pfx); + + return class; +} + CMPIInstance *get_typed_instance(const CMPIBroker *broker, + const char *refcn, const char *base, const char *namespace) { - const char *prefix; char *new_cn; CMPIObjectPath *op; CMPIInstance *inst = NULL; CMPIStatus s; - prefix = default_prefix(); - if (prefix == NULL) - goto out; - - if (asprintf(&new_cn, "%s_%s", prefix, base) == -1) { - new_cn = NULL; - goto out; - } + new_cn = get_typed_class(refcn, base); + if (new_cn == NULL) + goto out; op = CMNewObjectPath(broker, namespace, new_cn, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) @@ -275,21 +275,6 @@ CMPIInstance *get_typed_instance(const C free(new_cn); return inst; -} - -char *get_typed_class(const char *new_base) -{ - const char *pfx; - char *class = NULL; - - pfx = default_prefix(); - if (pfx == NULL) - return NULL; - - if (asprintf(&class, "%s_%s", pfx, new_base) == -1) - class = NULL; - - return class; } char *class_base_name(const char *classname) @@ -305,27 +290,15 @@ char *class_base_name(const char *classn virConnectPtr lv_connect(const CMPIBroker *broker, CMPIStatus *s) { - const char *uri = NULL; virConnectPtr conn; - if (is_user()) - uri = getenv(URI_ENV); - else if (is_xen()) - uri = "xen"; - else if (is_kvm()) - uri = "qemu:///system"; - else { - cu_statusf(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to determine hypervisor type"); - return NULL; - } - - conn = virConnectOpen(uri); + /* This is going away, so just assume Xen for right now */ + + conn = virConnectOpen("xen"); if (conn == NULL) cu_statusf(broker, s, CMPI_RC_ERR_FAILED, - "Unable to connect to %s", uri); + "Unable to connect to xen"); else CMSetStatus(s, CMPI_RC_OK); diff -r e1423289fc1d -r b1d53e304e5d libxkutil/misc_util.h --- a/libxkutil/misc_util.h Mon Nov 19 09:38:22 2007 -0800 +++ b/libxkutil/misc_util.h Mon Nov 19 10:24:48 2007 -0800 @@ -70,9 +70,13 @@ char *class_prefix_name(const char *clas char *class_prefix_name(const char *classname); char *class_base_name(const char *classname); -/* Returns "%s_%s" % (prefix($classname), new_base) */ -char *get_typed_class(const char *new_base); +/* Returns a class prefix based on the URI reported by conn */ +const char *pfx_from_conn(virConnectPtr conn); + +/* Returns "%s_%s" % (prefix($refcn), new_base) */ +char *get_typed_class(const char *refcn, const char *new_base); CMPIInstance *get_typed_instance(const CMPIBroker *broker, + const char *refcn, const char *base, const char *namespace); From danms at us.ibm.com Mon Nov 19 18:26:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:00 -0700 Subject: [Libvirt-cim] [PATCH 08 of 27] Fix uses of get_typed_*() in VSMS In-Reply-To: Message-ID: <989ee919bdc85b26f9a4.1195500360@theine> # HG changeset patch # User Dan Smith # Date 1195498598 28800 # Node ID 989ee919bdc85b26f9a454b4ed89e3e42211266d # Parent 4304ba0c1cedd5401ae3fb24e4edc1a2291f770f Fix uses of get_typed_*() in VSMS Also short-cut to triggering Xen_Foo indications for now. Signed-off-by: Dan Smith diff -r 4304ba0c1ced -r 989ee919bdc8 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 19 10:52:39 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Mon Nov 19 10:56:38 2007 -0800 @@ -358,7 +358,7 @@ static bool trigger_indication(const CMP char *type; CMPIStatus s; - type = get_typed_class(base_type); + type = get_typed_class("Xen", base_type); s = stdi_trigger_indication(_BROKER, context, type, ns); @@ -1059,6 +1059,7 @@ CMPIStatus get_vsms(const CMPIObjectPath goto out; inst = get_typed_instance(broker, + CLASSNAME(reference), "VirtualSystemManagementService", NAMESPACE(reference)); if (inst == NULL) { From danms at us.ibm.com Mon Nov 19 18:26:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:12 -0700 Subject: [Libvirt-cim] [PATCH 20 of 27] Fix uses of get_typed_*() in ResourcePoolConfigurationService In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499568 28800 # Node ID c247a785f91edfe2b8a9f2467a44eaddaf2a43d3 # Parent b717a04e455cd5de99c549482339eb4e56c062d8 Fix uses of get_typed_*() in ResourcePoolConfigurationService Signed-off-by: Dan Smith diff -r b717a04e455c -r c247a785f91e src/Virt_ResourcePoolConfigurationService.c --- a/src/Virt_ResourcePoolConfigurationService.c Mon Nov 19 11:11:53 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationService.c Mon Nov 19 11:12:48 2007 -0800 @@ -105,6 +105,7 @@ CMPIStatus rpcs_instance(const CMPIObjec goto out; inst = get_typed_instance(broker, + CLASSNAME(reference), "ResourcePoolConfigurationService", NAMESPACE(reference)); if (inst == NULL) { From danms at us.ibm.com Mon Nov 19 18:26:02 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:02 -0700 Subject: [Libvirt-cim] [PATCH 10 of 27] Fix uses of get_typed_*() in EnabledLogicalElementCapabilities In-Reply-To: Message-ID: <463508334518aaa57a72.1195500362@theine> # HG changeset patch # User Dan Smith # Date 1195498843 28800 # Node ID 463508334518aaa57a72e5f0b5adc691da009301 # Parent eac989ba68973546f17e21be499e9b0de64baf92 Fix uses of get_typed_*() in EnabledLogicalElementCapabilities Signed-off-by: Dan Smith diff -r eac989ba6897 -r 463508334518 src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Mon Nov 19 10:59:48 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Mon Nov 19 11:00:43 2007 -0800 @@ -118,7 +118,8 @@ CMPIStatus get_ele_cap(const CMPIBroker goto out; } - classname = get_typed_class("EnabledLogicalElementCapabilities"); + classname = get_typed_class(CLASSNAME(ref), + "EnabledLogicalElementCapabilities"); if (classname == NULL) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, From danms at us.ibm.com Mon Nov 19 18:25:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:58 -0700 Subject: [Libvirt-cim] [PATCH 06 of 27] Fix uses of get_typed_*() in RASD In-Reply-To: Message-ID: <5de7d5dad0a016a8bcd1.1195500358@theine> # HG changeset patch # User Dan Smith # Date 1195498008 28800 # Node ID 5de7d5dad0a016a8bcd1ae6ad443726d880ecda3 # Parent 2f6d7ab90c35f7a7be3555c945e412f098ad51e6 Fix uses of get_typed_*() in RASD Signed-off-by: Dan Smith diff -r 2f6d7ab90c35 -r 5de7d5dad0a0 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Nov 19 10:44:04 2007 -0800 +++ b/src/Virt_RASD.c Mon Nov 19 10:46:48 2007 -0800 @@ -105,7 +105,7 @@ static CMPIInstance *rasd_from_vdev(cons static CMPIInstance *rasd_from_vdev(const CMPIBroker *broker, struct virt_device *dev, const char *host, - const char *ns) + const CMPIObjectPath *ref) { CMPIInstance *inst; uint16_t type; @@ -128,7 +128,10 @@ static CMPIInstance *rasd_from_vdev(cons return NULL; } - inst = get_typed_instance(broker, base, ns); + inst = get_typed_instance(broker, + CLASSNAME(ref), + base, + NAMESPACE(ref)); if (inst == NULL) return inst; @@ -197,7 +200,7 @@ static CMPIInstance *get_rasd_instance(c dev = find_dev(conn, type, host, devid); if (dev) - inst = rasd_from_vdev(_BROKER, dev, host, NAMESPACE(ref)); + inst = rasd_from_vdev(_BROKER, dev, host, ref); out: virConnectClose(conn); @@ -284,10 +287,8 @@ int rasds_for_domain(const CMPIBroker *b int i; virConnectPtr conn; CMPIStatus s; - const char *ns = NAMESPACE(ref); - const char *cn = CLASSNAME(ref); - - conn = connect_by_classname(broker, cn, &s); + + conn = connect_by_classname(broker, CLASSNAME(ref), &s); if (conn == NULL) return 0; @@ -296,7 +297,7 @@ int rasds_for_domain(const CMPIBroker *b for (i = 0; i < count; i++) { CMPIInstance *inst; - inst = rasd_from_vdev(broker, &list[i], name, ns); + inst = rasd_from_vdev(broker, &list[i], name, ref); if (inst != NULL) inst_list_add(_list, inst); } From danms at us.ibm.com Mon Nov 19 18:25:55 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:25:55 -0700 Subject: [Libvirt-cim] [PATCH 03 of 27] Fix uses of get_typed_*() in Device In-Reply-To: Message-ID: <430b7fab22f00f2d86ba.1195500355@theine> # HG changeset patch # User Dan Smith # Date 1195497230 28800 # Node ID 430b7fab22f00f2d86ba9587e4e98af4b47881a3 # Parent aca1440f3971d2f4068fa0c957a7729428af8b1d Fix uses of get_typed_*() in Device Signed-off-by: Dan Smith diff -r aca1440f3971 -r 430b7fab22f0 src/Virt_Device.c --- a/src/Virt_Device.c Mon Nov 19 10:26:06 2007 -0800 +++ b/src/Virt_Device.c Mon Nov 19 10:33:50 2007 -0800 @@ -95,12 +95,17 @@ static int net_set_systemname(CMPIInstan static CMPIInstance *net_instance(const CMPIBroker *broker, struct net_device *dev, - const char *domain, + const virDomainPtr dom, const char *ns) { CMPIInstance *inst; - - inst = get_typed_instance(broker, "NetworkPort", ns); + virConnectPtr conn; + + conn = virDomainGetConnect(dom); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "NetworkPort", + ns); if (!net_set_type(inst, dev)) return NULL; @@ -108,7 +113,7 @@ static CMPIInstance *net_instance(const if (!net_set_hwaddr(inst, dev, broker)) return NULL; - if (!net_set_systemname(inst, domain)) + if (!net_set_systemname(inst, virDomainGetName(dom))) return NULL; return inst; @@ -125,12 +130,17 @@ static int disk_set_name(CMPIInstance *i static CMPIInstance *disk_instance(const CMPIBroker *broker, struct disk_device *dev, - const char *domain, + const virDomainPtr dom, const char *ns) { CMPIInstance *inst; - - inst = get_typed_instance(broker, "LogicalDisk", ns); + virConnectPtr conn; + + conn = virDomainGetConnect(dom); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "LogicalDisk", + ns); if (!disk_set_name(inst, dev)) return NULL; @@ -158,12 +168,17 @@ static int mem_set_size(CMPIInstance *in static CMPIInstance *mem_instance(const CMPIBroker *broker, struct mem_device *dev, - const char *domain, + const virDomainPtr dom, const char *ns) { CMPIInstance *inst; - - inst = get_typed_instance(broker, "Memory", ns); + virConnectPtr conn; + + conn = virDomainGetConnect(dom); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "Memory", + ns); if (!mem_set_size(inst, dev)) return NULL; @@ -173,23 +188,28 @@ static CMPIInstance *mem_instance(const static CMPIInstance *vcpu_instance(const CMPIBroker *broker, struct _virVcpuInfo *dev, - const char *domain, + const virDomainPtr dom, const char *ns) { CMPIInstance *inst; - - inst = get_typed_instance(broker, "Processor", ns); + virConnectPtr conn; + + conn = virDomainGetConnect(dom); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "Processor", + ns); return inst; } static int device_set_devid(CMPIInstance *instance, struct virt_device *dev, - const char *domain) + const virDomainPtr dom) { char *id; - id = get_fq_devid((char *)domain, dev->id); + id = get_fq_devid((char *)virDomainGetName(dom), dev->id); if (id == NULL) return 0; @@ -202,17 +222,17 @@ static int device_set_devid(CMPIInstance } static int device_set_systemname(CMPIInstance *instance, - const char *domain) + const virDomainPtr dom) { CMSetProperty(instance, "SystemName", - (CMPIValue *)domain, CMPI_chars); + (CMPIValue *)virDomainGetName(dom), CMPI_chars); return 1; } static CMPIInstance *device_instance(const CMPIBroker *broker, struct virt_device *dev, - const char *domain, + const virDomainPtr dom, const char *ns) { CMPIInstance *instance; @@ -220,22 +240,22 @@ static CMPIInstance *device_instance(con if (dev->type == VIRT_DEV_NET) instance = net_instance(broker, &dev->dev.net, - domain, + dom, ns); else if (dev->type == VIRT_DEV_DISK) instance = disk_instance(broker, &dev->dev.disk, - domain, + dom, ns); else if (dev->type == VIRT_DEV_MEM) instance = mem_instance(broker, &dev->dev.mem, - domain, + dom, ns); else if (dev->type == VIRT_DEV_VCPU) instance = vcpu_instance(broker, &dev->dev.vcpu, - domain, + dom, ns); else return NULL; @@ -243,8 +263,8 @@ static CMPIInstance *device_instance(con if (!instance) return NULL; - device_set_devid(instance, dev, domain); - device_set_systemname(instance, domain); + device_set_devid(instance, dev, dom); + device_set_systemname(instance, dom); return instance; } @@ -288,11 +308,6 @@ int dom_devices(const CMPIBroker *broker int count; int i; struct virt_device *devs = NULL; - const char *domain; - - domain = virDomainGetName(dom); - if (!domain) - return 0; count = get_devices(dom, &devs, type); if (count <= 0) @@ -301,7 +316,7 @@ int dom_devices(const CMPIBroker *broker for (i = 0; i < count; i++) { CMPIInstance *dev = NULL; - dev = device_instance(broker, &devs[i], domain, ns); + dev = device_instance(broker, &devs[i], dom, ns); if (dev) inst_list_add(list, dev); @@ -442,7 +457,7 @@ CMPIInstance *instance_from_devid(const if (!dev) goto out; - instance = device_instance(broker, dev, domain, ns); + instance = device_instance(broker, dev, dom, ns); cleanup_virt_device(dev); out: From danms at us.ibm.com Mon Nov 19 18:26:16 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:16 -0700 Subject: [Libvirt-cim] [PATCH 24 of 27] Fix uses of get_typed_*() in ResourceAllocationFromPool In-Reply-To: Message-ID: <2669d79e2d2959da0de8.1195500376@theine> # HG changeset patch # User Dan Smith # Date 1195499722 28800 # Node ID 2669d79e2d2959da0de8d7709d66bad9fb36a2ec # Parent ec285ccf09c150d0f7a374a650043cc46401fcc2 Fix uses of get_typed_*() in ResourceAllocationFromPool Signed-off-by: Dan Smith diff -r ec285ccf09c1 -r 2669d79e2d29 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 11:14:52 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Mon Nov 19 11:15:22 2007 -0800 @@ -235,6 +235,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *refinst = NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), "ResourceAllocationFromPool", NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:03 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:03 -0700 Subject: [Libvirt-cim] [PATCH 11 of 27] Fix uses of get_typed_*() in AllocationCapabilities In-Reply-To: Message-ID: <1b453297885197a4b629.1195500363@theine> # HG changeset patch # User Dan Smith # Date 1195498882 28800 # Node ID 1b453297885197a4b629dca9d03ec7377e5cfc09 # Parent 463508334518aaa57a72e5f0b5adc691da009301 Fix uses of get_typed_*() in AllocationCapabilities Signed-off-by: Dan Smith diff -r 463508334518 -r 1b4532978851 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Mon Nov 19 11:00:43 2007 -0800 +++ b/src/Virt_AllocationCapabilities.c Mon Nov 19 11:01:22 2007 -0800 @@ -44,7 +44,9 @@ CMPIStatus get_alloc_cap(const CMPIBroke uint16_t type; int ret; - *inst = get_typed_instance(broker, "AllocationCapabilities", + *inst = get_typed_instance(broker, + CLASSNAME(ref), + "AllocationCapabilities", NAMESPACE(ref)); if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { From danms at us.ibm.com Mon Nov 19 18:26:10 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:10 -0700 Subject: [Libvirt-cim] [PATCH 18 of 27] Fix uses of get_typed_*() in HostedResourcePool In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499464 28800 # Node ID aee029ef5abcbfff7fd730698c145f742de4e218 # Parent 3b7ec9c6323372f82fcad5be76faec50de401b6e Fix uses of get_typed_*() in HostedResourcePool Signed-off-by: Dan Smith diff -r 3b7ec9c63233 -r aee029ef5abc src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Mon Nov 19 11:10:32 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Mon Nov 19 11:11:04 2007 -0800 @@ -103,6 +103,7 @@ static CMPIInstance *make_ref(const CMPI base = class_base_name(info->assoc_class); refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), base, NAMESPACE(ref)); if (refinst != NULL) { From danms at us.ibm.com Mon Nov 19 18:26:14 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:14 -0700 Subject: [Libvirt-cim] [PATCH 22 of 27] Fix uses of get_typed_*() in VSSDComponent In-Reply-To: Message-ID: <906da584d07d8b15e324.1195500374@theine> # HG changeset patch # User Dan Smith # Date 1195499659 28800 # Node ID 906da584d07d8b15e324222de57beeff241aca38 # Parent ec6c39eba07cdfad02b87e66e6b82afb2e5de479 Fix uses of get_typed_*() in VSSDComponent Signed-off-by: Dan Smith diff -r ec6c39eba07c -r 906da584d07d src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Mon Nov 19 11:13:43 2007 -0800 +++ b/src/Virt_VSSDComponent.c Mon Nov 19 11:14:19 2007 -0800 @@ -160,6 +160,7 @@ static CMPIInstance *make_ref(const CMPI CMPIInstance *refinst = NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), "VirtualSystemSettingDataComponent", NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:01 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:01 -0700 Subject: [Libvirt-cim] [PATCH 09 of 27] Fix uses of get_typed_*() in VirtualSystemManagementCapabilities In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195498788 28800 # Node ID eac989ba68973546f17e21be499e9b0de64baf92 # Parent 989ee919bdc85b26f9a454b4ed89e3e42211266d Fix uses of get_typed_*() in VirtualSystemManagementCapabilities Signed-off-by: Dan Smith diff -r 989ee919bdc8 -r eac989ba6897 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Mon Nov 19 10:56:38 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Mon Nov 19 10:59:48 2007 -0800 @@ -105,7 +105,8 @@ CMPIStatus get_vsm_cap(const CMPIBroker goto out; } - classname = get_typed_class("VirtualSystemManagementCapabilities"); + classname = get_typed_class(CLASSNAME(ref), + "VirtualSystemManagementCapabilities"); if (classname == NULL) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, From danms at us.ibm.com Mon Nov 19 18:26:13 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:13 -0700 Subject: [Libvirt-cim] [PATCH 21 of 27] Fix uses of get_typed_*() in ResourcePoolConfigurationCapabilities In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499623 28800 # Node ID ec6c39eba07cdfad02b87e66e6b82afb2e5de479 # Parent c247a785f91edfe2b8a9f2467a44eaddaf2a43d3 Fix uses of get_typed_*() in ResourcePoolConfigurationCapabilities Signed-off-by: Dan Smith diff -r c247a785f91e -r ec6c39eba07c src/Virt_ResourcePoolConfigurationCapabilities.c --- a/src/Virt_ResourcePoolConfigurationCapabilities.c Mon Nov 19 11:12:48 2007 -0800 +++ b/src/Virt_ResourcePoolConfigurationCapabilities.c Mon Nov 19 11:13:43 2007 -0800 @@ -54,6 +54,7 @@ static CMPIStatus get_rpc_cap(const CMPI CMPIInstance *inst; inst = get_typed_instance(broker, + CLASSNAME(reference), "ResourcePoolConfigurationCapabilities", NAMESPACE(reference)); if (inst == NULL) From danms at us.ibm.com Mon Nov 19 18:26:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:09 -0700 Subject: [Libvirt-cim] [PATCH 17 of 27] Fix uses of get_typed_*() in SettingsDefineCapabilities In-Reply-To: Message-ID: <3b7ec9c6323372f82fca.1195500369@theine> # HG changeset patch # User Dan Smith # Date 1195499432 28800 # Node ID 3b7ec9c6323372f82fcad5be76faec50de401b6e # Parent 0912b735d6a65db09f6f9e671bc7cccd5122532c Fix uses of get_typed_*() in SettingsDefineCapabilities Signed-off-by: Dan Smith diff -r 0912b735d6a6 -r 3b7ec9c63233 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 19 11:09:36 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Mon Nov 19 11:10:32 2007 -0800 @@ -706,6 +706,7 @@ static CMPIInstance *sdc_rasd_inst(const goto out; inst = get_typed_instance(broker, + CLASSNAME(ref), "ResourceAllocationSettingData", NAMESPACE(ref)); @@ -820,6 +821,7 @@ static CMPIInstance *make_ref(const CMPI return NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), base, NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:18 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:18 -0700 Subject: [Libvirt-cim] [PATCH 26 of 27] Fix uses of get_typed_*() in HostedService In-Reply-To: Message-ID: <1911ceb455c3a0ed249e.1195500378@theine> # HG changeset patch # User Dan Smith # Date 1195499818 28800 # Node ID 1911ceb455c3a0ed249e4d0eaad750ef8a46aaf8 # Parent 13dd8a2a47e9227b8cf34852914d6f1ca0d61db0 Fix uses of get_typed_*() in HostedService Signed-off-by: Dan Smith diff -r 13dd8a2a47e9 -r 1911ceb455c3 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Mon Nov 19 11:16:06 2007 -0800 +++ b/src/Virt_HostedService.c Mon Nov 19 11:16:58 2007 -0800 @@ -89,6 +89,7 @@ static CMPIInstance *make_ref(const CMPI goto out; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), base, NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:08 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:08 -0700 Subject: [Libvirt-cim] [PATCH 16 of 27] Fix uses of get_typed_*() in DevicePool In-Reply-To: Message-ID: <0912b735d6a65db09f6f.1195500368@theine> # HG changeset patch # User Dan Smith # Date 1195499376 28800 # Node ID 0912b735d6a65db09f6f9e671bc7cccd5122532c # Parent b58e0f79b99e8c9eaedb7a9c2b4dbd194afc2a8d Fix uses of get_typed_*() in DevicePool Signed-off-by: Dan Smith diff -r b58e0f79b99e -r 0912b735d6a6 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Nov 19 11:05:29 2007 -0800 +++ b/src/Virt_DevicePool.c Mon Nov 19 11:09:36 2007 -0800 @@ -345,7 +345,10 @@ static CMPIStatus mempool_instance(virCo return s; } - inst = get_typed_instance(broker, "MemoryPool", ns); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "MemoryPool", + ns); mempool_set_total(inst, conn); mempool_set_reserved(inst, conn); @@ -380,7 +383,10 @@ static CMPIStatus procpool_instance(virC return s; } - inst = get_typed_instance(broker, "ProcessorPool", ns); + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "ProcessorPool", + ns); procpool_set_total(inst, conn); set_units(inst, "Processors"); @@ -399,13 +405,17 @@ static CMPIStatus _netpool_for_bridge(st static CMPIStatus _netpool_for_bridge(struct inst_list *list, const char *ns, const char *bridge, + const char *refcn, const CMPIBroker *broker) { char *id = NULL; uint16_t type = CIM_RASD_TYPE_NET; CMPIInstance *inst; - inst = get_typed_instance(broker, "NetworkPool", ns); + inst = get_typed_instance(broker, + refcn, + "NetworkPool", + ns); if (asprintf(&id, "NetworkPool/%s", bridge) == -1) return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL}; @@ -440,7 +450,11 @@ static CMPIStatus netpool_instance(virCo "No such network pool `%s'", id); goto out; } - return _netpool_for_bridge(list, ns, id, broker); + return _netpool_for_bridge(list, + ns, + id, + pfx_from_conn(conn), + broker); } bridges = list_bridges(); @@ -448,7 +462,11 @@ static CMPIStatus netpool_instance(virCo return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL}; for (i = 0; bridges[i]; i++) { - _netpool_for_bridge(list, ns, bridges[i], broker); + _netpool_for_bridge(list, + ns, + bridges[i], + pfx_from_conn(conn), + broker); free(bridges[i]); } @@ -461,6 +479,7 @@ static CMPIInstance *diskpool_from_path( static CMPIInstance *diskpool_from_path(const char *path, const char *id, const char *ns, + const char *refcn, const CMPIBroker *broker) { CMPIInstance *inst; @@ -470,7 +489,7 @@ static CMPIInstance *diskpool_from_path( uint64_t cap; uint64_t res; - inst = get_typed_instance(broker, "DiskPool", ns); + inst = get_typed_instance(broker, refcn, "DiskPool", ns); if (asprintf(&poolid, "DiskPool/%s", id) == -1) return NULL; @@ -536,6 +555,7 @@ static CMPIStatus diskpool_instance(virC pool = diskpool_from_path(pools[i].path, pools[i].tag, ns, + pfx_from_conn(conn), broker); if (pool != NULL) inst_list_add(list, pool); From danms at us.ibm.com Mon Nov 19 18:26:04 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:04 -0700 Subject: [Libvirt-cim] [PATCH 12 of 27] Fix uses of get_typed_*() in VSSD In-Reply-To: Message-ID: <30e1598a81c47ec7794f.1195500364@theine> # HG changeset patch # User Dan Smith # Date 1195498911 28800 # Node ID 30e1598a81c47ec7794f232cfff1cfbdaa5a5387 # Parent 1b453297885197a4b629dca9d03ec7377e5cfc09 Fix uses of get_typed_*() in VSSD Signed-off-by: Dan Smith diff -r 1b4532978851 -r 30e1598a81c4 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Nov 19 11:01:22 2007 -0800 +++ b/src/Virt_VSSD.c Mon Nov 19 11:01:51 2007 -0800 @@ -108,6 +108,7 @@ CMPIInstance *get_vssd_instance(virDomai CMPIInstance *inst; inst = get_typed_instance(broker, + CLASSNAME(ref), "VirtualSystemSettingData", NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 18:26:11 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:26:11 -0700 Subject: [Libvirt-cim] [PATCH 19 of 27] Fix uses of get_typed_*() in ElementCapabilities In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195499513 28800 # Node ID b717a04e455cd5de99c549482339eb4e56c062d8 # Parent aee029ef5abcbfff7fd730698c145f742de4e218 Fix uses of get_typed_*() in ElementCapabilities Signed-off-by: Dan Smith diff -r aee029ef5abc -r b717a04e455c src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Mon Nov 19 11:11:04 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Mon Nov 19 11:11:53 2007 -0800 @@ -208,7 +208,9 @@ static CMPIStatus pool_to_alloc(const CM goto out; } - inst = get_typed_instance(_BROKER, "AllocationCapabilities", + inst = get_typed_instance(_BROKER, + CLASSNAME(ref), + "AllocationCapabilities", NAMESPACE(ref)); CMSetProperty(inst, "InstanceID", inst_id, CMPI_chars); @@ -240,6 +242,7 @@ static CMPIInstance *make_ref(const CMPI return NULL; refinst = get_typed_instance(_BROKER, + CLASSNAME(ref), base, NAMESPACE(ref)); From danms at us.ibm.com Mon Nov 19 19:30:45 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:30:45 -0800 Subject: [Libvirt-cim] [PATCH 03 of 12] Make ElementAllocatedFromPool use connect_by_classname() In-Reply-To: <4741E15D.50902@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Mon, 19 Nov 2007 11:17:49 -0800") References: <63881b803abfa7a29108.1195494774@theine> <4741E15D.50902@linux.vnet.ibm.com> Message-ID: <87abpaowwq.fsf@theine.beaverton.ibm.com> KR> This is terribly nit-picky.. but why use variables for ns and cn? KR> They only get used once in this function, right? I suppose it KR> does look cleaner though. It is just to clean up the function calls. Also, in lots of these functions, there are already lines that depend on something like 'ns' being passed in, so just setting ns to what it was before reduces the likelihood of breaking something that depends on such semantics. Given how fast I'm going through these, breaking fewer things is a good thing, I think. We do the "const char *ns = NAMESPACE(ref)" thing in lots of other places and it just "feels right" for some reason, but if people disagree and want to set a policy about it, that's fine with me. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 19:47:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 11:47:48 -0800 Subject: [Libvirt-cim] [PATCH] Removing pre-existing parse InstanceID function (parse_instance_id()). This function should have been used instead of writing a new one, however, it doesn't support NULL parameters for the prefix and the local_id In-Reply-To: (Kaitlin Rupert's message of "Mon, 19 Nov 2007 11:17:55 -0700") References: Message-ID: <8763zyow4b.fsf@theine.beaverton.ibm.com> KR> Removing pre-existing parse InstanceID function KR> (parse_instance_id()). Doh! That was my bad :) Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 19:57:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 12:57:54 -0700 Subject: [Libvirt-cim] [PATCH] [RFC] Change interface of cu_return_instance{, name}s Message-ID: # HG changeset patch # User Dan Smith # Date 1195505862 28800 # Node ID f2c751be5069df9eb23a8bdbaafd5d55b3fd24e9 # Parent 25497386647b6e757ed5c8893f2a4c648543829b [RFC] Change interface of cu_return_instance{,name}s to use instance lists instead of null-terminated arrays. These functions existed before we had instance lists, and need to be updated. This will require another wide-sweeping (but trivial) change to libvirt-cim Signed-off-by: Dan Smith diff -r 25497386647b -r f2c751be5069 instance_util.c --- a/instance_util.c Mon Nov 19 08:00:42 2007 -0800 +++ b/instance_util.c Mon Nov 19 12:57:42 2007 -0800 @@ -24,15 +24,15 @@ #include "libcmpiutil.h" unsigned int cu_return_instances(const CMPIResult *results, - CMPIInstance ** const list) + const struct inst_list *list) { unsigned int i; if (list == NULL) return 0; - for (i = 0; list[i] != NULL; i++) - CMReturnInstance(results, list[i]); + for (i = 0; i < list->cur; i++) + CMReturnInstance(results, list->list[i]); return i; } @@ -54,19 +54,17 @@ bool cu_return_instance_name(const CMPIR } unsigned int cu_return_instance_names(const CMPIResult *results, - CMPIInstance ** const list) + const struct inst_list *list) { unsigned int i; - unsigned int c = 0; if (list == NULL) return 0; - for (i = 0; list[i] != NULL; i++) - if (cu_return_instance_name(results, list[i])) - c++; + for (i = 0; i < list->cur; i++) + cu_return_instance_name(results, list->list[i]); - return c; + return i; } static bool _compare_data(const CMPIData *a, const CMPIData *b) diff -r 25497386647b -r f2c751be5069 libcmpiutil.h --- a/libcmpiutil.h Mon Nov 19 08:00:42 2007 -0800 +++ b/libcmpiutil.h Mon Nov 19 12:57:42 2007 -0800 @@ -139,15 +139,18 @@ int cu_get_u16_path(const CMPIObjectPath const char *key, uint16_t *target); +/* Forward declaration */ +struct inst_list; + /** * Return a list of instances * - * @param list A NULL-terminated list of instances * @param results The result list to populate + * @param list A list of instances to return * @returns The number of instances returned */ unsigned int cu_return_instances(const CMPIResult *results, - CMPIInstance ** const list); + const struct inst_list *list); /** * Return an instance object path @@ -163,13 +166,12 @@ bool cu_return_instance_name(const CMPIR /** * Return the object paths of a list of instances * - * @param list A NULL-terminated list of instances * @param results The result list to populate - * @param op The object path + * @param list A list of instances to return (names of) * @returns The number of instance names returned */ unsigned int cu_return_instance_names(const CMPIResult *results, - CMPIInstance ** const list); + const struct inst_list *list); /** * Get a string property of an instance diff -r 25497386647b -r f2c751be5069 std_association.c --- a/std_association.c Mon Nov 19 08:00:42 2007 -0800 +++ b/std_association.c Mon Nov 19 12:57:42 2007 -0800 @@ -217,9 +217,9 @@ static CMPIStatus do_assoc(struct std_as } if (names_only) - cu_return_instance_names(results, list.list); + cu_return_instance_names(results, &list); else - cu_return_instances(results, list.list); + cu_return_instances(results, &list); out: inst_list_free(&list); From grendel at linux.vnet.ibm.com Mon Nov 19 21:01:02 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 19 Nov 2007 16:01:02 -0500 Subject: [Libvirt-cim] [PATCH] [RFC] Change interface of cu_return_instance{, name}s In-Reply-To: References: Message-ID: <4741F98E.4050301@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195505862 28800 > # Node ID f2c751be5069df9eb23a8bdbaafd5d55b3fd24e9 > # Parent 25497386647b6e757ed5c8893f2a4c648543829b > [RFC] Change interface of cu_return_instance{,name}s > to use instance lists instead of null-terminated arrays. These > functions existed before we had instance lists, and need to be > updated. > > This will require another wide-sweeping (but trivial) change to libvirt-cim > > Signed-off-by: Dan Smith > > diff -r 25497386647b -r f2c751be5069 instance_util.c > --- a/instance_util.c Mon Nov 19 08:00:42 2007 -0800 > +++ b/instance_util.c Mon Nov 19 12:57:42 2007 -0800 > @@ -24,15 +24,15 @@ > #include "libcmpiutil.h" > > unsigned int cu_return_instances(const CMPIResult *results, > - CMPIInstance ** const list) > + const struct inst_list *list) > { > unsigned int i; > > if (list == NULL) > return 0; > > - for (i = 0; list[i] != NULL; i++) > - CMReturnInstance(results, list[i]); > + for (i = 0; i < list->cur; i++) > + CMReturnInstance(results, list->list[i]); > > return i; > } > @@ -54,19 +54,17 @@ bool cu_return_instance_name(const CMPIR > } > > unsigned int cu_return_instance_names(const CMPIResult *results, > - CMPIInstance ** const list) > + const struct inst_list *list) > { > unsigned int i; > - unsigned int c = 0; > > if (list == NULL) > return 0; > > - for (i = 0; list[i] != NULL; i++) > - if (cu_return_instance_name(results, list[i])) > - c++; > + for (i = 0; i < list->cur; i++) > + cu_return_instance_name(results, list->list[i]); > > - return c; > + return i; > } > > static bool _compare_data(const CMPIData *a, const CMPIData *b) > diff -r 25497386647b -r f2c751be5069 libcmpiutil.h > --- a/libcmpiutil.h Mon Nov 19 08:00:42 2007 -0800 > +++ b/libcmpiutil.h Mon Nov 19 12:57:42 2007 -0800 > @@ -139,15 +139,18 @@ int cu_get_u16_path(const CMPIObjectPath > const char *key, > uint16_t *target); > > +/* Forward declaration */ > +struct inst_list; > + > /** > * Return a list of instances > * > - * @param list A NULL-terminated list of instances > * @param results The result list to populate > + * @param list A list of instances to return > * @returns The number of instances returned > */ > unsigned int cu_return_instances(const CMPIResult *results, > - CMPIInstance ** const list); > + const struct inst_list *list); > > /** > * Return an instance object path > @@ -163,13 +166,12 @@ bool cu_return_instance_name(const CMPIR > /** > * Return the object paths of a list of instances > * > - * @param list A NULL-terminated list of instances > * @param results The result list to populate > - * @param op The object path > + * @param list A list of instances to return (names of) > * @returns The number of instance names returned > */ > unsigned int cu_return_instance_names(const CMPIResult *results, > - CMPIInstance ** const list); > + const struct inst_list *list); > > /** > * Get a string property of an instance > diff -r 25497386647b -r f2c751be5069 std_association.c > --- a/std_association.c Mon Nov 19 08:00:42 2007 -0800 > +++ b/std_association.c Mon Nov 19 12:57:42 2007 -0800 > @@ -217,9 +217,9 @@ static CMPIStatus do_assoc(struct std_as > } > > if (names_only) > - cu_return_instance_names(results, list.list); > + cu_return_instance_names(results, &list); > else > - cu_return_instances(results, list.list); > + cu_return_instances(results, &list); > > out: > inst_list_free(&list); > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > -- -Jay From grendel at linux.vnet.ibm.com Mon Nov 19 21:03:24 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 19 Nov 2007 16:03:24 -0500 Subject: [Libvirt-cim] [PATCH] [RFC] Change interface of cu_return_instance{, name}s In-Reply-To: References: Message-ID: <4741FA1C.9020703@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195505862 28800 > # Node ID f2c751be5069df9eb23a8bdbaafd5d55b3fd24e9 > # Parent 25497386647b6e757ed5c8893f2a4c648543829b > [RFC] Change interface of cu_return_instance{,name}s > to use instance lists instead of null-terminated arrays. These > functions existed before we had instance lists, and need to be > updated. > > This will require another wide-sweeping (but trivial) change to libvirt-cim > > Signed-off-by: Dan Smith > > Awesome, my first reply had no actual reply in it. I just hit reply then inexplicably pressed send. So here's take two. This looks good, it will hopefully fix a problem I've been having with cu_return_instances, and it makes more sense anyway. I'll do the change to the callers. -- -Jay From kaitlin at linux.vnet.ibm.com Mon Nov 19 21:45:29 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 13:45:29 -0800 Subject: [Libvirt-cim] [PATCH 03 of 12] Make ElementAllocatedFromPool use connect_by_classname() In-Reply-To: <87abpaowwq.fsf@theine.beaverton.ibm.com> References: <63881b803abfa7a29108.1195494774@theine> <4741E15D.50902@linux.vnet.ibm.com> <87abpaowwq.fsf@theine.beaverton.ibm.com> Message-ID: <474203F9.1050502@linux.vnet.ibm.com> Dan Smith wrote: > KR> This is terribly nit-picky.. but why use variables for ns and cn? > KR> They only get used once in this function, right? I suppose it > KR> does look cleaner though. > > It is just to clean up the function calls. Also, in lots of these > functions, there are already lines that depend on something like 'ns' > being passed in, so just setting ns to what it was before reduces the > likelihood of breaking something that depends on such semantics. > Given how fast I'm going through these, breaking fewer things is a > good thing, I think. > > We do the "const char *ns = NAMESPACE(ref)" thing in lots of other > places and it just "feels right" for some reason, but if people > disagree and want to set a policy about it, that's fine with me. > > Sure - this makes sense. I also wasn't sure if it's a style thing. I see it in some places and other places I don't. But either way is fine with me. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Mon Nov 19 21:48:12 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 13:48:12 -0800 Subject: [Libvirt-cim] [PATCH 00 of 12] Finish out the conversion to classname connections In-Reply-To: References: Message-ID: <4742049C.2010701@linux.vnet.ibm.com> Dan Smith wrote: > This fixes the remaining uses of lv_connect() (except for > ComputerSystemIndication, which I'll deal with later). A quick poke seems > to indicate that things still work, but testing would be good. > > Next, I will work on get_typed_instance(), which also needs a per-classname > change so that we don't return Xen_foo instances for non-xen cases. There > are also a lot of fixes needed to prevent classes from returning instances > for the incorrect platform. These would be any that don't depend on a > valid libvirt connection for their work. > I tried to test every provider that you touched. Things looked good by my testing. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Mon Nov 19 21:49:28 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 13:49:28 -0800 Subject: [Libvirt-cim] [PATCH 00 of 27] Fix uses of get_typed_*() In-Reply-To: References: Message-ID: <474204E8.8000104@linux.vnet.ibm.com> Dan Smith wrote: > This is a huge set that changes the semantics of get_typed_class() and > get_typed_instance() to take a reference class name for proper typing. I > have only smoke-tested it, but it fixes several issues with returning > incorrectly-typed instances that I know of. > > A healthy amount of testing would be appreciated :) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Once again tried to test every provider touched. Nice changes. =) +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Mon Nov 19 21:00:33 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 19 Nov 2007 17:00:33 -0400 Subject: [Libvirt-cim] [PATCH] Fix cu_return_foo calls to match new signature Message-ID: <79f43a4ffc38d7227e17.1195509633@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1195507146 18000 # Node ID 79f43a4ffc38d7227e17432b971639ae20f6f6ed # Parent e3b63f17f18169dbd41ef979a86e56b46d8a9ae9 Fix cu_return_foo calls to match new signature. Signed-off-by: Jay Gagnon diff -r e3b63f17f181 -r 79f43a4ffc38 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Nov 19 11:15:49 2007 -0800 +++ b/src/Virt_ComputerSystem.c Mon Nov 19 16:19:06 2007 -0500 @@ -356,9 +356,9 @@ static CMPIStatus return_enum_domains(co } if (names_only) - cu_return_instance_names(results, list.list); + cu_return_instance_names(results, &list); else - cu_return_instances(results, list.list); + cu_return_instances(results, &list); CMSetStatus(&s, CMPI_RC_OK); diff -r e3b63f17f181 -r 79f43a4ffc38 src/Virt_Device.c --- a/src/Virt_Device.c Mon Nov 19 11:15:49 2007 -0800 +++ b/src/Virt_Device.c Mon Nov 19 16:19:06 2007 -0500 @@ -366,9 +366,9 @@ static CMPIStatus enum_devices(const CMP goto out; if (names_only) - cu_return_instance_names(results, list.list); + cu_return_instance_names(results, &list); else - cu_return_instances(results, list.list); + cu_return_instances(results, &list); inst_list_free(&list); diff -r e3b63f17f181 -r 79f43a4ffc38 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Mon Nov 19 11:15:49 2007 -0800 +++ b/src/Virt_DevicePool.c Mon Nov 19 16:19:06 2007 -0500 @@ -602,9 +602,9 @@ static void __return_pool(const CMPIResu bool name_only) { if (name_only) - cu_return_instance_names(results, list->list); + cu_return_instance_names(results, list); else - cu_return_instances(results, list->list); + cu_return_instances(results, list); } static CMPIStatus return_pool(const CMPIObjectPath *ref, From grendel at linux.vnet.ibm.com Mon Nov 19 21:17:21 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 19 Nov 2007 17:17:21 -0400 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work Message-ID: <9e000f9f9096cad7a40b.1195510641@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1195510519 18000 # Node ID 9e000f9f9096cad7a40b1221b467fe99efc4b93f # Parent 79f43a4ffc38d7227e17432b971639ae20f6f6ed Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work. I don't have a ton of experience with instance providers, so this might require a little extra scrutiny as I'm sure there are several rookie mistakes. Signed-off-by: Jay Gagnon diff -r 79f43a4ffc38 -r 9e000f9f9096 src/Makefile.am --- a/src/Makefile.am Mon Nov 19 16:19:06 2007 -0500 +++ b/src/Makefile.am Mon Nov 19 17:15:19 2007 -0500 @@ -91,9 +91,9 @@ libVirt_ElementCapabilities_la_LIBADD = -lVirt_ComputerSystem \ -lVirt_HostSystem -libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la +libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c -libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD +libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c diff -r 79f43a4ffc38 -r 9e000f9f9096 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Mon Nov 19 16:19:06 2007 -0500 +++ b/src/Virt_AllocationCapabilities.c Mon Nov 19 17:15:19 2007 -0500 @@ -32,6 +32,7 @@ #include "Virt_AllocationCapabilities.h" #include "Virt_RASD.h" +#include "Virt_DevicePool.h" const static CMPIBroker *_BROKER; @@ -83,6 +84,88 @@ static CMPIStatus return_alloc_cap(const else CMReturnInstance(results, inst); out: + return s; +} + +static CMPIStatus alloc_cap_instances(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const CMPIResult *results, + bool names_only, + const char **properties) +{ + int i; + virConnectPtr conn; + CMPIInstance *inst; + struct inst_list alloc_cap_list; + struct inst_list device_pool_list; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("In alloc_cap_instances()"); + + inst_list_init(&device_pool_list); + inst_list_init(&alloc_cap_list); + + if (!provider_is_responsible(broker, ref, &s)) + goto out; + + conn = lv_connect(_BROKER, &s); + if (conn == NULL) + goto out; + + for (i = 0; device_pool_names[i]; i++) { + s = get_pool_by_type(broker, + conn, + device_pool_names[i], + NAMESPACE(ref), + &device_pool_list); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error fetching device pools"); + goto out; + } + } + + for (i = 0; i < device_pool_list.cur; i++) { + inst = get_typed_instance(broker, + "AllocationCapabilities", + NAMESPACE(ref)); + if (inst == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get alloc_cap instance"); + goto out; + } + + s = cu_copy_prop(broker, device_pool_list.list[i], inst, + "InstanceID", NULL); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error copying InstanceID"); + goto out; + } + + s = cu_copy_prop(broker, device_pool_list.list[i], inst, + "ResourceType", NULL); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error copying InstanceID"); + goto out; + } + + inst_list_add(&alloc_cap_list, inst); + } + + if (names_only) + cu_return_instance_names(results, &alloc_cap_list); + else + cu_return_instances(results, &alloc_cap_list); + + out: + inst_list_free(&alloc_cap_list); + inst_list_free(&device_pool_list); return s; } @@ -95,8 +178,23 @@ static CMPIStatus GetInstance(CMPIInstan return return_alloc_cap(reference, results, 0); } -DEFAULT_EI(); -DEFAULT_EIN(); +static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference) +{ + return alloc_cap_instances(_BROKER, reference, results, true, NULL); +} + +static CMPIStatus EnumInstances(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const char **properties) +{ + return alloc_cap_instances(_BROKER, reference, results, false, properties); +} + DEFAULT_CI(); DEFAULT_MI(); DEFAULT_DI(); From danms at us.ibm.com Mon Nov 19 22:20:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 14:20:30 -0800 Subject: [Libvirt-cim] [PATCH] Fix cu_return_foo calls to match new signature In-Reply-To: <79f43a4ffc38d7227e17.1195509633@wulfgar> (Jay Gagnon's message of "Mon, 19 Nov 2007 17:00:33 -0400") References: <79f43a4ffc38d7227e17.1195509633@wulfgar> Message-ID: <871walq3m9.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1195507146 18000 JG> # Node ID 79f43a4ffc38d7227e17432b971639ae20f6f6ed JG> # Parent e3b63f17f18169dbd41ef979a86e56b46d8a9ae9 JG> Fix cu_return_foo calls to match new signature. JG> Virt_ComputerSystem.c | 4 ++-- JG> Virt_Device.c | 4 ++-- JG> Virt_DevicePool.c | 4 ++-- JG> 3 files changed, 6 insertions(+), 6 deletions(-) I don't think this is all of them. My count looks like this: % grep cu_return src/*.c | cut -d : -f 1 | sort | uniq | wc -l 12 -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 22:28:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 14:28:48 -0800 Subject: [Libvirt-cim] [PATCH] Fix cu_return_foo calls to match new signature In-Reply-To: <871walq3m9.fsf@theine.beaverton.ibm.com> (Dan Smith's message of "Mon, 19 Nov 2007 14:20:30 -0800") References: <79f43a4ffc38d7227e17.1195509633@wulfgar> <871walq3m9.fsf@theine.beaverton.ibm.com> Message-ID: <87tznhoonz.fsf@theine.beaverton.ibm.com> DS> I don't think this is all of them. My count looks like this: Nevermind. Duh. Applied :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 19 22:45:24 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 19 Nov 2007 14:45:24 -0800 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work References: <9e000f9f9096cad7a40b.1195510641@wulfgar> Message-ID: <87ir3xonwb.fsf@theine.beaverton.ibm.com> JG> + for (i = 0; device_pool_names[i]; i++) { JG> + s = get_pool_by_type(broker, JG> + conn, JG> + device_pool_names[i], JG> + NAMESPACE(ref), JG> + &device_pool_list); JG> + if (s.rc != CMPI_RC_OK) { JG> + cu_statusf(broker, &s, JG> + CMPI_RC_ERR_FAILED, JG> + "Error fetching device pools"); JG> + goto out; JG> + } JG> + } We do this elsewhere too. Perhaps we need a get_all_pools() function in Virt_DevicePool? JG> + JG> + for (i = 0; i < device_pool_list.cur; i++) { JG> + inst = get_typed_instance(broker, JG> + "AllocationCapabilities", JG> + NAMESPACE(ref)); JG> + if (inst == NULL) { JG> + cu_statusf(broker, &s, JG> + CMPI_RC_ERR_FAILED, JG> + "Could not get alloc_cap instance"); JG> + goto out; JG> + } JG> + JG> + s = cu_copy_prop(broker, device_pool_list.list[i], inst, JG> + "InstanceID", NULL); This function looks great, but I think we're missing the patch that adds it to libcmpiutil :) JG> + if (s.rc != CMPI_RC_OK) { JG> + cu_statusf(broker, &s, JG> + CMPI_RC_ERR_FAILED, JG> + "Error copying InstanceID"); JG> + goto out; JG> + } JG> + JG> + s = cu_copy_prop(broker, device_pool_list.list[i], inst, JG> + "ResourceType", NULL); JG> + if (s.rc != CMPI_RC_OK) { JG> + cu_statusf(broker, &s, JG> + CMPI_RC_ERR_FAILED, JG> + "Error copying InstanceID"); JG> + goto out; JG> + } JG> + JG> + inst_list_add(&alloc_cap_list, inst); JG> + } To reduce the size of this loop, and to be in line with our other instance providers, I think it would be good to define a function that looks something like this: CMPIStatus get_ac_instance(CMPIInstance *pool, CMPIInstance **ac); This would encapsulate things a bit and also would provide a clean hook for ElementCapabilities, which will need to, given a pool, get an instance of AllocationCapabilities. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Mon Nov 19 23:23:42 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 15:23:42 -0800 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <9e000f9f9096cad7a40b.1195510641@wulfgar> References: <9e000f9f9096cad7a40b.1195510641@wulfgar> Message-ID: <47421AFE.9010505@linux.vnet.ibm.com> Jay Gagnon wrote: > + conn = lv_connect(_BROKER, &s); > + if (conn == NULL) > + goto out; > > Just a minor suggestion.. should lv_connect() be connect_by_classname() instead? =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Tue Nov 20 06:43:19 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 23:43:19 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Updated ElementSettingData to support RASD instances. Message-ID: From kaitlin at linux.vnet.ibm.com Tue Nov 20 06:43:20 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 23:43:20 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: Message-ID: <5bbff08351e4c05cb8ce.1195544600@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195544369 28800 # Node ID 5bbff08351e4c05cb8ce63fe905f6742adc9b119 # Parent a71690c7cf6caae2a3f55461980159b8d8fb92e3 Add get_rasd_instance_from_ref() to RASD. This allows other providers to get a specific RASD instance without having to do a CBGetInstance(). Signed-off-by: Kaitlin Rupert diff -r a71690c7cf6c -r 5bbff08351e4 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Nov 19 23:39:25 2007 -0800 +++ b/src/Virt_RASD.c Mon Nov 19 23:39:29 2007 -0800 @@ -176,6 +176,7 @@ static CMPIInstance *rasd_from_vdev(cons static CMPIInstance *get_rasd_instance(const CMPIContext *context, const CMPIObjectPath *ns, + const CMPIBroker *broker, const char *id, const uint16_t type) { @@ -191,13 +192,13 @@ static CMPIInstance *get_rasd_instance(c if (!ret) return NULL; - conn = lv_connect(_BROKER, &s); + conn = lv_connect(broker, &s); if (conn == NULL) goto out; dev = find_dev(conn, type, host, devid); if (dev) - inst = rasd_from_vdev(_BROKER, dev, host, NAMESPACE(ns)); + inst = rasd_from_vdev(broker, dev, host, NAMESPACE(ns)); out: virConnectClose(conn); @@ -235,6 +236,38 @@ CMPIrc rasd_type_from_classname(const ch return rc; } +CMPIInstance *get_rasd_instance_from_ref(const CMPIContext *context, + const CMPIObjectPath *ref, + const CMPIBroker *broker) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + char *id = NULL; + uint16_t type; + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID"); + goto out; + } + + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine RASD type"); + goto out; + } + + inst = get_rasd_instance(context, ref, broker, id, type); + + out: + free(id); + + return inst; +} + static CMPIStatus GetInstance(CMPIInstanceMI *self, const CMPIContext *context, const CMPIResult *results, @@ -243,25 +276,8 @@ static CMPIStatus GetInstance(CMPIInstan { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - char *id = NULL; - uint16_t type; - - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing InstanceID"); - goto out; - } - - if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to determine RASD type"); - goto out; - } - - inst = get_rasd_instance(context, ref, id, type); + + inst = get_rasd_instance_from_ref(context, ref, _BROKER); if (inst != NULL) CMReturnInstance(results, inst); @@ -269,7 +285,6 @@ static CMPIStatus GetInstance(CMPIInstan cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Unknown instance"); - out: return s; } diff -r a71690c7cf6c -r 5bbff08351e4 src/Virt_RASD.h --- a/src/Virt_RASD.h Mon Nov 19 23:39:25 2007 -0800 +++ b/src/Virt_RASD.h Mon Nov 19 23:39:29 2007 -0800 @@ -29,6 +29,10 @@ int rasds_for_domain(const CMPIBroker *b struct inst_list *_list); CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); +CMPIInstance *get_rasd_instance_from_ref(const CMPIContext *context, + const CMPIObjectPath *ref, + const CMPIBroker *broker); + #endif /* From kaitlin at linux.vnet.ibm.com Tue Nov 20 06:43:21 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 19 Nov 2007 23:43:21 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195544365 28800 # Node ID a71690c7cf6caae2a3f55461980159b8d8fb92e3 # Parent 8cbe28df0e8e53c34c38620ce169dcea4091e72e Adding the RASD related part. This is based on the Resource Allocation Profile. My understanding is that we are implementing a setup similar to Figure 3 on page 31. In this case, we'll use the same RASD instance for State as well as Defined. Signed-off-by: Kaitlin Rupert diff -r 8cbe28df0e8e -r a71690c7cf6c src/Makefile.am --- a/src/Makefile.am Mon Nov 19 16:19:06 2007 -0500 +++ b/src/Makefile.am Mon Nov 19 23:39:25 2007 -0800 @@ -135,4 +135,4 @@ libVirt_HostedService_la_LIBADD = -lVirt libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c -libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD -lVirt_RASD diff -r 8cbe28df0e8e -r a71690c7cf6c src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Mon Nov 19 16:19:06 2007 -0500 +++ b/src/Virt_ElementSettingData.c Mon Nov 19 23:39:25 2007 -0800 @@ -31,6 +31,7 @@ #include "misc_util.h" #include "Virt_VSSD.h" +#include "Virt_RASD.h" const static CMPIBroker *_BROKER; @@ -83,6 +84,28 @@ static CMPIStatus vssd_to_sd(const CMPIO return s; } +static CMPIStatus rasd_to_sd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + inst = get_rasd_instance_from_ref(info->context, ref, _BROKER); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting associated RASD"); + } + + else + inst_list_add(list, inst); + + return s; +} + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, @@ -129,7 +152,7 @@ out: return refinst; } -static struct std_assoc vssd_to_sd_fd_bkwd = { +static struct std_assoc vssd_to_vssd = { .source_class = "CIM_VirtualSystemSettingData", .source_prop = "ManagedElement", @@ -142,8 +165,22 @@ static struct std_assoc vssd_to_sd_fd_bk .make_ref = make_ref }; +static struct std_assoc rasd_to_rasd = { + .source_class = "CIM_ResourceAllocationSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = rasd_to_sd, + .make_ref = make_ref +}; + static struct std_assoc *handlers[] = { - &vssd_to_sd_fd_bkwd, + &vssd_to_vssd, + &rasd_to_rasd, NULL }; From heidieck at linux.vnet.ibm.com Tue Nov 20 09:21:02 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 20 Nov 2007 10:21:02 +0100 Subject: [Libvirt-cim] [PATCH 00 of 12] Finish out the conversion to classname connections In-Reply-To: References: Message-ID: <4742A6FE.7050706@linux.vnet.ibm.com> Dan Smith wrote: > This fixes the remaining uses of lv_connect() (except for > ComputerSystemIndication, which I'll deal with later). A quick poke seems > to indicate that things still work, but testing would be good. > > Next, I will work on get_typed_instance(), which also needs a per-classname > change so that we don't return Xen_foo instances for non-xen cases. There > are also a lot of fixes needed to prevent classes from returning instances > for the incorrect platform. These would be any that don't depend on a > valid libvirt connection for their work. All patches applied and compiled fine (FC6, sfcb). +1 While testing I found some minor issues ... with duplicated instances and some other interesting behavior. Will test further with the get_typed_instance() stuff. But this should not prevent you from checking these patches in ;). -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 20 12:21:29 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 20 Nov 2007 13:21:29 +0100 Subject: [Libvirt-cim] [PATCH 00 of 27] Fix uses of get_typed_*() In-Reply-To: References: Message-ID: <4742D149.7020206@linux.vnet.ibm.com> Dan Smith wrote: > This is a huge set that changes the semantics of get_typed_class() and > get_typed_instance() to take a reference class name for proper typing. I > have only smoke-tested it, but it fixes several issues with returning > incorrectly-typed instances that I know of. > > A healthy amount of testing would be appreciated :) > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim > Applied and tested fine - nothing got broken. +1 Only patch #1 had some problems to apply, but nothing was rejected. The issues encountered before got not fixed. I'm even not sure, if they have already been there before this huge amount of patches. So I will investigate further into them ... try to send patches as soon as possible. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From grendel at linux.vnet.ibm.com Tue Nov 20 14:53:37 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 09:53:37 -0500 Subject: [Libvirt-cim] [PATCH] Fix cu_return_foo calls to match new signature In-Reply-To: <87tznhoonz.fsf@theine.beaverton.ibm.com> References: <79f43a4ffc38d7227e17.1195509633@wulfgar> <871walq3m9.fsf@theine.beaverton.ibm.com> <87tznhoonz.fsf@theine.beaverton.ibm.com> Message-ID: <4742F4F1.8080307@linux.vnet.ibm.com> Dan Smith wrote: > DS> I don't think this is all of them. My count looks like this: > > Nevermind. Duh. Applied :) > > > ------------------------------------------------------------------------ > > _______________________________________________ > Libvirt-cim mailing list > Libvirt-cim at redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-cim Heh, I was surprised too. I actually only realized that half of them were single instances when I went to replace "list.list" and found "inst" instead. :) -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 20 14:57:10 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 09:57:10 -0500 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <87ir3xonwb.fsf@theine.beaverton.ibm.com> References: <9e000f9f9096cad7a40b.1195510641@wulfgar> <87ir3xonwb.fsf@theine.beaverton.ibm.com> Message-ID: <4742F5C6.8030001@linux.vnet.ibm.com> Dan Smith wrote: > JG> + for (i = 0; device_pool_names[i]; i++) { > JG> + s = get_pool_by_type(broker, > JG> + conn, > JG> + device_pool_names[i], > JG> + NAMESPACE(ref), > JG> + &device_pool_list); > JG> + if (s.rc != CMPI_RC_OK) { > JG> + cu_statusf(broker, &s, > JG> + CMPI_RC_ERR_FAILED, > JG> + "Error fetching device pools"); > JG> + goto out; > JG> + } > JG> + } > > We do this elsewhere too. Perhaps we need a get_all_pools() function > in Virt_DevicePool? > Sounds reasonable. I'll do that. > JG> + > JG> + for (i = 0; i < device_pool_list.cur; i++) { > JG> + inst = get_typed_instance(broker, > JG> + "AllocationCapabilities", > JG> + NAMESPACE(ref)); > JG> + if (inst == NULL) { > JG> + cu_statusf(broker, &s, > JG> + CMPI_RC_ERR_FAILED, > JG> + "Could not get alloc_cap instance"); > JG> + goto out; > JG> + } > JG> + > JG> + s = cu_copy_prop(broker, device_pool_list.list[i], inst, > JG> + "InstanceID", NULL); > > This function looks great, but I think we're missing the patch that > adds it to libcmpiutil :) > Oops. I'll send that out when I send the next iteration of this. > JG> + if (s.rc != CMPI_RC_OK) { > JG> + cu_statusf(broker, &s, > JG> + CMPI_RC_ERR_FAILED, > JG> + "Error copying InstanceID"); > JG> + goto out; > JG> + } > JG> + > JG> + s = cu_copy_prop(broker, device_pool_list.list[i], inst, > JG> + "ResourceType", NULL); > JG> + if (s.rc != CMPI_RC_OK) { > JG> + cu_statusf(broker, &s, > JG> + CMPI_RC_ERR_FAILED, > JG> + "Error copying InstanceID"); > JG> + goto out; > JG> + } > JG> + > JG> + inst_list_add(&alloc_cap_list, inst); > JG> + } > > To reduce the size of this loop, and to be in line with our other > instance providers, I think it would be good to define a function that > looks something like this: > > CMPIStatus get_ac_instance(CMPIInstance *pool, CMPIInstance **ac); > > This would encapsulate things a bit and also would provide a clean > hook for ElementCapabilities, which will need to, given a pool, get an > instance of AllocationCapabilities. > Sure, no problem. Given all the inexplicable struggle getting that bit working I guess I didn't want to look at it anymore, so the lack of encapsulation didn't really strike me. Easy fix though, and good call. -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 20 14:59:07 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 09:59:07 -0500 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <47421AFE.9010505@linux.vnet.ibm.com> References: <9e000f9f9096cad7a40b.1195510641@wulfgar> <47421AFE.9010505@linux.vnet.ibm.com> Message-ID: <4742F63B.4020100@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Jay Gagnon wrote: >> + conn = lv_connect(_BROKER, &s); >> + if (conn == NULL) >> + goto out; >> >> > Just a minor suggestion.. should lv_connect() be > connect_by_classname() instead? =) > Honestly, I wasn't really sure on if there had been a resolution on that front yet, and it was working fine for testing purposes with lv_connect, so I figured I could always fix it later when the final word came down on lv_connect versus connect_by_classname. Have we settled on one yet? -- -Jay From danms at us.ibm.com Tue Nov 20 15:12:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 07:12:15 -0800 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <4742F63B.4020100@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 20 Nov 2007 09:59:07 -0500") References: <9e000f9f9096cad7a40b.1195510641@wulfgar> <47421AFE.9010505@linux.vnet.ibm.com> <4742F63B.4020100@linux.vnet.ibm.com> Message-ID: <87abp9ne7k.fsf@theine.beaverton.ibm.com> JG> Honestly, I wasn't really sure on if there had been a resolution JG> on that front yet, and it was working fine for testing purposes JG> with lv_connect, so I figured I could always fix it later when the JG> final word came down on lv_connect versus connect_by_classname. JG> Have we settled on one yet? Yep, you should tweak this to use connect_by_classname() now, as I just pushed that set out to the tree. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 20 14:36:29 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 07:36:29 -0700 Subject: [Libvirt-cim] [PATCH] More rpm changes, per Fedora package review process Message-ID: <820db60ea59d76e6fc20.1195572989@theine> # HG changeset patch # User Dan Smith # Date 1195572986 28800 # Node ID 820db60ea59d76e6fc2080ba3f2851415191fc76 # Parent f2c751be5069df9eb23a8bdbaafd5d55b3fd24e9 More rpm changes, per Fedora package review process Signed-off-by: Dan Smith diff -r f2c751be5069 -r 820db60ea59d libcmpiutil.spec.in --- a/libcmpiutil.spec.in Mon Nov 19 12:57:42 2007 -0800 +++ b/libcmpiutil.spec.in Tue Nov 20 07:36:26 2007 -0800 @@ -4,7 +4,7 @@ Name: libcmpiutil Name: libcmpiutil Version: @PACKAGE_VERSION@ Release: 1%{?dist}%{?extra_release} -License: LGPL +License: LGPLv2+ Group: Development/Libraries Source: libcmpiutil-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -26,6 +26,7 @@ Group: Development/Libraries Group: Development/Libraries Requires: tog-pegasus-devel Requires: pkgconfig +Requires: %{name} = %{version}-%{release} %description devel Includes and documentations for the CMPI utility library @@ -36,42 +37,41 @@ instance properties to standardizing met %prep %setup -q +chmod -x *.c *.y *.h *.l %build %configure -make +make %{?_smp_mflags} %install -rm -fr %{buildroot} +rm -fr $RPM_BUILD_ROOT -%makeinstall +make DESTDIR=$RPM_BUILD_ROOT install rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a %clean -rm -fr %{buildroot} +rm -fr $RPM_BUILD_ROOT -%post -/sbin/ldconfig +%post -p /sbin/ldconfig -%postun -/sbin/ldconfig +%postun -p /sbin/ldconfig %files %defattr(-, root, root) -%doc doc/doxygen.conf doc/mainpage doc/SubmittingPatches README +%doc doc/doxygen.conf doc/mainpage README %{_libdir}/lib*.so.* %files devel %defattr(-, root, root) %{_libdir}/lib*.so -%dir %{_includedir}/ +%dir %{_includedir}/libcmpiutil %{_includedir}/libcmpiutil/*.h %{_libdir}/pkgconfig/libcmpiutil.pc -%doc doc/doxygen.conf doc/mainpage doc/SubmittingPatches README +%doc doc/SubmittingPatches %changelog * Fri Oct 26 2007 Daniel Veillard - 0.1-1 From grendel at linux.vnet.ibm.com Tue Nov 20 18:57:36 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 14:57:36 -0400 Subject: [Libvirt-cim] [PATCH 0 of 2] AllocationCapabilities fixes, second iteration Message-ID: I did the get_all_pools as a separate patch since it's not strictly related to the alloc cap fixes. It can be applied without the alloc cap fixes if there are still problems with them. From grendel at linux.vnet.ibm.com Tue Nov 20 18:57:37 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 14:57:37 -0400 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_all_pools to Virt_DevicePool, which gets every pool it can find, per Dan's suggestion In-Reply-To: Message-ID: <2e1dc075f0a9996bfdd2.1195588657@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1195588594 18000 # Node ID 2e1dc075f0a9996bfdd2f437928d261081c1f9d6 # Parent 97e1dd20b2d02b5b542ec830093954f265ae844f Add get_all_pools to Virt_DevicePool, which gets every pool it can find, per Dan's suggestion. Signed-off-by: Jay Gagnon diff -r 97e1dd20b2d0 -r 2e1dc075f0a9 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue Nov 20 06:41:27 2007 -0800 +++ b/src/Virt_DevicePool.c Tue Nov 20 14:56:34 2007 -0500 @@ -624,6 +624,28 @@ CMPIInstance *get_pool_by_id(const CMPIB return inst; } +CMPIStatus get_all_pools(const CMPIBroker *broker, + virConnectPtr conn, + const char *ns, + struct inst_list *list) +{ + int i; + CMPIStatus s = {CMPI_RC_OK}; + + for (i = 0; device_pool_names[i]; i++) { + s = get_pool_by_type(broker, + conn, + device_pool_names[i], + ns, + list); + if (s.rc != CMPI_RC_OK) + goto out; + } + + out: + return s; +} + static void __return_pool(const CMPIResult *results, struct inst_list *list, bool name_only) diff -r 97e1dd20b2d0 -r 2e1dc075f0a9 src/Virt_DevicePool.h --- a/src/Virt_DevicePool.h Tue Nov 20 06:41:27 2007 -0800 +++ b/src/Virt_DevicePool.h Tue Nov 20 14:56:34 2007 -0500 @@ -55,6 +55,18 @@ char *pool_member_of(const CMPIBroker *b uint16_t type, const char *id); +/** + * Get all device pools on the system for the given connection + * + * @param broker The current Broker + * @param conn The libvirt connection to use + * @param ns Namespace for the pools + * @param list Return instances in this struct + */ +CMPIStatus get_all_pools(const CMPIBroker *broker, + virConnectPtr conn, + const char *ns, + struct inst_list *list); #endif /* From grendel at linux.vnet.ibm.com Tue Nov 20 18:57:38 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 14:57:38 -0400 Subject: [Libvirt-cim] [PATCH 2 of 2] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: Message-ID: <5c397cd8e30335d08fd0.1195588658@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1195588594 18000 # Node ID 5c397cd8e30335d08fd0cdf5716856619164a6f4 # Parent 2e1dc075f0a9996bfdd2f437928d261081c1f9d6 Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work. This should include all the suggestions from the first iteration. Signed-off-by: Jay Gagnon diff -r 2e1dc075f0a9 -r 5c397cd8e303 src/Makefile.am --- a/src/Makefile.am Tue Nov 20 14:56:34 2007 -0500 +++ b/src/Makefile.am Tue Nov 20 14:56:34 2007 -0500 @@ -91,9 +91,9 @@ libVirt_ElementCapabilities_la_LIBADD = -lVirt_ComputerSystem \ -lVirt_HostSystem -libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la +libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c -libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD +libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c diff -r 2e1dc075f0a9 -r 5c397cd8e303 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Tue Nov 20 14:56:34 2007 -0500 +++ b/src/Virt_AllocationCapabilities.c Tue Nov 20 14:56:34 2007 -0500 @@ -32,6 +32,7 @@ #include "Virt_AllocationCapabilities.h" #include "Virt_RASD.h" +#include "Virt_DevicePool.h" const static CMPIBroker *_BROKER; @@ -85,6 +86,100 @@ static CMPIStatus return_alloc_cap(const else CMReturnInstance(results, inst); out: + return s; +} + +static CMPIStatus ac_from_pool(const CMPIBroker *broker, + const CMPIObjectPath *ref, + CMPIInstance *pool, + CMPIInstance **alloc_cap) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + *alloc_cap = get_typed_instance(broker, + CLASSNAME(ref), + "AllocationCapabilities", + NAMESPACE(ref)); + if (*alloc_cap == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get alloc_cap instance"); + goto out; + } + + s = cu_copy_prop(broker, pool, *alloc_cap, "InstanceID", NULL); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error copying InstanceID"); + goto out; + } + + s = cu_copy_prop(broker, pool, *alloc_cap, "ResourceType", NULL); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error copying InstanceID"); + goto out; + } + out: + return s; +} + +static CMPIStatus alloc_cap_instances(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const CMPIResult *results, + bool names_only, + const char **properties) +{ + int i; + virConnectPtr conn; + CMPIInstance *alloc_cap_inst; + struct inst_list alloc_cap_list; + struct inst_list device_pool_list; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("In alloc_cap_instances()"); + + inst_list_init(&device_pool_list); + inst_list_init(&alloc_cap_list); + + if (!provider_is_responsible(broker, ref, &s)) + goto out; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not connect to hypervisor"); + goto out; + } + + s = get_all_pools(broker, conn, NAMESPACE(ref), &device_pool_list); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error fetching device pools"); + goto out; + } + + for (i = 0; i < device_pool_list.cur; i++) { + s = ac_from_pool(broker, ref, + device_pool_list.list[i], + &alloc_cap_inst); + if (s.rc != CMPI_RC_OK) + goto out; + + inst_list_add(&alloc_cap_list, alloc_cap_inst); + } + + if (names_only) + cu_return_instance_names(results, &alloc_cap_list); + else + cu_return_instances(results, &alloc_cap_list); + + out: + inst_list_free(&alloc_cap_list); + inst_list_free(&device_pool_list); return s; } @@ -97,8 +192,23 @@ static CMPIStatus GetInstance(CMPIInstan return return_alloc_cap(reference, results, 0); } -DEFAULT_EI(); -DEFAULT_EIN(); +static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference) +{ + return alloc_cap_instances(_BROKER, reference, results, true, NULL); +} + +static CMPIStatus EnumInstances(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const char **properties) +{ + return alloc_cap_instances(_BROKER, reference, results, false, properties); +} + DEFAULT_CI(); DEFAULT_MI(); DEFAULT_DI(); From grendel at linux.vnet.ibm.com Tue Nov 20 20:06:33 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 15:06:33 -0500 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: References: Message-ID: <47433E49.7090107@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1195544365 28800 > # Node ID a71690c7cf6caae2a3f55461980159b8d8fb92e3 > # Parent 8cbe28df0e8e53c34c38620ce169dcea4091e72e > Adding the RASD related part. > > This is based on the Resource Allocation Profile. My understanding is that we are implementing a setup similar to Figure 3 on page 31. In this case, we'll use the same RASD instance for State as well as Defined. > > Signed-off-by: Kaitlin Rupert > > > Looks good, +1. -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 20 20:07:11 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 15:07:11 -0500 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: <5bbff08351e4c05cb8ce.1195544600@elm3b41.beaverton.ibm.com> References: <5bbff08351e4c05cb8ce.1195544600@elm3b41.beaverton.ibm.com> Message-ID: <47433E6F.7000706@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1195544369 28800 > # Node ID 5bbff08351e4c05cb8ce63fe905f6742adc9b119 > # Parent a71690c7cf6caae2a3f55461980159b8d8fb92e3 > Add get_rasd_instance_from_ref() to RASD. > > This allows other providers to get a specific RASD instance without having to do a CBGetInstance(). > > Signed-off-by: Kaitlin Rupert > > diff -r a71690c7cf6c -r 5bbff08351e4 src/Virt_RASD.c > --- a/src/Virt_RASD.c Mon Nov 19 23:39:25 2007 -0800 > +++ b/src/Virt_RASD.c Mon Nov 19 23:39:29 2007 -0800 > @@ -176,6 +176,7 @@ static CMPIInstance *rasd_from_vdev(cons > > static CMPIInstance *get_rasd_instance(const CMPIContext *context, > const CMPIObjectPath *ns, > + const CMPIBroker *broker, > const char *id, > const uint16_t type) > { > @@ -191,13 +192,13 @@ static CMPIInstance *get_rasd_instance(c > if (!ret) > return NULL; > > - conn = lv_connect(_BROKER, &s); > + conn = lv_connect(broker, &s); > > Should this part be connect_by_classname() now? Other than that, looks great. -- -Jay From kaitlin at linux.vnet.ibm.com Tue Nov 20 20:52:57 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 20 Nov 2007 12:52:57 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: <47433E6F.7000706@linux.vnet.ibm.com> References: <5bbff08351e4c05cb8ce.1195544600@elm3b41.beaverton.ibm.com> <47433E6F.7000706@linux.vnet.ibm.com> Message-ID: <47434929.8020906@linux.vnet.ibm.com> Jay Gagnon wrote: > Kaitlin Rupert wrote: > >> # HG changeset patch >> # User Kaitlin Rupert >> # Date 1195544369 28800 >> # Node ID 5bbff08351e4c05cb8ce63fe905f6742adc9b119 >> # Parent a71690c7cf6caae2a3f55461980159b8d8fb92e3 >> Add get_rasd_instance_from_ref() to RASD. >> >> This allows other providers to get a specific RASD instance without having to do a CBGetInstance(). >> >> Signed-off-by: Kaitlin Rupert >> >> diff -r a71690c7cf6c -r 5bbff08351e4 src/Virt_RASD.c >> --- a/src/Virt_RASD.c Mon Nov 19 23:39:25 2007 -0800 >> +++ b/src/Virt_RASD.c Mon Nov 19 23:39:29 2007 -0800 >> @@ -176,6 +176,7 @@ static CMPIInstance *rasd_from_vdev(cons >> >> static CMPIInstance *get_rasd_instance(const CMPIContext *context, >> const CMPIObjectPath *ns, >> + const CMPIBroker *broker, >> const char *id, >> const uint16_t type) >> { >> @@ -191,13 +192,13 @@ static CMPIInstance *get_rasd_instance(c >> if (!ret) >> return NULL; >> >> - conn = lv_connect(_BROKER, &s); >> + conn = lv_connect(broker, &s); >> >> >> > Should this part be connect_by_classname() now? Other than that, looks > great. > > > Yes, thanks. I think I didn't have the connect_by_classname() patch applied when I generated this. I'll synch up my tree and resend.. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Tue Nov 20 21:08:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 20 Nov 2007 13:08:49 -0800 Subject: [Libvirt-cim] [PATCH 2 of 2] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <5c397cd8e30335d08fd0.1195588658@wulfgar> References: <5c397cd8e30335d08fd0.1195588658@wulfgar> Message-ID: <47434CE1.4040706@linux.vnet.ibm.com> Jay Gagnon wrote: > + > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + if (conn == NULL) { > + cu_statusf(broker, &s, > + CMPI_RC_ERR_FAILED, > + "Could not connect to hypervisor"); > + goto out; > + } > > + > + out: > + inst_list_free(&alloc_cap_list); > + inst_list_free(&device_pool_list); > return s; > } > > @@ -97,8 +192,23 @@ static CMPIStatus GetInstance(CMPIInstan > return return_alloc_cap(reference, results, 0); > } > > Do you need to close the conn before the function returns? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From veillard at redhat.com Tue Nov 20 21:23:34 2007 From: veillard at redhat.com (Daniel Veillard) Date: Tue, 20 Nov 2007 16:23:34 -0500 Subject: [Libvirt-cim] [PATCH] More rpm changes, per Fedora package review process In-Reply-To: <820db60ea59d76e6fc20.1195572989@theine> References: <820db60ea59d76e6fc20.1195572989@theine> Message-ID: <20071120212334.GA30062@redhat.com> On Tue, Nov 20, 2007 at 07:36:29AM -0700, Dan Smith wrote: [...] > -%makeinstall > +make DESTDIR=$RPM_BUILD_ROOT install Hum, what led to this change ? This is 2 completely different ways to rebase the installation paths, and we use %makeinstall in Red Hat packages usually. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From grendel at linux.vnet.ibm.com Tue Nov 20 21:25:01 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 16:25:01 -0500 Subject: [Libvirt-cim] [PATCH 2 of 2] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <47434CE1.4040706@linux.vnet.ibm.com> References: <5c397cd8e30335d08fd0.1195588658@wulfgar> <47434CE1.4040706@linux.vnet.ibm.com> Message-ID: <474350AD.7030203@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Jay Gagnon wrote: >> + >> + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); >> + if (conn == NULL) { >> + cu_statusf(broker, &s, >> + CMPI_RC_ERR_FAILED, >> + "Could not connect to hypervisor"); >> + goto out; >> + } >> > >> + >> + out: >> + inst_list_free(&alloc_cap_list); >> + inst_list_free(&device_pool_list); >> return s; >> } >> >> @@ -97,8 +192,23 @@ static CMPIStatus GetInstance(CMPIInstan >> return return_alloc_cap(reference, results, 0); >> } >> >> > Do you need to close the conn before the function returns? > Yes I do, good spot. I'll resend shortly. -- -Jay From danms at us.ibm.com Tue Nov 20 21:29:10 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 13:29:10 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: <5bbff08351e4c05cb8ce.1195544600@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Mon, 19 Nov 2007 23:43:20 -0700") References: <5bbff08351e4c05cb8ce.1195544600@elm3b41.beaverton.ibm.com> Message-ID: <8763zwobbt.fsf@theine.beaverton.ibm.com> KR> +CMPIInstance *get_rasd_instance_from_ref(const CMPIContext *context, KR> + const CMPIObjectPath *ref, KR> + const CMPIBroker *broker) KR> +{ Since this is the expected external interface for RASDs, I would rather it take an id and a type, instead of a ref. If we're using this elsewhere later and we want to grab a RASD, having to assemble a ref just to get it would be pretty annoying :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 20 20:26:06 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 20 Nov 2007 16:26:06 -0400 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work Message-ID: <0d019645db934b886b71.1195593966@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1195593960 18000 # Node ID 0d019645db934b886b71a744c12a83ce5034e7e2 # Parent 2e1dc075f0a9996bfdd2f437928d261081c1f9d6 Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work. This should include all the suggestions from the first iteration, and the missing virConnectClose from the second. Signed-off-by: Jay Gagnon diff -r 2e1dc075f0a9 -r 0d019645db93 src/Makefile.am --- a/src/Makefile.am Tue Nov 20 14:56:34 2007 -0500 +++ b/src/Makefile.am Tue Nov 20 16:26:00 2007 -0500 @@ -91,9 +91,9 @@ libVirt_ElementCapabilities_la_LIBADD = -lVirt_ComputerSystem \ -lVirt_HostSystem -libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la +libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c -libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD +libVirt_AllocationCapabilities_la_LIBADD = -lVirt_RASD -lVirt_DevicePool libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c diff -r 2e1dc075f0a9 -r 0d019645db93 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Tue Nov 20 14:56:34 2007 -0500 +++ b/src/Virt_AllocationCapabilities.c Tue Nov 20 16:26:00 2007 -0500 @@ -32,6 +32,7 @@ #include "Virt_AllocationCapabilities.h" #include "Virt_RASD.h" +#include "Virt_DevicePool.h" const static CMPIBroker *_BROKER; @@ -85,6 +86,101 @@ static CMPIStatus return_alloc_cap(const else CMReturnInstance(results, inst); out: + return s; +} + +static CMPIStatus ac_from_pool(const CMPIBroker *broker, + const CMPIObjectPath *ref, + CMPIInstance *pool, + CMPIInstance **alloc_cap) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + *alloc_cap = get_typed_instance(broker, + CLASSNAME(ref), + "AllocationCapabilities", + NAMESPACE(ref)); + if (*alloc_cap == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get alloc_cap instance"); + goto out; + } + + s = cu_copy_prop(broker, pool, *alloc_cap, "InstanceID", NULL); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error copying InstanceID"); + goto out; + } + + s = cu_copy_prop(broker, pool, *alloc_cap, "ResourceType", NULL); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error copying InstanceID"); + goto out; + } + out: + return s; +} + +static CMPIStatus alloc_cap_instances(const CMPIBroker *broker, + const CMPIObjectPath *ref, + const CMPIResult *results, + bool names_only, + const char **properties) +{ + int i; + virConnectPtr conn = NULL; + CMPIInstance *alloc_cap_inst; + struct inst_list alloc_cap_list; + struct inst_list device_pool_list; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + CU_DEBUG("In alloc_cap_instances()"); + + inst_list_init(&device_pool_list); + inst_list_init(&alloc_cap_list); + + if (!provider_is_responsible(broker, ref, &s)) + goto out; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not connect to hypervisor"); + goto out; + } + + s = get_all_pools(broker, conn, NAMESPACE(ref), &device_pool_list); + if (s.rc != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Error fetching device pools"); + goto out; + } + + for (i = 0; i < device_pool_list.cur; i++) { + s = ac_from_pool(broker, ref, + device_pool_list.list[i], + &alloc_cap_inst); + if (s.rc != CMPI_RC_OK) + goto out; + + inst_list_add(&alloc_cap_list, alloc_cap_inst); + } + + if (names_only) + cu_return_instance_names(results, &alloc_cap_list); + else + cu_return_instances(results, &alloc_cap_list); + + out: + virConnectClose(conn); + inst_list_free(&alloc_cap_list); + inst_list_free(&device_pool_list); return s; } @@ -97,8 +193,23 @@ static CMPIStatus GetInstance(CMPIInstan return return_alloc_cap(reference, results, 0); } -DEFAULT_EI(); -DEFAULT_EIN(); +static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference) +{ + return alloc_cap_instances(_BROKER, reference, results, true, NULL); +} + +static CMPIStatus EnumInstances(CMPIInstanceMI *self, + const CMPIContext *context, + const CMPIResult *results, + const CMPIObjectPath *reference, + const char **properties) +{ + return alloc_cap_instances(_BROKER, reference, results, false, properties); +} + DEFAULT_CI(); DEFAULT_MI(); DEFAULT_DI(); From danms at us.ibm.com Tue Nov 20 21:33:22 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 13:33:22 -0800 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: (Kaitlin Rupert's message of "Mon, 19 Nov 2007 23:43:21 -0700") References: Message-ID: <871wakob4t.fsf@theine.beaverton.ibm.com> KR> +static struct std_assoc rasd_to_rasd = { KR> + .source_class = "CIM_ResourceAllocationSettingData", KR> + .source_prop = "ManagedElement", KR> + KR> + .target_class = "CIM_ManagedElement", KR> + .target_prop = "SettingData", KR> + KR> + .assoc_class = "CIM_ElementSettingData", KR> + KR> + .handler = rasd_to_sd, KR> + .make_ref = make_ref KR> +}; A relatively minor comment, but this block confused me at first, since your function is rasd_to_sd, but your block is rasd_to_rasd. Perhaps a better name could make it more clear? I think tacking on a leading '_' to disambiguate the std_assoc block from the handler function is a reasonable way to do this (and how I've done it in the past, IIRC). -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 20 21:34:31 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 13:34:31 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_all_pools to Virt_DevicePool, which gets every pool it can find, per Dan's suggestion In-Reply-To: <2e1dc075f0a9996bfdd2.1195588657@wulfgar> (Jay Gagnon's message of "Tue, 20 Nov 2007 14:57:37 -0400") References: <2e1dc075f0a9996bfdd2.1195588657@wulfgar> Message-ID: <87wsscmwig.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1195588594 18000 JG> # Node ID 2e1dc075f0a9996bfdd2f437928d261081c1f9d6 JG> # Parent 97e1dd20b2d02b5b542ec830093954f265ae844f JG> Add get_all_pools to Virt_DevicePool, which gets every pool it can JG> find, per Dan's suggestion. Looks good, applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 20 21:35:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 13:35:56 -0800 Subject: [Libvirt-cim] [PATCH] More rpm changes, per Fedora package review process In-Reply-To: <20071120212334.GA30062@redhat.com> (Daniel Veillard's message of "Tue, 20 Nov 2007 16:23:34 -0500") References: <820db60ea59d76e6fc20.1195572989@theine> <20071120212334.GA30062@redhat.com> Message-ID: <87sl30mwg3.fsf@theine.beaverton.ibm.com> DV> Hum, what led to this change ? This is 2 completely different ways DV> to rebase the installation paths, and we use %makeinstall in Red DV> Hat packages usually. Fedora packaging guidelines :) http://fedoraproject.org/wiki/Packaging/Guidelines#head-fcaf3e6fcbd51194a5d0dbcfbdd2fcb7791dd002 -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 20 21:49:39 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 13:49:39 -0800 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work In-Reply-To: <0d019645db934b886b71.1195593966@wulfgar> (Jay Gagnon's message of "Tue, 20 Nov 2007 16:26:06 -0400") References: <0d019645db934b886b71.1195593966@wulfgar> Message-ID: <87lk8smvt8.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1195593960 18000 JG> # Node ID 0d019645db934b886b71a744c12a83ce5034e7e2 JG> # Parent 2e1dc075f0a9996bfdd2f437928d261081c1f9d6 JG> Fix AllocationCapabilities to make EnumInstances and EnumInstanceNames work. JG> This should include all the suggestions from the first iteration, JG> and the missing virConnectClose from the second. Looks better. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Tue Nov 20 21:52:59 2007 From: veillard at redhat.com (Daniel Veillard) Date: Tue, 20 Nov 2007 16:52:59 -0500 Subject: [Libvirt-cim] [PATCH] More rpm changes, per Fedora package review process In-Reply-To: <87sl30mwg3.fsf@theine.beaverton.ibm.com> References: <820db60ea59d76e6fc20.1195572989@theine> <20071120212334.GA30062@redhat.com> <87sl30mwg3.fsf@theine.beaverton.ibm.com> Message-ID: <20071120215259.GB30062@redhat.com> On Tue, Nov 20, 2007 at 01:35:56PM -0800, Dan Smith wrote: > DV> Hum, what led to this change ? This is 2 completely different ways > DV> to rebase the installation paths, and we use %makeinstall in Red > DV> Hat packages usually. > > Fedora packaging guidelines :) > > http://fedoraproject.org/wiki/Packaging/Guidelines#head-fcaf3e6fcbd51194a5d0dbcfbdd2fcb7791dd002 Hum, okay, if you're 100% sure DESTDIR doesn't break, fine :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Tue Nov 20 21:56:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 13:56:54 -0800 Subject: [Libvirt-cim] [PATCH] More rpm changes, per Fedora package review process In-Reply-To: <20071120215259.GB30062@redhat.com> (Daniel Veillard's message of "Tue, 20 Nov 2007 16:52:59 -0500") References: <820db60ea59d76e6fc20.1195572989@theine> <20071120212334.GA30062@redhat.com> <87sl30mwg3.fsf@theine.beaverton.ibm.com> <20071120215259.GB30062@redhat.com> Message-ID: <87hcjgmvh5.fsf@theine.beaverton.ibm.com> DV> Hum, okay, if you're 100% sure DESTDIR doesn't break, fine :-) I'm not 100% sure of anything :) It seems to work fine for me, but I'll take a closer look to make sure it's doing what it's supposed to. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 20 23:09:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 15:09:34 -0800 Subject: [Libvirt-cim] [PATCH] Add new function cu_copy_prop, which copies a property from one instance to another Message-ID: <87d4u4ms41.fsf@theine.beaverton.ibm.com> This is Jay's cu_copy_prop() function, which I got privately and forgot to put in the tree before his patch that uses it. I'm going to commit it now. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com # HG changeset patch # User Jay Gagnon # Date 1195502361 18000 # Node ID 805e9c0e7a9d3c7c6fe4e4f9546f48df5bd6c372 # Parent d6f1b6d1296bbe43c4edcc35475a05eef570e806 Add new function cu_copy_prop, which copies a property from one instance to another. Signed-off-by: Jay Gagnon diff -r d6f1b6d1296b -r 805e9c0e7a9d instance_util.c --- a/instance_util.c Thu Nov 15 13:07:50 2007 -0800 +++ b/instance_util.c Mon Nov 19 14:59:21 2007 -0500 @@ -156,6 +156,37 @@ const char *cu_compare_ref(const CMPIObj prop = NULL; out: return prop; +} + +CMPIStatus cu_copy_prop(const CMPIBroker *broker, + CMPIInstance *src_inst, CMPIInstance *dest_inst, + char *src_name, char *dest_name) +{ + CMPIData data; + CMPIStatus s = {CMPI_RC_OK, NULL}; + + if (src_name == NULL) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "No property name given"); + goto out; + } + + if (dest_name == NULL) + dest_name = src_name; + + data = CMGetProperty(src_inst, src_name, &s); + if (s.rc != CMPI_RC_OK || CMIsNullValue(data)) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Copy failed. Could not get prop '%s'.", src_name); + goto out; + } + + CMSetProperty(dest_inst, dest_name, &(data.value), data.type); + + out: + return s; } /* diff -r d6f1b6d1296b -r 805e9c0e7a9d libcmpiutil.h --- a/libcmpiutil.h Thu Nov 15 13:07:50 2007 -0800 +++ b/libcmpiutil.h Mon Nov 19 14:59:21 2007 -0500 @@ -61,6 +61,20 @@ * If set to anything else, uses value as name of log file to fprintf to. */ void debug_print(char *fmt, ...); + +/** + * Copies a property from one CMPIInstance to another. If dest_name is NULL, + * it is assumed to be the same as src_name. + * + * @param broker CIM broker, needed for status calls + * @param src_inst Instance to copy from + * @param dest_inst Instance to copy to + * @param src_name Name of property to be copied from src_inst + * @param dest_name Name of property to be copied to dest_inst + */ +CMPIStatus cu_copy_prop(const CMPIBroker *broker, + CMPIInstance *src_inst, CMPIInstance *dest_inst, + char *src_name, char *dest_name); /** * Check arguments (names and count) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Nov 20 23:23:28 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 20 Nov 2007 15:23:28 -0800 Subject: [Libvirt-cim] [PATCH] Add new function cu_copy_prop, which copies a property from one instance to another In-Reply-To: <87d4u4ms41.fsf@theine.beaverton.ibm.com> References: <87d4u4ms41.fsf@theine.beaverton.ibm.com> Message-ID: <47436C70.3000409@linux.vnet.ibm.com> Dan Smith wrote: > This is Jay's cu_copy_prop() function, which I got privately and > forgot to put in the tree before his patch that uses it. I'm going to > commit it now. > This patch looks good to me, fwiw. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 20 23:29:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 16:29:09 -0700 Subject: [Libvirt-cim] [PATCH 3 of 3] Bump RPM release to 4, after Fedora review cycles In-Reply-To: Message-ID: <040163ea48140857e410.1195604949@theine> # HG changeset patch # User Dan Smith # Date 1195604916 28800 # Node ID 040163ea48140857e410f1ef0e97a16d37a0510f # Parent bb19bc08877d11b33d0296a9c67a5149be676fd2 Bump RPM release to 4, after Fedora review cycles Signed-off-by: Dan Smith diff -r bb19bc08877d -r 040163ea4814 libcmpiutil.spec.in --- a/libcmpiutil.spec.in Tue Nov 20 16:28:36 2007 -0800 +++ b/libcmpiutil.spec.in Tue Nov 20 16:28:36 2007 -0800 @@ -3,7 +3,7 @@ Summary: CMPI Utility Library Summary: CMPI Utility Library Name: libcmpiutil Version: @PACKAGE_VERSION@ -Release: 1%{?dist}%{?extra_release} +Release: 4%{?dist}%{?extra_release} License: LGPLv2+ Group: Development/Libraries Source: libcmpiutil-%{version}.tar.gz From danms at us.ibm.com Tue Nov 20 23:29:08 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 16:29:08 -0700 Subject: [Libvirt-cim] [PATCH 2 of 3] [CU] Fix parallel make In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1195604916 28800 # Node ID bb19bc08877d11b33d0296a9c67a5149be676fd2 # Parent 6ef1c42262ed980483a700f0d9cf8ba55c120977 [CU] Fix parallel make Signed-off-by: Dan Smith diff -r 6ef1c42262ed -r bb19bc08877d Makefile.am --- a/Makefile.am Tue Nov 20 16:27:28 2007 -0800 +++ b/Makefile.am Tue Nov 20 16:28:36 2007 -0800 @@ -21,6 +21,7 @@ libcmpiutil_la_SOURCES = args_util.c ins debug_util.c libcmpiutil_la_CFLAGS = $(CFLAGS) $(CFLAGS_STRICT) libcmpiutil_la_LIBADD = +libcmpiutil_la_DEPENDENCIES = AM_LFLAGS = -Peo_parse_ AM_YFLAGS = -d -p eo_parse_ @@ -28,6 +29,7 @@ if build_eoparser if build_eoparser LEX_OUTPUT_ROOT = lex.eo_parse_ libcueoparser_la_SOURCES = eo_util_parser.y eo_util_lexer.l eo_parser.c +libcmpiutil_la_DEPENDENCIES += libcueoparser.la libcmpiutil_la_LIBADD += -lcueoparser EOPARSER = libcueoparser.la BUILT_SOURCES = eo_util_lexer.c eo_util_parser.c eo_util_parser.h From danms at us.ibm.com Tue Nov 20 23:29:07 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 16:29:07 -0700 Subject: [Libvirt-cim] [PATCH 1 of 3] [CU] Fix a compiler warning that was blocking Fedora 9 compiles In-Reply-To: Message-ID: <6ef1c42262ed980483a7.1195604947@theine> # HG changeset patch # User Dan Smith # Date 1195604848 28800 # Node ID 6ef1c42262ed980483a700f0d9cf8ba55c120977 # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f [CU] Fix a compiler warning that was blocking Fedora 9 compiles Signed-off-by: Dan Smith diff -r bf54de6af2e2 -r 6ef1c42262ed std_association.c --- a/std_association.c Tue Nov 20 16:24:27 2007 -0800 +++ b/std_association.c Tue Nov 20 16:27:28 2007 -0800 @@ -76,7 +76,7 @@ static bool match_class(const CMPIBroker } static CMPIStatus filter_results(struct inst_list *list, - char *ns, + const char *ns, const char *filter_class, const CMPIBroker *broker) { From danms at us.ibm.com Tue Nov 20 23:29:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 16:29:06 -0700 Subject: [Libvirt-cim] [PATCH 0 of 3] Changes from Fedora review Message-ID: These are changes I had to make to get libcmpiutil to pass the Fedora review cycle. From kaitlin at linux.vnet.ibm.com Tue Nov 20 23:46:41 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 20 Nov 2007 16:46:41 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Updated ElementSettingData to support RASD instances. Message-ID: Revised so that get_rasd_instance_from_ref() takes an InstanceID argument. Also, cleaned up some of the confusion structure / function names in Virt_ElementSettingData. From kaitlin at linux.vnet.ibm.com Tue Nov 20 23:46:42 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 20 Nov 2007 16:46:42 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: Message-ID: <00a0b30a8d7b7d11ba03.1195606002@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195605864 28800 # Node ID 00a0b30a8d7b7d11ba03b0857962ac15b40868ed # Parent 83aeadb6ebd9089e633013a0c65246a6d4881fcb Add get_rasd_instance_from_ref() to RASD. This allows other providers to get a specific RASD instance without having to do a CBGetInstance(). Updated get_rasd_instance_from_ref() to take an InstanceID parameter. The original version used the InstanceID from the ref. This was incorrect becasue the ref might not always have an InstanceID or the InstanceID might not correspond to the InstanceID of the RASD instance we want to return. Signed-off-by: Kaitlin Rupert diff -r 83aeadb6ebd9 -r 00a0b30a8d7b src/Virt_RASD.c --- a/src/Virt_RASD.c Tue Nov 20 16:39:17 2007 -0800 +++ b/src/Virt_RASD.c Tue Nov 20 16:44:24 2007 -0800 @@ -179,6 +179,7 @@ static CMPIInstance *rasd_from_vdev(cons static CMPIInstance *get_rasd_instance(const CMPIContext *context, const CMPIObjectPath *ref, + const CMPIBroker *broker, const char *id, const uint16_t type) { @@ -194,13 +195,13 @@ static CMPIInstance *get_rasd_instance(c if (!ret) return NULL; - conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + conn = connect_by_classname(broker, CLASSNAME(ref), &s); if (conn == NULL) goto out; dev = find_dev(conn, type, host, devid); if (dev) - inst = rasd_from_vdev(_BROKER, dev, host, ref); + inst = rasd_from_vdev(broker, dev, host, ref); out: virConnectClose(conn); @@ -238,6 +239,28 @@ CMPIrc rasd_type_from_classname(const ch return rc; } +CMPIInstance *get_rasd_instance_from_ref(const CMPIContext *context, + const CMPIObjectPath *ref, + const char *id, + const CMPIBroker *broker) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + uint16_t type; + + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine RASD type"); + goto out; + } + + inst = get_rasd_instance(context, ref, broker, id, type); + + out: + return inst; +} + static CMPIStatus GetInstance(CMPIInstanceMI *self, const CMPIContext *context, const CMPIResult *results, @@ -247,7 +270,6 @@ static CMPIStatus GetInstance(CMPIInstan CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; char *id = NULL; - uint16_t type; id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { @@ -257,14 +279,7 @@ static CMPIStatus GetInstance(CMPIInstan goto out; } - if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to determine RASD type"); - goto out; - } - - inst = get_rasd_instance(context, ref, id, type); + inst = get_rasd_instance_from_ref(context, ref, id, _BROKER); if (inst != NULL) CMReturnInstance(results, inst); @@ -273,6 +288,8 @@ static CMPIStatus GetInstance(CMPIInstan CMPI_RC_ERR_FAILED, "Unknown instance"); out: + free(id); + return s; } diff -r 83aeadb6ebd9 -r 00a0b30a8d7b src/Virt_RASD.h --- a/src/Virt_RASD.h Tue Nov 20 16:39:17 2007 -0800 +++ b/src/Virt_RASD.h Tue Nov 20 16:44:24 2007 -0800 @@ -41,6 +41,11 @@ int rasds_for_domain(const CMPIBroker *b CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); +CMPIInstance *get_rasd_instance_from_ref(const CMPIContext *context, + const CMPIObjectPath *ref, + const char *id, + const CMPIBroker *broker); + #endif /* From kaitlin at linux.vnet.ibm.com Tue Nov 20 23:46:43 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 20 Nov 2007 16:46:43 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: Message-ID: <83aeadb6ebd9089e6330.1195606003@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195605557 28800 # Node ID 83aeadb6ebd9089e633013a0c65246a6d4881fcb # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 Adding the RASD related part. This is based on the Resource Allocation Profile. My understanding is that we are implementing a setup similar to Figure 3 on page 31. In this case, we'll use the same RASD instance for State as well as Defined. Updated to due to change in get_rasd_instance_from_ref(). Also updated structure and handler function names to avoid confusion. Signed-off-by: Kaitlin Rupert diff -r 278c59f67cb1 -r 83aeadb6ebd9 src/Makefile.am --- a/src/Makefile.am Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Makefile.am Tue Nov 20 16:39:17 2007 -0800 @@ -135,4 +135,4 @@ libVirt_HostedService_la_LIBADD = -lVirt libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c -libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD -lVirt_RASD diff -r 278c59f67cb1 -r 83aeadb6ebd9 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Virt_ElementSettingData.c Tue Nov 20 16:39:17 2007 -0800 @@ -31,12 +31,13 @@ #include "misc_util.h" #include "Virt_VSSD.h" +#include "Virt_RASD.h" const static CMPIBroker *_BROKER; -static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, - struct std_assoc_info *info, - struct inst_list *list) +static CMPIStatus vssd_to_vssd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) { CMPIStatus s; CMPIInstance *inst; @@ -83,6 +84,41 @@ static CMPIStatus vssd_to_sd(const CMPIO return s; } +static CMPIStatus rasd_to_rasd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst; + char *id; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID"); + goto out; + } + + inst = get_rasd_instance_from_ref(info->context, ref, id, _BROKER); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting associated RASD"); + + goto out; + } + + inst_list_add(list, inst); + + out: + free(id); + + return s; +} + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, @@ -130,7 +166,7 @@ out: return refinst; } -static struct std_assoc vssd_to_sd_fd_bkwd = { +static struct std_assoc _vssd_to_vssd = { .source_class = "CIM_VirtualSystemSettingData", .source_prop = "ManagedElement", @@ -139,12 +175,26 @@ static struct std_assoc vssd_to_sd_fd_bk .assoc_class = "CIM_ElementSettingData", - .handler = vssd_to_sd, + .handler = vssd_to_vssd, .make_ref = make_ref }; +static struct std_assoc _rasd_to_rasd = { + .source_class = "CIM_ResourceAllocationSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = rasd_to_rasd, + .make_ref = make_ref +}; + static struct std_assoc *handlers[] = { - &vssd_to_sd_fd_bkwd, + &_vssd_to_vssd, + &_rasd_to_rasd, NULL }; From danms at us.ibm.com Wed Nov 21 00:55:01 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 20 Nov 2007 16:55:01 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: <00a0b30a8d7b7d11ba03.1195606002@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Tue, 20 Nov 2007 16:46:42 -0700") References: <00a0b30a8d7b7d11ba03.1195606002@elm3b41.beaverton.ibm.com> Message-ID: <878x4smn8a.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1195605864 28800 KR> # Node ID 00a0b30a8d7b7d11ba03b0857962ac15b40868ed KR> # Parent 83aeadb6ebd9089e633013a0c65246a6d4881fcb KR> Add get_rasd_instance_from_ref() to RASD. KR> Updated get_rasd_instance_from_ref() to take an InstanceID KR> parameter. The original version used the InstanceID from the ref. KR> This was incorrect becasue the ref might not always have an KR> InstanceID or the InstanceID might not correspond to the KR> InstanceID of the RASD instance we want to return. Right, so... KR> +CMPIInstance *get_rasd_instance_from_ref(const CMPIContext *context, KR> + const CMPIObjectPath *ref, KR> + const char *id, KR> + const CMPIBroker *broker) KR> +{ KR> + CMPIStatus s = {CMPI_RC_OK, NULL}; KR> + CMPIInstance *inst = NULL; KR> + uint16_t type; KR> + KR> + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { KR> + cu_statusf(broker, &s, KR> + CMPI_RC_ERR_FAILED, KR> + "Unable to determine RASD type"); KR> + goto out; KR> + } Doesn't the same go for the type? If you are in VSSDC, say, then you have probably have a ref of root/virt:Xen_VSSDC.InstanceID="Xen:foo", which will not resolve to a valid type if you call rasd_type_from_classname() on it, as above. In most of our other external interfaces like this, we pass around a char *id and a uint16_t type, which is one of CIM_RASD_TYPE_*, per svpd_types.h. See Virt_DevicePool.h:get_pool_by_type() for example. KR> + inst = get_rasd_instance(context, ref, broker, id, type); Also, since we're not really getting the RASD information from the ref, I'm not sure the function is properly named, nor needed at this point. I think simply making the get_rasd_instance() non-static and exposed will do what we want, right? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Wed Nov 21 08:52:30 2007 From: veillard at redhat.com (Daniel Veillard) Date: Wed, 21 Nov 2007 03:52:30 -0500 Subject: [Libvirt-cim] [PATCH 1 of 3] [CU] Fix a compiler warning that was blocking Fedora 9 compiles In-Reply-To: <6ef1c42262ed980483a7.1195604947@theine> References: <6ef1c42262ed980483a7.1195604947@theine> Message-ID: <20071121085229.GA17175@redhat.com> On Tue, Nov 20, 2007 at 04:29:07PM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195604848 28800 > # Node ID 6ef1c42262ed980483a700f0d9cf8ba55c120977 > # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f > [CU] Fix a compiler warning that was blocking Fedora 9 compiles makes sense to me, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From veillard at redhat.com Wed Nov 21 08:53:26 2007 From: veillard at redhat.com (Daniel Veillard) Date: Wed, 21 Nov 2007 03:53:26 -0500 Subject: [Libvirt-cim] [PATCH 2 of 3] [CU] Fix parallel make In-Reply-To: References: Message-ID: <20071121085326.GB17175@redhat.com> On Tue, Nov 20, 2007 at 04:29:08PM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195604916 28800 > # Node ID bb19bc08877d11b33d0296a9c67a5149be676fd2 > # Parent 6ef1c42262ed980483a700f0d9cf8ba55c120977 > [CU] Fix parallel make Seems to be one of the .la dependancies forgotten in the previous round, +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From veillard at redhat.com Wed Nov 21 08:56:43 2007 From: veillard at redhat.com (Daniel Veillard) Date: Wed, 21 Nov 2007 03:56:43 -0500 Subject: [Libvirt-cim] [PATCH 3 of 3] Bump RPM release to 4, after Fedora review cycles In-Reply-To: <040163ea48140857e410.1195604949@theine> References: <040163ea48140857e410.1195604949@theine> Message-ID: <20071121085642.GC17175@redhat.com> On Tue, Nov 20, 2007 at 04:29:09PM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1195604916 28800 > # Node ID 040163ea48140857e410f1ef0e97a16d37a0510f > # Parent bb19bc08877d11b33d0296a9c67a5149be676fd2 > Bump RPM release to 4, after Fedora review cycles > > Signed-off-by: Dan Smith > > diff -r bb19bc08877d -r 040163ea4814 libcmpiutil.spec.in > --- a/libcmpiutil.spec.in Tue Nov 20 16:28:36 2007 -0800 > +++ b/libcmpiutil.spec.in Tue Nov 20 16:28:36 2007 -0800 > @@ -3,7 +3,7 @@ Summary: CMPI Utility Library > Summary: CMPI Utility Library > Name: libcmpiutil > Version: @PACKAGE_VERSION@ > -Release: 1%{?dist}%{?extra_release} > +Release: 4%{?dist}%{?extra_release} For the packages I maintain, I don't bother updating the RPM releases upstream, that's a distib specific information, and doesn't make much sense out of that context. I would just keep 1 upstream, and just update the Changelog (of the spec) on each new version. Then whoever does the packaging for a given distro handles those tiny details :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From grendel at linux.vnet.ibm.com Wed Nov 21 14:16:24 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 21 Nov 2007 09:16:24 -0500 Subject: [Libvirt-cim] [PATCH] Add new function cu_copy_prop, which copies a property from one instance to another In-Reply-To: <87d4u4ms41.fsf@theine.beaverton.ibm.com> References: <87d4u4ms41.fsf@theine.beaverton.ibm.com> Message-ID: <47443DB8.8030005@linux.vnet.ibm.com> Dan Smith wrote: > This is Jay's cu_copy_prop() function, which I got privately and > forgot to put in the tree before his patch that uses it. I'm going to > commit it now. > > Heh, you forgot "and Jay has repeatedly forgot to send along with the patch that uses it." Thanks for taking care of that for me. :) -- -Jay From kaitlin at linux.vnet.ibm.com Wed Nov 21 15:40:37 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 21 Nov 2007 07:40:37 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Add get_rasd_instance_from_ref() to RASD In-Reply-To: <878x4smn8a.fsf@theine.beaverton.ibm.com> References: <00a0b30a8d7b7d11ba03.1195606002@elm3b41.beaverton.ibm.com> <878x4smn8a.fsf@theine.beaverton.ibm.com> Message-ID: <47445175.6030902@linux.vnet.ibm.com> Dan Smith wrote: > Doesn't the same go for the type? If you are in VSSDC, say, then you > have probably have a ref of root/virt:Xen_VSSDC.InstanceID="Xen:foo", > which will not resolve to a valid type if you call > rasd_type_from_classname() on it, as above. > > In most of our other external interfaces like this, we pass around a > char *id and a uint16_t type, which is one of CIM_RASD_TYPE_*, per > svpd_types.h. See Virt_DevicePool.h:get_pool_by_type() for example. > > KR> + inst = get_rasd_instance(context, ref, broker, id, type); > > Also, since we're not really getting the RASD information from the > ref, I'm not sure the function is properly named, nor needed at this > point. I think simply making the get_rasd_instance() non-static and > exposed will do what we want, right? > Yes, I think you're right. Trying to encapsulate this behavior only works for some cases. It isn't generic enough to warrant a new function. Will generate a new patch. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 21 15:31:42 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 21 Nov 2007 08:31:42 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Updated ElementSettingData to support RASD instances. Message-ID: Revised so that get_rasd_instance() is no longer static. This function should be used by other providers - there isn't a need for a new function. Also, cleaned up some of the confusion structure / function names in Virt_ElementSettingData. From kaitlin at linux.vnet.ibm.com Wed Nov 21 15:31:44 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 21 Nov 2007 08:31:44 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: Message-ID: <5c0b219865cd675d54d4.1195662704@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195661851 28800 # Node ID 5c0b219865cd675d54d4a13230c549be93a4d144 # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 Adding the RASD related part. This is based on the Resource Allocation Profile. My understanding is that we are implementing a setup similar to Figure 3 on page 31. In this case, we'll use the same RASD instance for State as well as Defined. Updated to due to change in get_rasd_instance_from_ref(). Also updated structure and handler function names to avoid confusion. Signed-off-by: Kaitlin Rupert diff -r 278c59f67cb1 -r 5c0b219865cd src/Makefile.am --- a/src/Makefile.am Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Makefile.am Wed Nov 21 08:17:31 2007 -0800 @@ -135,4 +135,4 @@ libVirt_HostedService_la_LIBADD = -lVirt libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c -libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD -lVirt_RASD diff -r 278c59f67cb1 -r 5c0b219865cd src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Virt_ElementSettingData.c Wed Nov 21 08:17:31 2007 -0800 @@ -31,12 +31,13 @@ #include "misc_util.h" #include "Virt_VSSD.h" +#include "Virt_RASD.h" const static CMPIBroker *_BROKER; -static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, - struct std_assoc_info *info, - struct inst_list *list) +static CMPIStatus vssd_to_vssd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) { CMPIStatus s; CMPIInstance *inst; @@ -83,6 +84,49 @@ static CMPIStatus vssd_to_sd(const CMPIO return s; } +static CMPIStatus rasd_to_rasd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst; + char *id = NULL; + uint16_t type; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID"); + goto out; + } + + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine RASD type"); + goto out; + } + + inst = get_rasd_instance(info->context, ref, _BROKER, id, type); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting associated RASD"); + + goto out; + } + + inst_list_add(list, inst); + + out: + free(id); + + return s; +} + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, @@ -130,7 +174,7 @@ out: return refinst; } -static struct std_assoc vssd_to_sd_fd_bkwd = { +static struct std_assoc _vssd_to_vssd = { .source_class = "CIM_VirtualSystemSettingData", .source_prop = "ManagedElement", @@ -139,12 +183,26 @@ static struct std_assoc vssd_to_sd_fd_bk .assoc_class = "CIM_ElementSettingData", - .handler = vssd_to_sd, + .handler = vssd_to_vssd, .make_ref = make_ref }; +static struct std_assoc _rasd_to_rasd = { + .source_class = "CIM_ResourceAllocationSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = rasd_to_rasd, + .make_ref = make_ref +}; + static struct std_assoc *handlers[] = { - &vssd_to_sd_fd_bkwd, + &_vssd_to_vssd, + &_rasd_to_rasd, NULL }; From kaitlin at linux.vnet.ibm.com Wed Nov 21 15:31:43 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 21 Nov 2007 08:31:43 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1195662213 28800 # Node ID ad925c6e9bf0635e79c2b6e45698d11ede760d99 # Parent 5c0b219865cd675d54d4a13230c549be93a4d144 Remove static from get_rasd_instance() Add get_rasd_instance() declaration to header file. Also add an additional broker argument so other providers can call this function. Fixed minor mem leak in GetInstance(). Signed-off-by: Kaitlin Rupert diff -r 5c0b219865cd -r ad925c6e9bf0 src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Nov 21 08:17:31 2007 -0800 +++ b/src/Virt_RASD.c Wed Nov 21 08:23:33 2007 -0800 @@ -177,10 +177,11 @@ static CMPIInstance *rasd_from_vdev(cons return inst; } -static CMPIInstance *get_rasd_instance(const CMPIContext *context, - const CMPIObjectPath *ref, - const char *id, - const uint16_t type) +CMPIInstance *get_rasd_instance(const CMPIContext *context, + const CMPIObjectPath *ref, + const CMPIBroker *broker, + const char *id, + const uint16_t type) { CMPIInstance *inst = NULL; CMPIStatus s; @@ -194,13 +195,13 @@ static CMPIInstance *get_rasd_instance(c if (!ret) return NULL; - conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + conn = connect_by_classname(broker, CLASSNAME(ref), &s); if (conn == NULL) goto out; dev = find_dev(conn, type, host, devid); if (dev) - inst = rasd_from_vdev(_BROKER, dev, host, ref); + inst = rasd_from_vdev(broker, dev, host, ref); out: virConnectClose(conn); @@ -264,7 +265,7 @@ static CMPIStatus GetInstance(CMPIInstan goto out; } - inst = get_rasd_instance(context, ref, id, type); + inst = get_rasd_instance(context, ref, _BROKER, id, type); if (inst != NULL) CMReturnInstance(results, inst); @@ -273,6 +274,8 @@ static CMPIStatus GetInstance(CMPIInstan CMPI_RC_ERR_FAILED, "Unknown instance"); out: + free(id); + return s; } diff -r 5c0b219865cd -r ad925c6e9bf0 src/Virt_RASD.h --- a/src/Virt_RASD.h Wed Nov 21 08:17:31 2007 -0800 +++ b/src/Virt_RASD.h Wed Nov 21 08:23:33 2007 -0800 @@ -41,6 +41,12 @@ int rasds_for_domain(const CMPIBroker *b CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); +CMPIInstance *get_rasd_instance(const CMPIContext *context, + const CMPIObjectPath *ref, + const CMPIBroker *broker, + const char *id, + const uint16_t type); + #endif /* From grendel at linux.vnet.ibm.com Wed Nov 21 18:37:24 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 21 Nov 2007 13:37:24 -0500 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: References: Message-ID: <47447AE4.20508@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1195662213 28800 > # Node ID ad925c6e9bf0635e79c2b6e45698d11ede760d99 > # Parent 5c0b219865cd675d54d4a13230c549be93a4d144 > Remove static from get_rasd_instance() > > Add get_rasd_instance() declaration to header file. Also add an additional broker argument so other providers can call this function. > > Fixed minor mem leak in GetInstance(). > > Signed-off-by: Kaitlin Rupert > > diff -r 5c0b219865cd -r ad925c6e9bf0 src/Virt_RASD.c > --- a/src/Virt_RASD.c Wed Nov 21 08:17:31 2007 -0800 > +++ b/src/Virt_RASD.c Wed Nov 21 08:23:33 2007 -0800 > @@ -177,10 +177,11 @@ static CMPIInstance *rasd_from_vdev(cons > return inst; > } > > -static CMPIInstance *get_rasd_instance(const CMPIContext *context, > - const CMPIObjectPath *ref, > - const char *id, > - const uint16_t type) > +CMPIInstance *get_rasd_instance(const CMPIContext *context, > + const CMPIObjectPath *ref, > + const CMPIBroker *broker, > + const char *id, > + const uint16_t type) > { > CMPIInstance *inst = NULL; > CMPIStatus s; > @@ -194,13 +195,13 @@ static CMPIInstance *get_rasd_instance(c > if (!ret) > return NULL; > > - conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + conn = connect_by_classname(broker, CLASSNAME(ref), &s); > if (conn == NULL) > goto out; > > dev = find_dev(conn, type, host, devid); > if (dev) > - inst = rasd_from_vdev(_BROKER, dev, host, ref); > + inst = rasd_from_vdev(broker, dev, host, ref); > > out: > virConnectClose(conn); > @@ -264,7 +265,7 @@ static CMPIStatus GetInstance(CMPIInstan > goto out; > } > > - inst = get_rasd_instance(context, ref, id, type); > + inst = get_rasd_instance(context, ref, _BROKER, id, type); > Think you got the wrong broker there. Should be broker, not _BROKER, right? Everything else looks fine. Assuming that _BROKER gets taken care of, it's +1 from me. -- -Jay From grendel at linux.vnet.ibm.com Wed Nov 21 18:41:06 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 21 Nov 2007 13:41:06 -0500 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: <5c0b219865cd675d54d4.1195662704@elm3b41.beaverton.ibm.com> References: <5c0b219865cd675d54d4.1195662704@elm3b41.beaverton.ibm.com> Message-ID: <47447BC2.1000300@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1195661851 28800 > # Node ID 5c0b219865cd675d54d4a13230c549be93a4d144 > # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 > Adding the RASD related part. > > This is based on the Resource Allocation Profile. My understanding is that we are implementing a setup similar to Figure 3 on page 31. In this case, we'll use the same RASD instance for State as well as Defined. > > Updated to due to change in get_rasd_instance_from_ref(). Also updated structure and handler function names to avoid confusion. > > Signed-off-by: Kaitlin Rupert > > > Looks like just the naming convention type changes from Dan's earlier suggestions, right? Seems to fit how we tend to do things now, and is clear enough to me. +1 -- -Jay From kaitlin at linux.vnet.ibm.com Wed Nov 21 18:42:39 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 21 Nov 2007 10:42:39 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: <47447AE4.20508@linux.vnet.ibm.com> References: <47447AE4.20508@linux.vnet.ibm.com> Message-ID: <47447C1F.9000905@linux.vnet.ibm.com> Jay Gagnon wrote: >> @@ -264,7 +265,7 @@ static CMPIStatus GetInstance(CMPIInstan >> goto out; >> } >> >> - inst = get_rasd_instance(context, ref, id, type); >> + inst = get_rasd_instance(context, ref, _BROKER, id, type); >> >> > Think you got the wrong broker there. Should be broker, not _BROKER, > right? Everything else looks fine. Assuming that _BROKER gets taken > care of, it's +1 from me. > The way the patch was generated made this piece confusing. get_rasd_instance() is being called from the GetInstance() function in Virt_RASD.c. Anytime a provider calls get_rasd_instance(), it will need to pass it's own _BROKER. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Wed Nov 21 18:53:43 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 21 Nov 2007 13:53:43 -0500 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: <47447C1F.9000905@linux.vnet.ibm.com> References: <47447AE4.20508@linux.vnet.ibm.com> <47447C1F.9000905@linux.vnet.ibm.com> Message-ID: <47447EB7.8090607@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Jay Gagnon wrote: >>> @@ -264,7 +265,7 @@ static CMPIStatus GetInstance(CMPIInstan >>> goto out; >>> } >>> >>> - inst = get_rasd_instance(context, ref, id, type); >>> + inst = get_rasd_instance(context, ref, _BROKER, id, type); >>> >> Think you got the wrong broker there. Should be broker, not _BROKER, >> right? Everything else looks fine. Assuming that _BROKER gets taken >> care of, it's +1 from me. >> > The way the patch was generated made this piece confusing. > get_rasd_instance() is being called from the GetInstance() function in > Virt_RASD.c. Anytime a provider calls get_rasd_instance(), it will > need to pass it's own _BROKER. > Ah, I see now. My bad. :) -- -Jay From heidieck at linux.vnet.ibm.com Thu Nov 22 11:08:37 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 22 Nov 2007 13:08:37 +0200 Subject: [Libvirt-cim] [PATCH] Enumeration on HostSystem class is returning dups Message-ID: <8c0410bfe3d3da3ef61a.1195733317@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195733309 -3600 # Node ID 8c0410bfe3d3da3ef61aa40bfe75f1f23426b77d # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 Enumeration on HostSystem class is returning dups On systems where only one hypervisor is existing, the provider returned instance for all known subclasses (Xen, KVM). Signed-off-by: Heidi Eckhart diff -r 278c59f67cb1 -r 8c0410bfe3d3 src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Virt_HostSystem.c Thu Nov 22 13:08:29 2007 +0100 @@ -36,20 +36,24 @@ const static CMPIBroker *_BROKER; -static int set_host_system_properties(CMPIInstance *instance, - const char *classname) +static int set_host_system_properties(CMPIInstance *instance) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *op; char hostname[256] = {0}; - CMSetProperty(instance, "CreationClassName", - (CMPIValue *)classname, CMPI_chars); + op = CMGetObjectPath(instance, &s); + if ((s.rc == CMPI_RC_OK) || !CMIsNullObject(op)) { + CMSetProperty(instance, "CreationClassName", + (CMPIValue *)CLASSNAME(op), CMPI_chars); + } if (gethostname(hostname, sizeof(hostname) - 1) != 0) strcpy(hostname, "unknown"); CMSetProperty(instance, "Name", (CMPIValue *)hostname, CMPI_chars); - + return 1; } @@ -57,44 +61,32 @@ CMPIStatus get_host_cs(const CMPIBroker const CMPIObjectPath *reference, CMPIInstance **instance) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - CMPIObjectPath *op; - CMPIStatus s; - char *ns; - char *classname; + virConnectPtr conn = NULL; - ns = NAMESPACE(reference); + conn = connect_by_classname(broker, CLASSNAME(reference), &s); + if (conn == NULL) + goto out; - classname = get_typed_class(CLASSNAME(reference), "HostSystem"); - if (classname == NULL) { - CMSetStatusWithChars(broker, &s, + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "HostSystem", + NAMESPACE(reference)); + + if (inst == NULL) { + CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Invalid class"); - goto out; + "Can't create HostSystem instance."); + goto err; } - op = CMNewObjectPath(broker, ns, classname, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for HostSystem"); - goto out; - } + set_host_system_properties(inst); - inst = CMNewInstance(broker, op, &s); - if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(op))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); - goto out; - } - - set_host_system_properties(inst, classname); - + err: + virConnectClose(conn); out: *instance = inst; - - free(classname); return s; } @@ -103,17 +95,11 @@ static CMPIStatus return_host_cs(const C const CMPIResult *results, int name_only) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; - char *ns; - - if (!provider_is_responsible(_BROKER, reference, &s)) - return s; - - ns = NAMESPACE(reference); s = get_host_cs(_BROKER, reference, &instance); - if (s.rc != CMPI_RC_OK) + if (s.rc != CMPI_RC_OK || instance == NULL) goto out; if (name_only) From heidieck at linux.vnet.ibm.com Thu Nov 22 11:13:11 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 22 Nov 2007 13:13:11 +0200 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace Message-ID: <710a381591c1a67e5a79.1195733591@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195733580 -3600 # Node ID 710a381591c1a67e5a79ad3b04aaa8bc7adbb108 # Parent 8c0410bfe3d3da3ef61aa40bfe75f1f23426b77d Add installation instructions for root/interop namespace Signed-off-by: Heidi Eckhart diff -r 8c0410bfe3d3 -r 710a381591c1 doc/libvirt-cim.html --- a/doc/libvirt-cim.html Thu Nov 22 13:08:29 2007 +0100 +++ b/doc/libvirt-cim.html Thu Nov 22 13:13:00 2007 +0100 @@ -76,6 +76,7 @@ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof

To install the schema in SFCB:

@@ -111,6 +112,23 @@ +//#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")
+//#pragma include ("Security/CIM_IPPacketFilterIndication.mof")
#pragma include ("Support/PRS_ActivityContact.mof")
+

+ +

cimv216-interop.mof is not part of the official DMTF + CIM v2.16 schema package. Please create with the folloing content: +

+ +

+#pragma locale ("en_US")
+#pragma include ("qualifiers.mof")
+#pragma include ("qualifiers_optional.mof")
+#pragma include ("Core/CIM_ManagedElement.mof")
+#pragma include ("Interop/CIM_RegisteredProfile.mof")
+#pragma include ("Interop/CIM_RegisteredSubProfile.mof")
+#pragma include ("Core/CIM_Dependency.mof")
+#pragma include ("Interop/CIM_ElementConformsToProfile.mof")
+#pragma include ("Interop/CIM_ReferencedProfile.mof")
+#pragma include ("Interop/CIM_SubProfileRequiresProfile.mof")

Platform Support

From heidieck at linux.vnet.ibm.com Thu Nov 22 11:39:16 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 22 Nov 2007 13:39:16 +0200 Subject: [Libvirt-cim] [PATCH] Enumeration on VirtualSystemManagementService class is returning dups Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1195735052 -3600 # Node ID fb84303afda80d4d180e9951b114f2769a5d6baa # Parent 710a381591c1a67e5a79ad3b04aaa8bc7adbb108 Enumeration on VirtualSystemManagementService class is returning dups On systems where only one hypervisor is existing, the provider returned instance for all known subclasses (Xen, KVM). Signed-off-by: Heidi Eckhart diff -r 710a381591c1 -r fb84303afda8 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Thu Nov 22 13:13:00 2007 +0100 +++ b/src/Virt_VirtualSystemManagementService.c Thu Nov 22 13:37:32 2007 +0100 @@ -1048,26 +1048,32 @@ CMPIStatus get_vsms(const CMPIObjectPath CMPIStatus get_vsms(const CMPIObjectPath *reference, CMPIInstance **_inst, const CMPIBroker *broker) -{ - CMPIStatus s; - CMPIInstance *inst; - CMPIInstance *host; +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + CMPIInstance *host = NULL; char *val = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(broker, CLASSNAME(reference), &s); + if (conn == NULL) + goto out; s = get_host_cs(broker, reference, &host); if (s.rc != CMPI_RC_OK) - goto out; + goto err; inst = get_typed_instance(broker, - CLASSNAME(reference), + pfx_from_conn(conn), "VirtualSystemManagementService", NAMESPACE(reference)); + if (inst == NULL) { CU_DEBUG("Failed to get typed instance"); cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, "Failed to create instance"); - goto out; + goto err; } CMSetProperty(inst, "Name", @@ -1076,8 +1082,8 @@ CMPIStatus get_vsms(const CMPIObjectPath if (cu_get_str_prop(host, "Name", &val) != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, - "Unable to get name of System"); - goto out; + "Unable to get name of HostSystem"); + goto err; } CMSetProperty(inst, "SystemName", @@ -1087,8 +1093,8 @@ CMPIStatus get_vsms(const CMPIObjectPath if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, - "Unable to get creation class of system"); - goto out; + "Unable to get creation class of HostSystem"); + goto err; } CMSetProperty(inst, "SystemCreationClassName", @@ -1097,8 +1103,11 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetStatus(&s, CMPI_RC_OK); + err: + virConnectClose(conn); + + out: *_inst = inst; - out: return s; } @@ -1106,19 +1115,17 @@ static CMPIStatus return_vsms(const CMPI const CMPIResult *results, int name_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - CMPIStatus s; s = get_vsms(reference, &inst, _BROKER); - if (s.rc != CMPI_RC_OK) + if (s.rc != CMPI_RC_OK || inst == NULL) goto out; if (name_only) cu_return_instance_name(results, inst); else CMReturnInstance(results, inst); - - CMSetStatus(&s, CMPI_RC_OK); out: return s; } From heidieck at linux.vnet.ibm.com Thu Nov 22 12:40:47 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 22 Nov 2007 13:40:47 +0100 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: <87640244yt.fsf@theine.beaverton.ibm.com> References: <15cc86eee7e50fb5b6dd.1195207039@localhost.localdomain> <87640244yt.fsf@theine.beaverton.ibm.com> Message-ID: <474578CF.6000201@linux.vnet.ibm.com> Dan Smith wrote: > HE> + $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<
> > I don't think this got updated correctly. I get this error when > trying to build the web pages: > > >> ../doc/libvirt-cim.html:79: HTML parser error : htmlParseStartTag: invalid element name >> $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof<< >> ^ >> Generating the Web pages >> > > After you make a change, just type "make" in the doc/ directory and it > will regenerate and validate the pages. > Thanks for the hints. Should be fixed now. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 23 09:12:44 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 11:12:44 +0200 Subject: [Libvirt-cim] [PATCH 0 of 3] Fixes to RegisteredProfile and ECTP depending on connect_by_classname approach Message-ID: From heidieck at linux.vnet.ibm.com Fri Nov 23 09:12:45 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 11:12:45 +0200 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1195812344 -3600 # Node ID a479cec9721a58c537929206bc5190b22f709fc1 # Parent 4cce597d4e48b5e3efc6e4307be3234bd3051c9b Enumeration of RegisteredProfile class is returning wrong instances Signed-off-by: Heidi Eckhart diff -r 4cce597d4e48 -r a479cec9721a src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Fri Nov 23 10:57:30 2007 +0100 +++ b/src/Virt_RegisteredProfile.c Fri Nov 23 11:05:44 2007 +0100 @@ -43,25 +43,23 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *reg_prof_instance(const CMPIBroker *broker, const char *namespace, const char **properties, + virConnectPtr conn, struct reg_prof *profile) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIObjectPath *op; CMPIInstance *instance = NULL; - char *classname; - - classname = get_typed_class("Xen", "RegisteredProfile"); - if (classname == NULL) { - goto out; - } - - op = CMNewObjectPath(broker, namespace, classname, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; - - instance = CMNewInstance(broker, op, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; + + instance = get_typed_instance(broker, + pfx_from_conn(conn), + "RegisteredProfile", + namespace); + + if (instance == NULL) { + CMSetStatusWithChars(broker, &s, + CMPI_RC_ERR_FAILED, + "Can't create HostSystem instance."); + goto out; + } if (properties) { s = CMSetPropertyFilter(instance, properties, NULL); @@ -83,8 +81,6 @@ CMPIInstance *reg_prof_instance(const CM (CMPIValue *)profile->reg_version, CMPI_chars); out: - free(classname); - return instance; } @@ -95,17 +91,23 @@ static CMPIStatus enum_profs(const CMPIO { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + virConnectPtr conn = NULL; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; for (i = 0; profiles[i] != NULL; i++) { instance = reg_prof_instance(_BROKER, NAMESPACE(ref), - properties, + properties, + conn, profiles[i]); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Can't create profile instance."); - goto out; + goto err; } if (names_only) @@ -114,6 +116,8 @@ static CMPIStatus enum_profs(const CMPIO CMReturnInstance(results, instance); } + err: + virConnectClose(conn); out: return s; } @@ -124,15 +128,20 @@ static CMPIStatus get_prof(const CMPIObj { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance = NULL; + virConnectPtr conn = NULL; char* id; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); - return s; + goto out; } for (i = 0; profiles[i] != NULL; i++) { @@ -140,18 +149,19 @@ static CMPIStatus get_prof(const CMPIObj instance = reg_prof_instance(_BROKER, NAMESPACE(ref), properties, + conn, profiles[i]); break; } } + free(id); + out: if(instance) CMReturnInstance(results, instance); else CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); - - free(id); return s; } diff -r 4cce597d4e48 -r a479cec9721a src/Virt_RegisteredProfile.h --- a/src/Virt_RegisteredProfile.h Fri Nov 23 10:57:30 2007 +0100 +++ b/src/Virt_RegisteredProfile.h Fri Nov 23 11:05:44 2007 +0100 @@ -24,6 +24,7 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *reg_prof_instance(const CMPIBroker *broker, const char *namespace, const char **properties, + virConnectPtr conn, struct reg_prof *profile); #endif From heidieck at linux.vnet.ibm.com Fri Nov 23 09:12:46 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 11:12:46 +0200 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: Message-ID: <50b0c2bad1e31abff47a.1195812766@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195812346 -3600 # Node ID 50b0c2bad1e31abff47a9c3a98f9e14b5e29efe9 # Parent a479cec9721a58c537929206bc5190b22f709fc1 Adoption of changes to RegisteredProfile Signed-off-by: Heidi Eckhart diff -r a479cec9721a -r 50b0c2bad1e3 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:44 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:46 2007 +0100 @@ -133,9 +133,14 @@ static CMPIStatus elem_to_prof(const CMP { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + virConnectPtr conn = NULL; + struct reg_prof *candidate; char *classname; - struct reg_prof *candidate; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { @@ -151,10 +156,12 @@ static CMPIStatus elem_to_prof(const CMP instance = reg_prof_instance(_BROKER, "/root/interop", - NULL, + NULL, + conn, candidate); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, "Can't create profile instance."); goto error; } From heidieck at linux.vnet.ibm.com Fri Nov 23 09:12:47 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 11:12:47 +0200 Subject: [Libvirt-cim] [PATCH 3 of 3] Fix class prefix to depend on established hypervisor connection In-Reply-To: Message-ID: <883d767c64256f4d582f.1195812767@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195812682 -3600 # Node ID 883d767c64256f4d582f06125e05f392454f8a15 # Parent 50b0c2bad1e31abff47a9c3a98f9e14b5e29efe9 Fix class prefix to depend on established hypervisor connection Signed-off-by: Heidi Eckhart diff -r 50b0c2bad1e3 -r 883d767c6425 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:46 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:11:22 2007 +0100 @@ -50,7 +50,8 @@ static CMPIStatus elem_instances(const C static CMPIStatus elem_instances(const CMPIObjectPath *ref, struct std_assoc_info *info, struct inst_list *list, - struct reg_prof *profile) + struct reg_prof *profile, + virConnectPtr conn) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; @@ -58,7 +59,8 @@ static CMPIStatus elem_instances(const C CMPIData data ; char *classname; - classname = get_typed_class("Xen", profile->provider_name); + classname = get_typed_class(pfx_from_conn(conn), + profile->provider_name); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -101,9 +103,14 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; + virConnectPtr conn = NULL; char *id; int i; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; + id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, @@ -114,7 +121,8 @@ static CMPIStatus prof_to_elem(const CMP for (i = 0; profiles[i] != NULL; i++) { if (STREQ(id, profiles[i]->reg_id)) { - s = elem_instances(ref, info, list, profiles[i]); + s = elem_instances(ref, info, list, + profiles[i], conn); if ((s.rc != CMPI_RC_OK)) goto error; break; @@ -122,6 +130,7 @@ static CMPIStatus prof_to_elem(const CMP } error: + virConnectClose(conn); free(id); out: return s; @@ -180,10 +189,16 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *assoc_inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *assoc_inst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(source_op), &s); + if (conn == NULL) + goto out; assoc_inst = get_typed_instance(_BROKER, - "Xen", + pfx_from_conn(conn), "ElementConformsToProfile", NAMESPACE(source_op)); @@ -197,6 +212,9 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&(target_op), CMPI_ref); } + virConnectClose(conn); + + out: return assoc_inst; } From heidieck at linux.vnet.ibm.com Fri Nov 23 11:04:15 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 13:04:15 +0200 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1195819371 -3600 # Node ID db20c6206fb6decb484035bec81d7c7f2be75eae # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f [RFC] Enhance handling of association's references The source and target classnames of std_assoc are now lists, containing all supported classnames. This approach frees the provider from listing all possible combinations as instances of std_assoc. Signed-off-by: Heidi Eckhart diff -r bf54de6af2e2 -r db20c6206fb6 std_association.c --- a/std_association.c Tue Nov 20 16:24:27 2007 -0800 +++ b/std_association.c Fri Nov 23 13:02:51 2007 +0100 @@ -61,18 +61,24 @@ static bool match_class(const CMPIBroker static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, - const char *comp_class) + char **comp_class_list) { CMPIObjectPath *rop; + char *comp_class; + int i; rop = CMNewObjectPath(broker, ns, test_class, NULL); - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) - return true; - else - return false; + for (i = 0; comp_class_list[i]; i++) { + comp_class = comp_class_list[i]; + + if ((test_class == NULL) || + (comp_class == NULL) || + match_op(broker, rop, comp_class)) + return true; + } + + return false; } static CMPIStatus filter_results(struct inst_list *list, @@ -113,15 +119,30 @@ std_assoc_get_handler(const struct std_a std_assoc_get_handler(const struct std_assoc_ctx *ctx, const CMPIObjectPath *ref) { - struct std_assoc *ptr; - int i; + struct std_assoc *hdl = NULL; + char *source_class; + int i, j; for (i = 0; ctx->handlers[i]; i++) { - ptr = ctx->handlers[i]; - - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) - return ptr; - } + hdl = ctx->handlers[i]; + + for (j = 0; hdl->source_class[j]; j++) { + source_class = hdl->source_class[j]; + + if (CMClassPathIsA(ctx->brkr, + ref, + source_class, + NULL)) + break; + + source_class = NULL; + } + if (source_class) + break; + } + + if (hdl) + return hdl; return NULL; } @@ -144,9 +165,6 @@ static CMPIStatus do_assoc(struct std_as handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { CU_DEBUG("No handler found."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); goto out; } @@ -243,9 +261,7 @@ static CMPIStatus do_ref(struct std_asso handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); + CU_DEBUG("No handler found."); goto out; } diff -r bf54de6af2e2 -r db20c6206fb6 std_association.h --- a/std_association.h Tue Nov 20 16:24:27 2007 -0800 +++ b/std_association.h Fri Nov 23 13:02:51 2007 +0100 @@ -37,13 +37,13 @@ typedef CMPIInstance *(*make_ref_t)(cons struct std_assoc *); struct std_assoc { - char *source_class; + char **source_class; char *source_prop; - char *target_class; + char **target_class; char *target_prop; - char *assoc_class; + char **assoc_class; assoc_handler_t handler; make_ref_t make_ref; From heidieck at linux.vnet.ibm.com Fri Nov 23 11:04:27 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 13:04:27 +0200 Subject: [Libvirt-cim] [PATCH] [RFC] ECTP: Adoption of changes to std_association logic Message-ID: <1078f8d5a4fb8b33f371.1195819467@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195818927 -3600 # Node ID 1078f8d5a4fb8b33f3714dbf72437a7d7f1eaa8f # Parent 883d767c64256f4d582f06125e05f392454f8a15 [RFC] ECTP: Adoption of changes to std_association logic Signed-off-by: Heidi Eckhart diff -r 883d767c6425 -r 1078f8d5a4fb src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:11:22 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 23 12:55:27 2007 +0100 @@ -218,27 +218,44 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } +char* conformant_standard[] = { + "Xen_RegisteredProfile", + "KVM_RegisteredProfile", + NULL +}; + +char* managed_element[] = { + "CIM_ManagedElement", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementConformsToProfile", + "KVM_ElementConformsToProfile", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", + .source_class = (char**)&conformant_standard, .source_prop = "ConformantStandard", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = prof_to_elem, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_ManagedElement", + .source_class = (char**)&managed_element, .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = (char**)&conformant_standard, .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = elem_to_prof, .make_ref = make_ref @@ -249,7 +266,6 @@ struct std_assoc *assoc_handlers[] = { &backward, NULL }; - STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* From heidieck at linux.vnet.ibm.com Fri Nov 23 11:37:03 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 13:37:03 +0200 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic Message-ID: <07ab148e7311656c997b.1195821423@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1195821409 -3600 # Node ID 07ab148e7311656c997bcc8f5ad6249fdc7b42bc # Parent db20c6206fb6decb484035bec81d7c7f2be75eae Enhance handling of input parameter of std_association logic Signed-off-by: Heidi Eckhart diff -r db20c6206fb6 -r 07ab148e7311 std_association.c --- a/std_association.c Fri Nov 23 13:02:51 2007 +0100 +++ b/std_association.c Fri Nov 23 13:36:49 2007 +0100 @@ -67,14 +67,17 @@ static bool match_class(const CMPIBroker char *comp_class; int i; - rop = CMNewObjectPath(broker, ns, test_class, NULL); + if (test_class == NULL) + return true; + + if (comp_class_list == NULL) + return true; for (i = 0; comp_class_list[i]; i++) { comp_class = comp_class_list[i]; - - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) + rop = CMNewObjectPath(broker, ns,comp_class , NULL); + + if (match_op(broker, rop, test_class)) return true; } @@ -117,11 +120,16 @@ out: static struct std_assoc * std_assoc_get_handler(const struct std_assoc_ctx *ctx, + struct std_assoc_info *info, const CMPIObjectPath *ref) { struct std_assoc *hdl = NULL; char *source_class; int i, j; + bool rc; + + CU_DEBUG("Calling Provider: '%s'", + info->provider_name); for (i = 0; ctx->handlers[i]; i++) { hdl = ctx->handlers[i]; @@ -141,9 +149,66 @@ std_assoc_get_handler(const struct std_a break; } - if (hdl) + if (hdl) { + if (info->assoc_class) { + CU_DEBUG("Check client's assocClass: '%s'", + info->assoc_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->assoc_class, + hdl->assoc_class); + + if (!rc) { + CU_DEBUG("AssocClass not valid."); + goto out; + } + CU_DEBUG("AssocClass valid."); + } + + if (info->result_class) { + CU_DEBUG("Check client's resultClass: '%s'", + info->result_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->result_class, + hdl->target_class); + + if (!rc) { + CU_DEBUG("ResultClass not valid."); + goto out; + } + CU_DEBUG("ResultClass valid."); + } + + if (info->role) { + CU_DEBUG("Check client's role: '%s'", + info->role); + + if (!STREQC(info->role, hdl->source_prop)) { + CU_DEBUG("Role not valid."); + goto out; + } + CU_DEBUG("Role valid."); + } + + + if (info->result_role) { + CU_DEBUG("Check client's resultRole: '%s'", + info->result_role); + + if (!STREQC(info->result_role, hdl->target_prop)) { + CU_DEBUG("ResultRole not valid."); + goto out; + } + CU_DEBUG("ResultRole valid."); + } + return hdl; - + } + + out: return NULL; } @@ -153,57 +218,21 @@ static CMPIStatus do_assoc(struct std_as const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; struct std_assoc *handler; - bool rc; inst_list_init(&list); CU_DEBUG("Getting handler..."); - - handler = std_assoc_get_handler(ctx, ref); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", - handler->source_class, - handler->target_class, - handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", - info->result_class); - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->target_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - CU_DEBUG("Match_class succeeded."); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", - info->assoc_class); - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->assoc_class, - handler->assoc_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Association class given is not valid for" - "this association"); - goto out; - } - CU_DEBUG("Match_class succeeded, calling handler->handler..."); - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { @@ -251,32 +280,22 @@ static CMPIStatus do_ref(struct std_asso const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; + struct std_assoc *handler; int i; - struct std_assoc *handler; - bool rc; inst_list_init(&list); - handler = std_assoc_get_handler(ctx, ref); + CU_DEBUG("Getting handler..."); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->assoc_class); - if (!rc) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) goto out; From heidieck at linux.vnet.ibm.com Fri Nov 23 13:01:36 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 23 Nov 2007 14:01:36 +0100 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: References: Message-ID: <4746CF30.3000405@linux.vnet.ibm.com> Kaitlin Rupert wrote: > # HG changeset patch > # User Kaitlin Rupert > # Date 1195662213 28800 > # Node ID ad925c6e9bf0635e79c2b6e45698d11ede760d99 > # Parent 5c0b219865cd675d54d4a13230c549be93a4d144 > Remove static from get_rasd_instance() > > Add get_rasd_instance() declaration to header file. Also add an additional broker argument so other providers can call this function. > > Fixed minor mem leak in GetInstance(). > > Signed-off-by: Kaitlin Rupert works for me ... +1 -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Mon Nov 26 15:21:39 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 07:21:39 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: (Kaitlin Rupert's message of "Wed, 21 Nov 2007 08:31:43 -0700") References: Message-ID: <87ejedrq0s.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1195662213 28800 KR> # Node ID ad925c6e9bf0635e79c2b6e45698d11ede760d99 KR> # Parent 5c0b219865cd675d54d4a13230c549be93a4d144 KR> Remove static from get_rasd_instance() Looks fine to me, except that: KR> diff -r 5c0b219865cd -r ad925c6e9bf0 src/Virt_RASD.h KR> --- a/src/Virt_RASD.h Wed Nov 21 08:17:31 2007 -0800 KR> +++ b/src/Virt_RASD.h Wed Nov 21 08:23:33 2007 -0800 KR> @@ -41,6 +41,12 @@ int rasds_for_domain(const CMPIBroker *b KR> CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); KR> +CMPIInstance *get_rasd_instance(const CMPIContext *context, KR> + const CMPIObjectPath *ref, KR> + const CMPIBroker *broker, KR> + const char *id, KR> + const uint16_t type); KR> + KR> #endif Your whitespace is broken here. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 26 15:37:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 07:37:15 -0800 Subject: [Libvirt-cim] [PATCH] Enumeration on HostSystem class is returning dups In-Reply-To: <8c0410bfe3d3da3ef61a.1195733317@localhost.localdomain> (Heidi Eckhart's message of "Thu, 22 Nov 2007 13:08:37 +0200") References: <8c0410bfe3d3da3ef61a.1195733317@localhost.localdomain> Message-ID: <87abp1rpas.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1195733309 -3600 HE> # Node ID 8c0410bfe3d3da3ef61aa40bfe75f1f23426b77d HE> # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 HE> Enumeration on HostSystem class is returning dups I think most of the changes in this patch are good, but I'm not quite sure why they prevent returning dups. Can you explain a little bit? HE> + err: HE> + virConnectClose(conn); HE> out: virConnectClose(NULL) is a no-op (like free(NULL)). Everywhere else in the code, we just have a single out label. I'd prefer that we remain consistent with that, unless there is a good reason not to for a particular instance. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 26 15:43:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 07:43:12 -0800 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: <710a381591c1a67e5a79.1195733591@localhost.localdomain> (Heidi Eckhart's message of "Thu, 22 Nov 2007 13:13:11 +0200") References: <710a381591c1a67e5a79.1195733591@localhost.localdomain> Message-ID: <8763zprp0v.fsf@theine.beaverton.ibm.com> HE> + CIM v2.16 schema package. Please create with the folloing ^^^^^^^^ "folloing" should be "following". Looks good otherwise :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Mon Nov 26 15:54:03 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 26 Nov 2007 10:54:03 -0500 Subject: [Libvirt-cim] [PATCH] Enumeration on VirtualSystemManagementService class is returning dups In-Reply-To: References: Message-ID: <474AEC1B.8080801@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1195735052 -3600 > # Node ID fb84303afda80d4d180e9951b114f2769a5d6baa > # Parent 710a381591c1a67e5a79ad3b04aaa8bc7adbb108 > Enumeration on VirtualSystemManagementService class is returning dups > > On systems where only one hypervisor is existing, the provider > returned instance for all known subclasses (Xen, KVM). > Signed-off-by: Heidi Eckhart > > > This looks good, although the same little issue with virConnectClose() applies here as well. +1 -- -Jay From danms at us.ibm.com Mon Nov 26 15:56:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 07:56:26 -0800 Subject: [Libvirt-cim] [PATCH] Enumeration on VirtualSystemManagementService class is returning dups In-Reply-To: (Heidi Eckhart's message of "Thu, 22 Nov 2007 13:39:16 +0200") References: Message-ID: <871wadroet.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1195735052 -3600 HE> # Node ID fb84303afda80d4d180e9951b114f2769a5d6baa HE> # Parent 710a381591c1a67e5a79ad3b04aaa8bc7adbb108 HE> Enumeration on VirtualSystemManagementService class is returning dups Ah, I see now. Connecting first causes us to bail if the hypervisor isn't present. Both of these patches look fine to me now, but I'd still like to see the "err:" removed. Thanks Heidi! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Mon Nov 26 16:04:49 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 26 Nov 2007 11:04:49 -0500 Subject: [Libvirt-cim] [PATCH] Enumeration on VirtualSystemManagementService class is returning dups In-Reply-To: <474AEC1B.8080801@linux.vnet.ibm.com> References: <474AEC1B.8080801@linux.vnet.ibm.com> Message-ID: <474AEEA1.8080300@linux.vnet.ibm.com> Jay Gagnon wrote: > Heidi Eckhart wrote: > >> # HG changeset patch >> # User Heidi Eckhart >> # Date 1195735052 -3600 >> # Node ID fb84303afda80d4d180e9951b114f2769a5d6baa >> # Parent 710a381591c1a67e5a79ad3b04aaa8bc7adbb108 >> Enumeration on VirtualSystemManagementService class is returning dups >> >> On systems where only one hypervisor is existing, the provider >> returned instance for all known subclasses (Xen, KVM). >> Signed-off-by: Heidi Eckhart >> >> >> >> > This looks good, although the same little issue with virConnectClose() > applies here as well. +1 > > > Sorry, reading that back I don't think it came out right. The idea was supposed to be that I'm fine with what the new changes do, and assuming the virConnectClose() bit gets cleaned up, I'm +1 on it. That cleanup will hardly be a total rework of the patch, so I think it's safe to say we can apply the cleaned up one once it hits the list. -- -Jay From danms at us.ibm.com Mon Nov 26 16:08:19 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 08:08:19 -0800 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: <50b0c2bad1e31abff47a.1195812766@localhost.localdomain> (Heidi Eckhart's message of "Fri, 23 Nov 2007 11:12:46 +0200") References: <50b0c2bad1e31abff47a.1195812766@localhost.localdomain> Message-ID: <87wss5q9ak.fsf@theine.beaverton.ibm.com> HE> diff -r a479cec9721a -r 50b0c2bad1e3 src/Virt_ElementConformsToProfile.c HE> --- a/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:44 2007 +0100 HE> +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:46 2007 +0100 HE> @@ -133,9 +133,14 @@ static CMPIStatus elem_to_prof(const CMP HE> { HE> CMPIStatus s = {CMPI_RC_OK, NULL}; HE> CMPIInstance *instance; HE> + virConnectPtr conn = NULL; You add a virConnectPtr here, HE> + struct reg_prof *candidate; HE> char *classname; HE> - struct reg_prof *candidate; HE> int i; HE> + HE> + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); HE> + if (conn == NULL) HE> + goto out; and open it here, HE> classname = class_base_name(CLASSNAME(ref)); HE> if (classname == NULL) { HE> @@ -151,10 +156,12 @@ static CMPIStatus elem_to_prof(const CMP HE> instance = reg_prof_instance(_BROKER, HE> "/root/interop", HE> - NULL, HE> + NULL, HE> + conn, HE> candidate); HE> if (instance == NULL) { HE> - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, HE> + CMSetStatusWithChars(_BROKER, &s, HE> + CMPI_RC_ERR_FAILED, HE> "Can't create profile instance."); HE> goto error; HE> } But I don't see you close it anywhere before you exit the function, so I think this leaks the connection. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Mon Nov 26 16:13:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 08:13:09 -0800 Subject: [Libvirt-cim] [PATCH 3 of 3] Fix class prefix to depend on established hypervisor connection In-Reply-To: <883d767c64256f4d582f.1195812767@localhost.localdomain> (Heidi Eckhart's message of "Fri, 23 Nov 2007 11:12:47 +0200") References: <883d767c64256f4d582f.1195812767@localhost.localdomain> Message-ID: <87sl2tq92i.fsf@theine.beaverton.ibm.com> HE> diff -r 50b0c2bad1e3 -r 883d767c6425 src/Virt_ElementConformsToProfile.c HE> --- a/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:46 2007 +0100 HE> +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:11:22 2007 +0100 HE> @@ -50,7 +50,8 @@ static CMPIStatus elem_instances(const C HE> static CMPIStatus elem_instances(const CMPIObjectPath *ref, HE> struct std_assoc_info *info, HE> struct inst_list *list, HE> - struct reg_prof *profile) HE> + struct reg_prof *profile, HE> + virConnectPtr conn) Since we have a ref here, can we avoid passing a connection in and do the connect_by_classname() inside? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Mon Nov 26 16:16:24 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Mon, 26 Nov 2007 11:16:24 -0500 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: References: Message-ID: <474AF158.6040006@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1195812344 -3600 > # Node ID a479cec9721a58c537929206bc5190b22f709fc1 > # Parent 4cce597d4e48b5e3efc6e4307be3234bd3051c9b > Enumeration of RegisteredProfile class is returning wrong instances > Signed-off-by: Heidi Eckhart > The move to connect_by_classname() work looks good, and in general I like the cleanup of reg_prof_instance(), but I have one question about it. You added a virConnectPtr to the argument list, and I'll grant the function does need a connection it doesn't already have in there, by why not pass in a CMPIObjectPath so that it used to make the connection? That way all the callers don't have to bother creating their own connections just to pass them in, and since reg_prof_instance is already being given a CMPIBroker and creates its own CMPIStatus, giving it the ref will give it everything it needs to make the appropriate connection and do the same "if (conn == NULL) goto out;" that the calling functions do right now. -- -Jay From danms at us.ibm.com Mon Nov 26 16:29:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 08:29:54 -0800 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references In-Reply-To: (Heidi Eckhart's message of "Fri, 23 Nov 2007 13:04:15 +0200") References: Message-ID: <87oddhq8al.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1195819371 -3600 HE> # Node ID db20c6206fb6decb484035bec81d7c7f2be75eae HE> # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f HE> [RFC] Enhance handling of association's references HE> The source and target classnames of std_assoc are now lists, HE> containing all supported classnames. This approach frees the HE> provider from listing all possible combinations as instances of HE> std_assoc. I'm tentatively okay with this approach. We need to make a decision and go with it so that we can freeze (at least to some extent) the libcmpiutil API and make an official code release. HE> @@ -113,15 +119,30 @@ std_assoc_get_handler(const struct std_a HE> std_assoc_get_handler(const struct std_assoc_ctx *ctx, HE> const CMPIObjectPath *ref) HE> { HE> - struct std_assoc *ptr; HE> - int i; HE> + struct std_assoc *hdl = NULL; HE> + char *source_class; HE> + int i, j; Please don't arbitrarily rename and reorder variables like this. It makes it harder to read the diff and is really unnecessary. HE> for (i = 0; ctx->handlers[i]; i++) { HE> - ptr = ctx->handlers[i]; HE> - HE> - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) HE> - return ptr; HE> - } HE> + hdl = ctx->handlers[i]; HE> + HE> + for (j = 0; hdl->source_class[j]; j++) { HE> + source_class = hdl->source_class[j]; HE> + HE> + if (CMClassPathIsA(ctx->brkr, HE> + ref, HE> + source_class, HE> + NULL)) HE> + break; HE> + HE> + source_class = NULL; HE> + } HE> + if (source_class) HE> + break; HE> + } HE> + HE> + if (hdl) HE> + return hdl; This double-nested loop really needs to have the inner loop broken out as another function (like match_class()). HE> return NULL; HE> } HE> @@ -144,9 +165,6 @@ static CMPIStatus do_assoc(struct std_as HE> handler = std_assoc_get_handler(ctx, ref); HE> if (handler == NULL) { HE> CU_DEBUG("No handler found."); HE> - cu_statusf(ctx->brkr, &s, HE> - CMPI_RC_ERR_FAILED, HE> - "Unable to handle this association"); HE> goto out; HE> } HE> @@ -243,9 +261,7 @@ static CMPIStatus do_ref(struct std_asso HE> handler = std_assoc_get_handler(ctx, ref); HE> if (handler == NULL) { HE> - cu_statusf(ctx->brkr, &s, HE> - CMPI_RC_ERR_FAILED, HE> - "Unable to handle this association"); HE> + CU_DEBUG("No handler found."); HE> goto out; HE> } Why should we not return error in these cases now? Currently, these signal the case of someone trying to do something like: wbemcli ain -ac Xen_SystemDevice http://...:Xen_MemoryPool (i.e. resolving a particular association with an invalid reference) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Mon Nov 26 17:38:48 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 26 Nov 2007 10:38:48 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Updated ElementSettingData to support RASD instances. Message-ID: Revised so that get_rasd_instance() is no longer static. This function should be used by other providers - there isn't a need for a new function. Also, cleaned up some of the confusion structure / function names in Virt_ElementSettingData. Fixed whitespace issues in Virt_RASD.h From kaitlin at linux.vnet.ibm.com Mon Nov 26 17:38:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 26 Nov 2007 10:38:49 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Remove static from get_rasd_instance() In-Reply-To: Message-ID: <140613919317633ad4b3.1196102329@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1195662213 28800 # Node ID 140613919317633ad4b325b6321809849ecfbd41 # Parent 38cc6833481dd27b1d2d451b81e74aaf8f900944 Remove static from get_rasd_instance() Add get_rasd_instance() declaration to header file. Also add an additional broker argument so other providers can call this function. Fixed minor mem leak in GetInstance(). fixed whitespace issue in Virt_RASD.h Signed-off-by: Kaitlin Rupert diff -r 38cc6833481d -r 140613919317 src/Virt_RASD.c --- a/src/Virt_RASD.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_RASD.c Wed Nov 21 08:23:33 2007 -0800 @@ -177,10 +177,11 @@ static CMPIInstance *rasd_from_vdev(cons return inst; } -static CMPIInstance *get_rasd_instance(const CMPIContext *context, - const CMPIObjectPath *ref, - const char *id, - const uint16_t type) +CMPIInstance *get_rasd_instance(const CMPIContext *context, + const CMPIObjectPath *ref, + const CMPIBroker *broker, + const char *id, + const uint16_t type) { CMPIInstance *inst = NULL; CMPIStatus s; @@ -194,13 +195,13 @@ static CMPIInstance *get_rasd_instance(c if (!ret) return NULL; - conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + conn = connect_by_classname(broker, CLASSNAME(ref), &s); if (conn == NULL) goto out; dev = find_dev(conn, type, host, devid); if (dev) - inst = rasd_from_vdev(_BROKER, dev, host, ref); + inst = rasd_from_vdev(broker, dev, host, ref); out: virConnectClose(conn); @@ -264,7 +265,7 @@ static CMPIStatus GetInstance(CMPIInstan goto out; } - inst = get_rasd_instance(context, ref, id, type); + inst = get_rasd_instance(context, ref, _BROKER, id, type); if (inst != NULL) CMReturnInstance(results, inst); @@ -273,6 +274,8 @@ static CMPIStatus GetInstance(CMPIInstan CMPI_RC_ERR_FAILED, "Unknown instance"); out: + free(id); + return s; } diff -r 38cc6833481d -r 140613919317 src/Virt_RASD.h --- a/src/Virt_RASD.h Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_RASD.h Wed Nov 21 08:23:33 2007 -0800 @@ -41,6 +41,12 @@ int rasds_for_domain(const CMPIBroker *b CMPIrc rasd_type_from_classname(const char *cn, uint16_t *type); +CMPIInstance *get_rasd_instance(const CMPIContext *context, + const CMPIObjectPath *ref, + const CMPIBroker *broker, + const char *id, + const uint16_t type); + #endif /* From kaitlin at linux.vnet.ibm.com Mon Nov 26 17:38:50 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 26 Nov 2007 10:38:50 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Adding the RASD related part In-Reply-To: Message-ID: <38cc6833481dd27b1d2d.1196102330@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1196101928 28800 # Node ID 38cc6833481dd27b1d2d451b81e74aaf8f900944 # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 Adding the RASD related part. This is based on the Resource Allocation Profile. My understanding is that we are implementing a setup similar to Figure 3 on page 31. In this case, we'll use the same RASD instance for State as well as Defined. Updated to due to change in get_rasd_instance_from_ref(). Also updated structure and handler function names to avoid confusion. Signed-off-by: Kaitlin Rupert diff -r 278c59f67cb1 -r 38cc6833481d src/Makefile.am --- a/src/Makefile.am Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Makefile.am Mon Nov 26 10:32:08 2007 -0800 @@ -133,6 +133,6 @@ libVirt_HostedService_la_SOURCES = Virt_ libVirt_HostedService_la_SOURCES = Virt_HostedService.c libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService -libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la +libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_RASD.la libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c -libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD +libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD -lVirt_RASD diff -r 278c59f67cb1 -r 38cc6833481d src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Virt_ElementSettingData.c Mon Nov 26 10:32:08 2007 -0800 @@ -31,12 +31,13 @@ #include "misc_util.h" #include "Virt_VSSD.h" +#include "Virt_RASD.h" const static CMPIBroker *_BROKER; -static CMPIStatus vssd_to_sd(const CMPIObjectPath *ref, - struct std_assoc_info *info, - struct inst_list *list) +static CMPIStatus vssd_to_vssd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) { CMPIStatus s; CMPIInstance *inst; @@ -83,6 +84,49 @@ static CMPIStatus vssd_to_sd(const CMPIO return s; } +static CMPIStatus rasd_to_rasd(const CMPIObjectPath *ref, + struct std_assoc_info *info, + struct inst_list *list) +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst; + char *id = NULL; + uint16_t type; + + ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); + + id = cu_get_str_path(ref, "InstanceID"); + if (id == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing InstanceID"); + goto out; + } + + if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to determine RASD type"); + goto out; + } + + inst = get_rasd_instance(info->context, ref, _BROKER, id, type); + if (inst == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Error getting associated RASD"); + + goto out; + } + + inst_list_add(list, inst); + + out: + free(id); + + return s; +} + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, @@ -130,7 +174,7 @@ out: return refinst; } -static struct std_assoc vssd_to_sd_fd_bkwd = { +static struct std_assoc _vssd_to_vssd = { .source_class = "CIM_VirtualSystemSettingData", .source_prop = "ManagedElement", @@ -139,12 +183,26 @@ static struct std_assoc vssd_to_sd_fd_bk .assoc_class = "CIM_ElementSettingData", - .handler = vssd_to_sd, + .handler = vssd_to_vssd, .make_ref = make_ref }; +static struct std_assoc _rasd_to_rasd = { + .source_class = "CIM_ResourceAllocationSettingData", + .source_prop = "ManagedElement", + + .target_class = "CIM_ManagedElement", + .target_prop = "SettingData", + + .assoc_class = "CIM_ElementSettingData", + + .handler = rasd_to_rasd, + .make_ref = make_ref +}; + static struct std_assoc *handlers[] = { - &vssd_to_sd_fd_bkwd, + &_vssd_to_vssd, + &_rasd_to_rasd, NULL }; From danms at us.ibm.com Mon Nov 26 23:54:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 16:54:30 -0700 Subject: [Libvirt-cim] [PATCH] More rpm spec changes Message-ID: <05f120725e3dc562dc8f.1196124870@theine> # HG changeset patch # User Dan Smith # Date 1196124672 28800 # Node ID 05f120725e3dc562dc8fa251da698faa474f0b55 # Parent 183df45f2bb6debe6dd9fc4aec82ad8673741107 More rpm spec changes - Make dist a dependency of rpm and change the permissions on the spec file before building the rpm - Disable static library builds - Make install use "install -p" to preserve file timestamps - Include COPYING file in the base package Signed-off-by: Dan Smith diff -r 183df45f2bb6 -r 05f120725e3d Makefile.am --- a/Makefile.am Wed Nov 21 07:01:01 2007 -0800 +++ b/Makefile.am Mon Nov 26 16:51:12 2007 -0800 @@ -47,6 +47,7 @@ clean-local: clean-local: rm -f $(BUILT_SOURCES) *~ -rpm: clean - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) +rpm: clean dist + @chmod 0644 libcmpiutil.spec $(distdir).tar.gz + @(unset CDPATH ; rpmbuild -ta $(distdir).tar.gz) diff -r 183df45f2bb6 -r 05f120725e3d libcmpiutil.spec.in --- a/libcmpiutil.spec.in Wed Nov 21 07:01:01 2007 -0800 +++ b/libcmpiutil.spec.in Mon Nov 26 16:51:12 2007 -0800 @@ -5,7 +5,7 @@ Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@ Release: 1%{?dist}%{?extra_release} License: LGPLv2+ -Group: Development/Libraries +Group: System Environment/Libraries Source: libcmpiutil-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/CIM/ @@ -40,13 +40,13 @@ chmod -x *.c *.y *.h *.l chmod -x *.c *.y *.h *.l %build -%configure +%configure --enable-static=no make %{?_smp_mflags} %install rm -fr $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install +make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a @@ -58,13 +58,13 @@ rm -fr $RPM_BUILD_ROOT %postun -p /sbin/ldconfig %files -%defattr(-, root, root) +%defattr(-, root, root, -) -%doc doc/doxygen.conf doc/mainpage README +%doc doc/doxygen.conf doc/mainpage README COPYING %{_libdir}/lib*.so.* %files devel -%defattr(-, root, root) +%defattr(-, root, root, -) %{_libdir}/lib*.so %dir %{_includedir}/libcmpiutil From danms at us.ibm.com Mon Nov 26 23:54:38 2007 From: danms at us.ibm.com (Dan Smith) Date: Mon, 26 Nov 2007 16:54:38 -0700 Subject: [Libvirt-cim] [PATCH] [CU][RFC] Correct a few API issues Message-ID: <96b651213e50f0258698.1196124878@theine> # HG changeset patch # User Dan Smith # Date 1196124861 28800 # Node ID 96b651213e50f02586988064a014bbe746dc9c59 # Parent 05f120725e3dc562dc8fa251da698faa474f0b55 [CU][RFC] Correct a few API issues that I think need to be resolved before we snap a release. Some of the cu_get_* functions returned values instead of a CMPIrc's like everything else, so this changes that. Also, return const char *'s from the broker memory so that the callers don't need to free the result. This will require some work in libvirt-cim to make sure the new API is adhered to properly. If this is okay with people, I'll follow up with a patch to libvirt-cim to make those changes. Any other discussion about things that should change in the libcmpiutil API is welcomed. Signed-off-by: Dan Smith diff -r 05f120725e3d -r 96b651213e50 args_util.c --- a/args_util.c Mon Nov 26 16:51:12 2007 -0800 +++ b/args_util.c Mon Nov 26 16:54:21 2007 -0800 @@ -32,28 +32,32 @@ #define CU_WEAK_TYPES 1 -char *cu_get_str_path(const CMPIObjectPath *reference, const char *key) +CMPIrc cu_get_str_path(const CMPIObjectPath *ref, + const char *key, + const char **val) { CMPIData data; CMPIStatus s; const char *value; - data = CMGetKey(reference, key, &s); + data = CMGetKey(ref, key, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(data) || CMIsNullObject(data.value.string)) - return NULL; + return CMPI_RC_ERR_FAILED; value = CMGetCharPtr(data.value.string); if ((value == NULL) || (*value == '\0')) - return NULL; - - return strdup(value); -} - -int cu_get_u16_path(const CMPIObjectPath *reference, - const char *key, - uint16_t *target) + return CMPI_RC_ERR_TYPE_MISMATCH; + + *val = value; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_u16_path(const CMPIObjectPath *reference, + const char *key, + uint16_t *target) { CMPIData data; CMPIStatus s; @@ -61,11 +65,11 @@ int cu_get_u16_path(const CMPIObjectPath data = CMGetKey(reference, key, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(data)) - return 0; + return CMPI_RC_ERR_FAILED; *target = data.value.uint16; - return 1; + return CMPI_RC_OK; } const char *cu_check_args(const CMPIArgs *args, const char **names) @@ -85,92 +89,101 @@ const char *cu_check_args(const CMPIArgs return NULL; } -char *cu_get_str_arg(const CMPIArgs *args, const char *name) -{ - CMPIData argdata; - char *argval; +CMPIrc cu_get_str_arg(const CMPIArgs *args, const char *name, const char **val) +{ + CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) - return NULL; + return CMPI_RC_ERR_INVALID_PARAMETER; if ((argdata.type != CMPI_string) || CMIsNullObject(argdata.value.string)) - return NULL; - - argval = strdup(CMGetCharPtr(argdata.value.string)); - - return argval; -} - -CMPIObjectPath *cu_get_ref_arg(const CMPIArgs *args, const char *name) + return CMPI_RC_ERR_TYPE_MISMATCH; + + *val = CMGetCharPtr(argdata.value.string); + + return CMPI_RC_OK; +} + +CMPIrc cu_get_ref_arg(const CMPIArgs *args, + const char *name, + CMPIObjectPath **op) { CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) - return NULL; + return CMPI_RC_ERR_INVALID_PARAMETER; if ((argdata.type != CMPI_ref) || CMIsNullObject(argdata.value.ref)) - return NULL; - - return argdata.value.ref; -} - -CMPIInstance *cu_get_inst_arg(const CMPIArgs *args, const char *name) -{ - CMPIData argdata; - CMPIStatus s; - - argdata = CMGetArg(args, name, &s); - if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) { - return NULL; - } + return CMPI_RC_ERR_TYPE_MISMATCH; + + *op = argdata.value.ref; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_inst_arg(const CMPIArgs *args, + const char *name, + CMPIInstance **inst) +{ + CMPIData argdata; + CMPIStatus s; + + argdata = CMGetArg(args, name, &s); + if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) + return CMPI_RC_ERR_INVALID_PARAMETER; if ((argdata.type != CMPI_instance) || - CMIsNullObject(argdata.value.inst)) { - return NULL; - } - - return argdata.value.inst; -} - -CMPIArray *cu_get_array_arg(const CMPIArgs *args, const char *name) + CMIsNullObject(argdata.value.inst)) + CMPI_RC_ERR_TYPE_MISMATCH; + + *inst = argdata.value.inst; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_array_arg(const CMPIArgs *args, + const char *name, + CMPIArray **array) { CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(argdata)) - return NULL; + return CMPI_RC_ERR_INVALID_PARAMETER; if (!CMIsArray(argdata) || CMIsNullObject(argdata.value.array)) - return NULL; - - return argdata.value.array; -} - -int cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target) + return CMPI_RC_ERR_TYPE_MISMATCH; + + *array = argdata.value.array; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target) { CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(argdata)) - return 0; + return CMPI_RC_ERR_INVALID_PARAMETER; #ifdef CU_WEAK_TYPES if (!(argdata.type & CMPI_INTEGER)) #else if (argdata.type != CMPI_uint16) #endif - return 0; + return CMPI_RC_ERR_TYPE_MISMATCH; *target = argdata.value.uint16; - return 1; + return CMPI_RC_OK; } #define REQUIRE_PROPERTY_DEFINED(i, p, pv, s) \ diff -r 05f120725e3d -r 96b651213e50 libcmpiutil.h --- a/libcmpiutil.h Mon Nov 26 16:51:12 2007 -0800 +++ b/libcmpiutil.h Mon Nov 26 16:54:21 2007 -0800 @@ -91,18 +91,22 @@ const char *cu_check_args(const CMPIArgs * * @param args The argument list to search * @param name The name of the argument - * @returns The string argument's value, or NULL if error (must be free()'d) - */ -char *cu_get_str_arg(const CMPIArgs *args, const char *name); + * @param val The value of the argument (must be free()'d) + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_str_arg(const CMPIArgs *args, const char *name, const char **val); /** * Get a reference argument * * @param args The argument list to search * @param name The name of the argument - * @returns The reference argument's value, or NULL if error - */ -CMPIObjectPath *cu_get_ref_arg(const CMPIArgs *args, const char *name); + * @param op The reference argument's value + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_ref_arg(const CMPIArgs *args, + const char *name, + CMPIObjectPath **op); /** * Get an instance argument @@ -111,7 +115,9 @@ CMPIObjectPath *cu_get_ref_arg(const CMP * @param name The name of the argument * @returns The instance argument's value, or NULL if error */ -CMPIInstance *cu_get_inst_arg(const CMPIArgs *args, const char *name); +CMPIrc cu_get_inst_arg(const CMPIArgs *args, + const char *name, + CMPIInstance **inst); /** * Get an array argument @@ -120,7 +126,9 @@ CMPIInstance *cu_get_inst_arg(const CMPI * @param name The name of the argument * @returns The array argument's value, or NULL if error */ -CMPIArray *cu_get_array_arg(const CMPIArgs *args, const char *name); +CMPIrc cu_get_array_arg(const CMPIArgs *args, + const char *name, + CMPIArray **array); /** * Get a uint16 argument @@ -128,18 +136,22 @@ CMPIArray *cu_get_array_arg(const CMPIAr * @param args The argument list to search * @param name The name of the argument * @param target The uint16_t to reflect the argument value - * @returns nonzero on success, zero otherwise - */ -int cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target); + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target); /** * Get a string component of an object path * - * @param reference The object path + * @param ref The object path * @param key The name of the component to return - * @returns The value of the component, or NULL if error (must be free()'d) - */ -char *cu_get_str_path(const CMPIObjectPath *reference, const char *key); + * @param val The value of the component, or NULL if error (must be + * free()'d) + * @returns CMPI_RC_OK on success + */ +CMPIrc cu_get_str_path(const CMPIObjectPath *ref, + const char *key, + const char **val); /** * Get a uint16 component of an object path @@ -147,11 +159,11 @@ char *cu_get_str_path(const CMPIObjectPa * @param reference The object path * @param key The name of the component to return * @param target A pointer to the uint16 to set - * @returns nonzero on success, zero otherwise - */ -int cu_get_u16_path(const CMPIObjectPath *reference, - const char *key, - uint16_t *target); + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_u16_path(const CMPIObjectPath *reference, + const char *key, + uint16_t *target); /* Forward declaration */ struct inst_list; diff -r 05f120725e3d -r 96b651213e50 std_indication.c --- a/std_indication.c Mon Nov 26 16:51:12 2007 -0800 +++ b/std_indication.c Mon Nov 26 16:54:21 2007 -0800 @@ -49,7 +49,8 @@ static CMPIStatus raise(struct std_indic if (ctx->handler->raise_fn == NULL) return (CMPIStatus){CMPI_RC_OK, NULL}; - inst = cu_get_inst_arg(argsin, "Indication"); + if (cu_get_inst_arg(argsin, "Indication", &inst) != CMPI_RC_OK) + return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL}; return ctx->handler->raise_fn(context, inst); } From kaitlin at linux.vnet.ibm.com Tue Nov 27 05:06:18 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Mon, 26 Nov 2007 21:06:18 -0800 Subject: [Libvirt-cim] [PATCH] More rpm spec changes In-Reply-To: <05f120725e3dc562dc8f.1196124870@theine> References: <05f120725e3dc562dc8f.1196124870@theine> Message-ID: <474BA5CA.4030405@linux.vnet.ibm.com> Dan Smith wrote: > %files > -%defattr(-, root, root) > +%defattr(-, root, root, -) > I'm not very versed with spec files - out of curiosity, what's the significance of the above change? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From veillard at redhat.com Tue Nov 27 08:38:57 2007 From: veillard at redhat.com (Daniel Veillard) Date: Tue, 27 Nov 2007 03:38:57 -0500 Subject: [Libvirt-cim] [PATCH] More rpm spec changes In-Reply-To: <05f120725e3dc562dc8f.1196124870@theine> References: <05f120725e3dc562dc8f.1196124870@theine> Message-ID: <20071127083857.GB10190@redhat.com> On Mon, Nov 26, 2007 at 04:54:30PM -0700, Dan Smith wrote: > - Make dist a dependency of rpm and change the permissions on the spec file > before building the rpm [....] > - Include COPYING file in the base package > > Signed-off-by: Dan Smith > > diff -r 183df45f2bb6 -r 05f120725e3d Makefile.am > --- a/Makefile.am Wed Nov 21 07:01:01 2007 -0800 > +++ b/Makefile.am Mon Nov 26 16:51:12 2007 -0800 > @@ -47,6 +47,7 @@ clean-local: > clean-local: > rm -f $(BUILT_SOURCES) *~ > > -rpm: clean > - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) > +rpm: clean dist > + @chmod 0644 libcmpiutil.spec $(distdir).tar.gz > + @(unset CDPATH ; rpmbuild -ta $(distdir).tar.gz) well the problem of CDPATH is that 'make dist' tends to break if you have a CDPATH (since 'cd' echo the selected directory), so that change doesn't work. Just add the chmods in the @() > -%doc doc/doxygen.conf doc/mainpage README > +%doc doc/doxygen.conf doc/mainpage README COPYING GNU autoconf tends to populate COPYING with the GPL licence, we just need to make sure this doesn't happen in practice ... Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From heidieck at linux.vnet.ibm.com Tue Nov 27 08:07:26 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 10:07:26 +0200 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196154214 -3600 # Node ID ea06dd0a020c087d1373551722b89a1da372453d # Parent 31093e14df128c2b0c01480fd5c001ee127d1e0b Add installation instructions for root/interop namespace Signed-off-by: Heidi Eckhart diff -r 31093e14df12 -r ea06dd0a020c doc/libvirt-cim.html --- a/doc/libvirt-cim.html Fri Nov 23 10:57:12 2007 +0100 +++ b/doc/libvirt-cim.html Tue Nov 27 10:03:34 2007 +0100 @@ -76,6 +76,7 @@ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt cimv216.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers.mof
$ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/virt qualifiers_optional.mof
+ $ sudo cimmofl -uc -aEV -R$PEGASUS_REPO -n /root/interop cimv216-interop.mof

To install the schema in SFCB:

@@ -111,6 +112,23 @@ +//#pragma include ("Security/CIM_IPNetworkSecurityIndication.mof")
+//#pragma include ("Security/CIM_IPPacketFilterIndication.mof")
#pragma include ("Support/PRS_ActivityContact.mof")
+

+ +

cimv216-interop.mof is not part of the official DMTF + CIM v2.16 schema package. Please create with the following content: +

+ +

+#pragma locale ("en_US")
+#pragma include ("qualifiers.mof")
+#pragma include ("qualifiers_optional.mof")
+#pragma include ("Core/CIM_ManagedElement.mof")
+#pragma include ("Interop/CIM_RegisteredProfile.mof")
+#pragma include ("Interop/CIM_RegisteredSubProfile.mof")
+#pragma include ("Core/CIM_Dependency.mof")
+#pragma include ("Interop/CIM_ElementConformsToProfile.mof")
+#pragma include ("Interop/CIM_ReferencedProfile.mof")
+#pragma include ("Interop/CIM_SubProfileRequiresProfile.mof")

Platform Support

From heidieck at linux.vnet.ibm.com Tue Nov 27 08:24:14 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 10:24:14 +0200 Subject: [Libvirt-cim] [PATCH] Enumeration on HostSystem class is returning dups Message-ID: <533f6c0e7e4dd1b3264e.1196155454@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196155366 -3600 # Node ID 533f6c0e7e4dd1b3264e136211d6f84062d9f79d # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 Enumeration on HostSystem class is returning dups On systems where only one hypervisor is existing, the provider returned instance for all known subclasses (Xen, KVM). Signed-off-by: Heidi Eckhart diff -r 278c59f67cb1 -r 533f6c0e7e4d src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Tue Nov 20 16:26:00 2007 -0500 +++ b/src/Virt_HostSystem.c Tue Nov 27 10:22:46 2007 +0100 @@ -36,20 +36,24 @@ const static CMPIBroker *_BROKER; -static int set_host_system_properties(CMPIInstance *instance, - const char *classname) +static int set_host_system_properties(CMPIInstance *instance) { + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIObjectPath *op; char hostname[256] = {0}; - CMSetProperty(instance, "CreationClassName", - (CMPIValue *)classname, CMPI_chars); + op = CMGetObjectPath(instance, &s); + if ((s.rc == CMPI_RC_OK) || !CMIsNullObject(op)) { + CMSetProperty(instance, "CreationClassName", + (CMPIValue *)CLASSNAME(op), CMPI_chars); + } if (gethostname(hostname, sizeof(hostname) - 1) != 0) strcpy(hostname, "unknown"); CMSetProperty(instance, "Name", (CMPIValue *)hostname, CMPI_chars); - + return 1; } @@ -57,44 +61,32 @@ CMPIStatus get_host_cs(const CMPIBroker const CMPIObjectPath *reference, CMPIInstance **instance) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - CMPIObjectPath *op; - CMPIStatus s; - char *ns; - char *classname; + virConnectPtr conn = NULL; - ns = NAMESPACE(reference); + *instance = NULL; + conn = connect_by_classname(broker, CLASSNAME(reference), &s); + if (conn == NULL) + return s; - classname = get_typed_class(CLASSNAME(reference), "HostSystem"); - if (classname == NULL) { - CMSetStatusWithChars(broker, &s, + inst = get_typed_instance(broker, + pfx_from_conn(conn), + "HostSystem", + NAMESPACE(reference)); + + if (inst == NULL) { + CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Invalid class"); + "Can't create HostSystem instance."); goto out; } - op = CMNewObjectPath(broker, ns, classname, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for HostSystem"); - goto out; - } - - inst = CMNewInstance(broker, op, &s); - if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(op))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); - goto out; - } - - set_host_system_properties(inst, classname); + set_host_system_properties(inst); out: + virConnectClose(conn); *instance = inst; - - free(classname); return s; } @@ -103,17 +95,11 @@ static CMPIStatus return_host_cs(const C const CMPIResult *results, int name_only) { - CMPIStatus s; + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; - char *ns; - - if (!provider_is_responsible(_BROKER, reference, &s)) - return s; - - ns = NAMESPACE(reference); s = get_host_cs(_BROKER, reference, &instance); - if (s.rc != CMPI_RC_OK) + if (s.rc != CMPI_RC_OK || instance == NULL) goto out; if (name_only) From heidieck at linux.vnet.ibm.com Tue Nov 27 09:30:51 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 10:30:51 +0100 Subject: [Libvirt-cim] [PATCH] Enumeration on HostSystem class is returning dups In-Reply-To: <87abp1rpas.fsf@theine.beaverton.ibm.com> References: <8c0410bfe3d3da3ef61a.1195733317@localhost.localdomain> <87abp1rpas.fsf@theine.beaverton.ibm.com> Message-ID: <474BE3CB.3020808@linux.vnet.ibm.com> Dan Smith wrote: > HE> # HG changeset patch > HE> # User Heidi Eckhart > HE> # Date 1195733309 -3600 > HE> # Node ID 8c0410bfe3d3da3ef61aa40bfe75f1f23426b77d > HE> # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 > HE> Enumeration on HostSystem class is returning dups > > I think most of the changes in this patch are good, but I'm not quite > sure why they prevent returning dups. Can you explain a little bit? > This was the result of an enumeration against CIM_ComputerSystem. The HostSystem provider returned instances of Xen_HostSystem, while I have no Xen installed on my system. [heidineu at localhost ~]$ wbemein http://localhost/root/virt:CIM_ComputerSystem localhost:5988/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain" localhost:5988/root/virt:Xen_HostSystem.CreationClassName="Xen_HostSystem",Name="localhost.localdomain" localhost:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1" The reason why this happened is, that the provider_is_responsible() function checks only for "CIM" prefix now and no longer "compares" the requested class prefix against the hypervisor type installed on the machine. This is now done by connect_by_classname(). The result was, that the provider returned instances independent of the installed hypervisor. > HE> + err: > HE> + virConnectClose(conn); > HE> out: > > virConnectClose(NULL) is a no-op (like free(NULL)). Everywhere else > in the code, we just have a single out label. I'd prefer that we > remain consistent with that, unless there is a good reason not to for > a particular instance. > fixed -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 08:36:06 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 10:36:06 +0200 Subject: [Libvirt-cim] [PATCH] Enumeration on VirtualSystemManagementService class is returning dups Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196156053 -3600 # Node ID ce846c470102c9c126b027c68d58f5205cadfb10 # Parent a73fce7861b2fef889762fc2c4d8f70e7ea499a1 Enumeration on VirtualSystemManagementService class is returning dups On systems where only one hypervisor is existing, the provider returned instance for all known subclasses (Xen, KVM). Signed-off-by: Heidi Eckhart diff -r a73fce7861b2 -r ce846c470102 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Nov 27 10:32:04 2007 +0100 +++ b/src/Virt_VirtualSystemManagementService.c Tue Nov 27 10:34:13 2007 +0100 @@ -1048,20 +1048,27 @@ CMPIStatus get_vsms(const CMPIObjectPath CMPIStatus get_vsms(const CMPIObjectPath *reference, CMPIInstance **_inst, const CMPIBroker *broker) -{ - CMPIStatus s; - CMPIInstance *inst; - CMPIInstance *host; +{ + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *inst = NULL; + CMPIInstance *host = NULL; char *val = NULL; + virConnectPtr conn = NULL; + + *_inst = NULL; + conn = connect_by_classname(broker, CLASSNAME(reference), &s); + if (conn == NULL) + return s; s = get_host_cs(broker, reference, &host); if (s.rc != CMPI_RC_OK) goto out; inst = get_typed_instance(broker, - CLASSNAME(reference), + pfx_from_conn(conn), "VirtualSystemManagementService", NAMESPACE(reference)); + if (inst == NULL) { CU_DEBUG("Failed to get typed instance"); cu_statusf(broker, &s, @@ -1076,7 +1083,7 @@ CMPIStatus get_vsms(const CMPIObjectPath if (cu_get_str_prop(host, "Name", &val) != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, - "Unable to get name of System"); + "Unable to get name of HostSystem"); goto out; } @@ -1087,7 +1094,7 @@ CMPIStatus get_vsms(const CMPIObjectPath if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK) { cu_statusf(broker, &s, CMPI_RC_ERR_FAILED, - "Unable to get creation class of system"); + "Unable to get creation class of HostSystem"); goto out; } @@ -1097,8 +1104,10 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetStatus(&s, CMPI_RC_OK); + out: + virConnectClose(conn); *_inst = inst; - out: + return s; } @@ -1106,19 +1115,17 @@ static CMPIStatus return_vsms(const CMPI const CMPIResult *results, int name_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - CMPIStatus s; s = get_vsms(reference, &inst, _BROKER); - if (s.rc != CMPI_RC_OK) + if (s.rc != CMPI_RC_OK || inst == NULL) goto out; if (name_only) cu_return_instance_name(results, inst); else CMReturnInstance(results, inst); - - CMSetStatus(&s, CMPI_RC_OK); out: return s; } From heidieck at linux.vnet.ibm.com Tue Nov 27 09:53:32 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 10:53:32 +0100 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: <474AF158.6040006@linux.vnet.ibm.com> References: <474AF158.6040006@linux.vnet.ibm.com> Message-ID: <474BE91C.1080804@linux.vnet.ibm.com> Jay Gagnon wrote: > The move to connect_by_classname() work looks good, and in general I > like the cleanup of reg_prof_instance(), but I have one question about > it. You added a virConnectPtr to the argument list, and I'll grant the > function does need a connection it doesn't already have in there, I have reviewed the code before this change and all function do already have this connection pointer. They even have to have this connection, as this is now the provider entry point - first check is if the requested class is equal to the installed hypervisor. So this is a performance optimization, as it avoids establishing a second connection to libvirt, while there is already one that can be used. > by why > not pass in a CMPIObjectPath so that it used to make the connection? > That way all the callers don't have to bother creating their own > connections just to pass them in, and since reg_prof_instance is already > being given a CMPIBroker and creates its own CMPIStatus, giving it the > ref will give it everything it needs to make the appropriate connection > and do the same "if (conn == NULL) goto out;" that the calling functions > do right now. > > -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 10:08:13 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:08:13 +0100 Subject: [Libvirt-cim] [PATCH 3 of 3] Fix class prefix to depend on established hypervisor connection In-Reply-To: <87sl2tq92i.fsf@theine.beaverton.ibm.com> References: <883d767c64256f4d582f.1195812767@localhost.localdomain> <87sl2tq92i.fsf@theine.beaverton.ibm.com> Message-ID: <474BEC8D.4040804@linux.vnet.ibm.com> Dan Smith wrote: > HE> diff -r 50b0c2bad1e3 -r 883d767c6425 src/Virt_ElementConformsToProfile.c > HE> --- a/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:05:46 2007 +0100 > HE> +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 23 11:11:22 2007 +0100 > HE> @@ -50,7 +50,8 @@ static CMPIStatus elem_instances(const C > HE> static CMPIStatus elem_instances(const CMPIObjectPath *ref, > HE> struct std_assoc_info *info, > HE> struct inst_list *list, > HE> - struct reg_prof *profile) > HE> + struct reg_prof *profile, > HE> + virConnectPtr conn) > > Since we have a ref here, can we avoid passing a connection in and do > the connect_by_classname() inside? That does not make sense, as elem_instances() is an internal function only called by the external function prof_to_elem() and the connection was (and must be) already established by prof_to_elem(). So this would establish a second - unnecessary - connection to libvirt. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 09:08:33 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:08:33 +0200 Subject: [Libvirt-cim] [PATCH 0 of 3] Reworked - Fixes to RegisteredProfile and ECTP depending on connect_by_classname approach. Message-ID: From heidieck at linux.vnet.ibm.com Tue Nov 27 09:08:35 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:08:35 +0200 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: Message-ID: <690413b4aef454d03ce3.1196158115@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196157587 -3600 # Node ID 690413b4aef454d03ce31003feea55a65fa5347b # Parent c3f590ec1553352439cbc6a884817ac13dc8eb40 Adoption of changes to RegisteredProfile Signed-off-by: Heidi Eckhart diff -r c3f590ec1553 -r 690413b4aef4 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Tue Nov 27 10:43:39 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 10:59:47 2007 +0100 @@ -133,9 +133,14 @@ static CMPIStatus elem_to_prof(const CMP { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + virConnectPtr conn = NULL; char *classname; struct reg_prof *candidate; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { @@ -151,10 +156,12 @@ static CMPIStatus elem_to_prof(const CMP instance = reg_prof_instance(_BROKER, "/root/interop", - NULL, + NULL, + conn, candidate); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, "Can't create profile instance."); goto error; } @@ -165,6 +172,8 @@ static CMPIStatus elem_to_prof(const CMP error: free(classname); out: + virConnectClose(conn); + return s; } From heidieck at linux.vnet.ibm.com Tue Nov 27 09:08:36 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:08:36 +0200 Subject: [Libvirt-cim] [PATCH 3 of 3] Fix class prefix to depend on established hypervisor connection In-Reply-To: Message-ID: <103e8269951254840e9a.1196158116@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196157755 -3600 # Node ID 103e8269951254840e9a62239079d1916291dad9 # Parent 690413b4aef454d03ce31003feea55a65fa5347b Fix class prefix to depend on established hypervisor connection Signed-off-by: Heidi Eckhart diff -r 690413b4aef4 -r 103e82699512 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Tue Nov 27 10:59:47 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 11:02:35 2007 +0100 @@ -50,7 +50,8 @@ static CMPIStatus elem_instances(const C static CMPIStatus elem_instances(const CMPIObjectPath *ref, struct std_assoc_info *info, struct inst_list *list, - struct reg_prof *profile) + struct reg_prof *profile, + virConnectPtr conn) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; @@ -58,7 +59,8 @@ static CMPIStatus elem_instances(const C CMPIData data ; char *classname; - classname = get_typed_class("Xen", profile->provider_name); + classname = get_typed_class(pfx_from_conn(conn), + profile->provider_name); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -101,9 +103,14 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; + virConnectPtr conn = NULL; char *id; int i; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; + id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, @@ -114,7 +121,8 @@ static CMPIStatus prof_to_elem(const CMP for (i = 0; profiles[i] != NULL; i++) { if (STREQ(id, profiles[i]->reg_id)) { - s = elem_instances(ref, info, list, profiles[i]); + s = elem_instances(ref, info, list, + profiles[i], conn); if ((s.rc != CMPI_RC_OK)) goto error; break; @@ -124,6 +132,8 @@ static CMPIStatus prof_to_elem(const CMP error: free(id); out: + virConnectClose(conn); + return s; } @@ -182,10 +192,16 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *assoc_inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *assoc_inst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(source_op), &s); + if (conn == NULL) + return NULL; assoc_inst = get_typed_instance(_BROKER, - "Xen", + pfx_from_conn(conn), "ElementConformsToProfile", NAMESPACE(source_op)); @@ -199,6 +215,9 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&(target_op), CMPI_ref); } + virConnectClose(conn); + + out: return assoc_inst; } From heidieck at linux.vnet.ibm.com Tue Nov 27 09:08:34 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:08:34 +0200 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196156619 -3600 # Node ID c3f590ec1553352439cbc6a884817ac13dc8eb40 # Parent ce846c470102c9c126b027c68d58f5205cadfb10 Enumeration of RegisteredProfile class is returning wrong instances Signed-off-by: Heidi Eckhart diff -r ce846c470102 -r c3f590ec1553 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Tue Nov 27 10:34:13 2007 +0100 +++ b/src/Virt_RegisteredProfile.c Tue Nov 27 10:43:39 2007 +0100 @@ -43,25 +43,23 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *reg_prof_instance(const CMPIBroker *broker, const char *namespace, const char **properties, + virConnectPtr conn, struct reg_prof *profile) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIObjectPath *op; CMPIInstance *instance = NULL; - char *classname; - - classname = get_typed_class("Xen", "RegisteredProfile"); - if (classname == NULL) { + + instance = get_typed_instance(broker, + pfx_from_conn(conn), + "RegisteredProfile", + namespace); + + if (instance == NULL) { + CMSetStatusWithChars(broker, &s, + CMPI_RC_ERR_FAILED, + "Can't create HostSystem instance."); goto out; } - - op = CMNewObjectPath(broker, namespace, classname, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; - - instance = CMNewInstance(broker, op, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; if (properties) { s = CMSetPropertyFilter(instance, properties, NULL); @@ -83,8 +81,6 @@ CMPIInstance *reg_prof_instance(const CM (CMPIValue *)profile->reg_version, CMPI_chars); out: - free(classname); - return instance; } @@ -95,12 +91,18 @@ static CMPIStatus enum_profs(const CMPIO { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + virConnectPtr conn = NULL; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; for (i = 0; profiles[i] != NULL; i++) { instance = reg_prof_instance(_BROKER, NAMESPACE(ref), - properties, + properties, + conn, profiles[i]); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -115,6 +117,8 @@ static CMPIStatus enum_profs(const CMPIO } out: + virConnectClose(conn); + return s; } @@ -124,15 +128,20 @@ static CMPIStatus get_prof(const CMPIObj { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance = NULL; + virConnectPtr conn = NULL; char* id; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); - return s; + goto out; } for (i = 0; profiles[i] != NULL; i++) { @@ -140,6 +149,7 @@ static CMPIStatus get_prof(const CMPIObj instance = reg_prof_instance(_BROKER, NAMESPACE(ref), properties, + conn, profiles[i]); break; } @@ -150,8 +160,10 @@ static CMPIStatus get_prof(const CMPIObj else CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); - free(id); + + out: + virConnectClose(conn); return s; } diff -r ce846c470102 -r c3f590ec1553 src/Virt_RegisteredProfile.h --- a/src/Virt_RegisteredProfile.h Tue Nov 27 10:34:13 2007 +0100 +++ b/src/Virt_RegisteredProfile.h Tue Nov 27 10:43:39 2007 +0100 @@ -24,6 +24,7 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *reg_prof_instance(const CMPIBroker *broker, const char *namespace, const char **properties, + virConnectPtr conn, struct reg_prof *profile); #endif From heidieck at linux.vnet.ibm.com Tue Nov 27 10:08:16 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:08:16 +0100 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: <87wss5q9ak.fsf@theine.beaverton.ibm.com> References: <50b0c2bad1e31abff47a.1195812766@localhost.localdomain> <87wss5q9ak.fsf@theine.beaverton.ibm.com> Message-ID: <474BEC90.4000106@linux.vnet.ibm.com> Dan Smith wrote: > But I don't see you close it anywhere before you exit the function, so > I think this leaks the connection. thanks ... fixed -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 09:13:20 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:13:20 +0200 Subject: [Libvirt-cim] [PATCH] Fix class prefix to depend on established hypervisor connection Message-ID: <0e9ce5fd90ec7ab755c0.1196158400@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196158370 -3600 # Node ID 0e9ce5fd90ec7ab755c017cd5002e8115d7225b7 # Parent 690413b4aef454d03ce31003feea55a65fa5347b Fix class prefix to depend on established hypervisor connection Signed-off-by: Heidi Eckhart diff -r 690413b4aef4 -r 0e9ce5fd90ec src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Tue Nov 27 10:59:47 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 11:12:50 2007 +0100 @@ -50,7 +50,8 @@ static CMPIStatus elem_instances(const C static CMPIStatus elem_instances(const CMPIObjectPath *ref, struct std_assoc_info *info, struct inst_list *list, - struct reg_prof *profile) + struct reg_prof *profile, + virConnectPtr conn) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; @@ -58,7 +59,8 @@ static CMPIStatus elem_instances(const C CMPIData data ; char *classname; - classname = get_typed_class("Xen", profile->provider_name); + classname = get_typed_class(pfx_from_conn(conn), + profile->provider_name); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -101,9 +103,14 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; + virConnectPtr conn = NULL; char *id; int i; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; + id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, @@ -114,7 +121,8 @@ static CMPIStatus prof_to_elem(const CMP for (i = 0; profiles[i] != NULL; i++) { if (STREQ(id, profiles[i]->reg_id)) { - s = elem_instances(ref, info, list, profiles[i]); + s = elem_instances(ref, info, list, + profiles[i], conn); if ((s.rc != CMPI_RC_OK)) goto error; break; @@ -124,6 +132,8 @@ static CMPIStatus prof_to_elem(const CMP error: free(id); out: + virConnectClose(conn); + return s; } @@ -182,10 +192,16 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *assoc_inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *assoc_inst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(source_op), &s); + if (conn == NULL) + return NULL; assoc_inst = get_typed_instance(_BROKER, - "Xen", + pfx_from_conn(conn), "ElementConformsToProfile", NAMESPACE(source_op)); @@ -198,6 +214,8 @@ static CMPIInstance *make_ref(const CMPI CMSetProperty(assoc_inst, assoc->target_prop, (CMPIValue *)&(target_op), CMPI_ref); } + + virConnectClose(conn); return assoc_inst; } From heidieck at linux.vnet.ibm.com Tue Nov 27 10:14:56 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:14:56 +0100 Subject: [Libvirt-cim] [PATCH 3 of 3] Fix class prefix to depend on established hypervisor connection In-Reply-To: <103e8269951254840e9a.1196158116@localhost.localdomain> References: <103e8269951254840e9a.1196158116@localhost.localdomain> Message-ID: <474BEE20.7080506@linux.vnet.ibm.com> please ignore this one ... compile break because of warning: Virt_ElementConformsToProfile.c: In function 'make_ref': Virt_ElementConformsToProfile.c:220: warning: label 'out' defined but not used -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 10:27:21 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:27:21 +0100 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references In-Reply-To: <87oddhq8al.fsf@theine.beaverton.ibm.com> References: <87oddhq8al.fsf@theine.beaverton.ibm.com> Message-ID: <474BF109.1050103@linux.vnet.ibm.com> Dan Smith wrote: > HE> return NULL; > HE> } > HE> @@ -144,9 +165,6 @@ static CMPIStatus do_assoc(struct std_as > HE> handler = std_assoc_get_handler(ctx, ref); > HE> if (handler == NULL) { > HE> CU_DEBUG("No handler found."); > HE> - cu_statusf(ctx->brkr, &s, > HE> - CMPI_RC_ERR_FAILED, > HE> - "Unable to handle this association"); > HE> goto out; > HE> } > > HE> @@ -243,9 +261,7 @@ static CMPIStatus do_ref(struct std_asso > > HE> handler = std_assoc_get_handler(ctx, ref); > HE> if (handler == NULL) { > HE> - cu_statusf(ctx->brkr, &s, > HE> - CMPI_RC_ERR_FAILED, > HE> - "Unable to handle this association"); > HE> + CU_DEBUG("No handler found."); > HE> goto out; > HE> } > > Why should we not return error in these cases now? Currently, these > signal the case of someone trying to do something like: > > wbemcli ain -ac Xen_SystemDevice http://...:Xen_MemoryPool > > (i.e. resolving a particular association with an invalid reference) Because this is only a request the provider is not responsible for, but not an error case. There exists the possibility that another provider is called by the same request and this on is responsible for this request, returning valid instances that are revoked, because our provider only wants to tell "I'm not responsible for this request". The behavior of an association provider in the case he figures out that he is not responsible for a certain request is to be "silent". On the other hand - avoiding such invalid requests is the responsibility of the client. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 09:30:43 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:30:43 +0200 Subject: [Libvirt-cim] [PATCH] [RFC] ECTP: Adoption of changes to std_association logic Message-ID: <6200efdd04aafa69f2f7.1196159443@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196158379 -3600 # Node ID 6200efdd04aafa69f2f76b1cbc0c3567406e829f # Parent 0e9ce5fd90ec7ab755c017cd5002e8115d7225b7 [RFC] ECTP: Adoption of changes to std_association logic Signed-off-by: Heidi Eckhart diff -r 0e9ce5fd90ec -r 6200efdd04aa src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Tue Nov 27 11:12:50 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 11:12:59 2007 +0100 @@ -220,27 +220,47 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } +char* conformant_standard[] = { + "Xen_RegisteredProfile", + "KVM_RegisteredProfile", + NULL +}; + +char* managed_element[] = { + "Xen_HostSystem", + "Xen_ComputerSystem", + "KVM_HostSystem", + "KVM_ComputerSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementConformsToProfile", + "KVM_ElementConformsToProfile", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", + .source_class = (char**)&conformant_standard, .source_prop = "ConformantStandard", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = prof_to_elem, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_ManagedElement", + .source_class = (char**)&managed_element, .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = (char**)&conformant_standard, .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = elem_to_prof, .make_ref = make_ref @@ -251,7 +271,6 @@ struct std_assoc *assoc_handlers[] = { &backward, NULL }; - STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* From heidieck at linux.vnet.ibm.com Tue Nov 27 09:47:00 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 11:47:00 +0200 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references Message-ID: <16ac621eb3b34d11caca.1196160420@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196160333 -3600 # Node ID 16ac621eb3b34d11caca00100901d27bede7a7c7 # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f [RFC] Enhance handling of association's references The source and target classnames of std_assoc are now lists, containing all supported classnames. This approach frees the provider from listing all possible combinations as instances of std_assoc. Signed-off-by: Heidi Eckhart diff -r bf54de6af2e2 -r 16ac621eb3b3 std_association.c --- a/std_association.c Tue Nov 20 16:24:27 2007 -0800 +++ b/std_association.c Tue Nov 27 11:45:33 2007 +0100 @@ -61,18 +61,44 @@ static bool match_class(const CMPIBroker static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, - const char *comp_class) + char **comp_class_list) { CMPIObjectPath *rop; + char *comp_class; + int i; rop = CMNewObjectPath(broker, ns, test_class, NULL); - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) - return true; - else - return false; + for (i = 0; comp_class_list[i]; i++) { + comp_class = comp_class_list[i]; + + if ((test_class == NULL) || + (comp_class == NULL) || + match_op(broker, rop, comp_class)) + return true; + } + + return false; +} + +static bool match_source_class(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc *ptr) +{ + int i; + char *source_class; + + for (i = 0; ptr->source_class[i]; i++) { + source_class = ptr->source_class[i]; + + if (CMClassPathIsA(broker, + ref, + source_class, + NULL)) + return true; + } + + return false; } static CMPIStatus filter_results(struct inst_list *list, @@ -113,13 +139,13 @@ std_assoc_get_handler(const struct std_a std_assoc_get_handler(const struct std_assoc_ctx *ctx, const CMPIObjectPath *ref) { - struct std_assoc *ptr; + struct std_assoc *ptr = NULL; int i; for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) + if (match_source_class(ctx->brkr, ref, ptr)) return ptr; } @@ -144,9 +170,6 @@ static CMPIStatus do_assoc(struct std_as handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { CU_DEBUG("No handler found."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); goto out; } @@ -243,9 +266,7 @@ static CMPIStatus do_ref(struct std_asso handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); + CU_DEBUG("No handler found."); goto out; } diff -r bf54de6af2e2 -r 16ac621eb3b3 std_association.h --- a/std_association.h Tue Nov 20 16:24:27 2007 -0800 +++ b/std_association.h Tue Nov 27 11:45:33 2007 +0100 @@ -37,13 +37,13 @@ typedef CMPIInstance *(*make_ref_t)(cons struct std_assoc *); struct std_assoc { - char *source_class; + char **source_class; char *source_prop; - char *target_class; + char **target_class; char *target_prop; - char *assoc_class; + char **assoc_class; assoc_handler_t handler; make_ref_t make_ref; From heidieck at linux.vnet.ibm.com Tue Nov 27 10:04:25 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 12:04:25 +0200 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196161060 -3600 # Node ID a9d4ef4c783c788db2b8ebd9da71255e492a0950 # Parent 16ac621eb3b34d11caca00100901d27bede7a7c7 Enhance handling of input parameter of std_association logic Signed-off-by: Heidi Eckhart diff -r 16ac621eb3b3 -r a9d4ef4c783c std_association.c --- a/std_association.c Tue Nov 27 11:45:33 2007 +0100 +++ b/std_association.c Tue Nov 27 11:57:40 2007 +0100 @@ -67,14 +67,20 @@ static bool match_class(const CMPIBroker char *comp_class; int i; + if (test_class == NULL) + return true; + + if (comp_class_list == NULL) + return true; + rop = CMNewObjectPath(broker, ns, test_class, NULL); + if (CMIsNullObject(rop)) + return false; for (i = 0; comp_class_list[i]; i++) { comp_class = comp_class_list[i]; - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) + if (!CMClassPathIsA(broker, rop, comp_class, NULL)) return true; } @@ -137,18 +143,82 @@ out: static struct std_assoc * std_assoc_get_handler(const struct std_assoc_ctx *ctx, + struct std_assoc_info *info, const CMPIObjectPath *ref) { struct std_assoc *ptr = NULL; int i; + bool rc; + + CU_DEBUG("Calling Provider: '%s'", + info->provider_name); for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; if (match_source_class(ctx->brkr, ref, ptr)) - return ptr; - } - + break; + } + + if (ptr) { + if (info->assoc_class) { + CU_DEBUG("Check client's assocClass: '%s'", + info->assoc_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->assoc_class, + ptr->assoc_class); + + if (!rc) { + CU_DEBUG("AssocClass not valid."); + goto out; + } + CU_DEBUG("AssocClass valid."); + } + + if (info->result_class) { + CU_DEBUG("Check client's resultClass: '%s'", + info->result_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->result_class, + ptr->target_class); + + if (!rc) { + CU_DEBUG("ResultClass not valid."); + goto out; + } + CU_DEBUG("ResultClass valid."); + } + + if (info->role) { + CU_DEBUG("Check client's role: '%s'", + info->role); + + if (!STREQC(info->role, ptr->source_prop)) { + CU_DEBUG("Role not valid."); + goto out; + } + CU_DEBUG("Role valid."); + } + + if (info->result_role) { + CU_DEBUG("Check client's resultRole: '%s'", + info->result_role); + + if (!STREQC(info->result_role, ptr->target_prop)) { + CU_DEBUG("ResultRole not valid."); + goto out; + } + CU_DEBUG("ResultRole valid."); + } + + return ptr; + } + + out: return NULL; } @@ -158,57 +228,21 @@ static CMPIStatus do_assoc(struct std_as const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; struct std_assoc *handler; - bool rc; inst_list_init(&list); CU_DEBUG("Getting handler..."); - - handler = std_assoc_get_handler(ctx, ref); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", - handler->source_class, - handler->target_class, - handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", - info->result_class); - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->target_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - CU_DEBUG("Match_class succeeded."); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", - info->assoc_class); - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->assoc_class, - handler->assoc_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Association class given is not valid for" - "this association"); - goto out; - } - CU_DEBUG("Match_class succeeded, calling handler->handler..."); - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { @@ -256,32 +290,22 @@ static CMPIStatus do_ref(struct std_asso const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; - int i; struct std_assoc *handler; - bool rc; + int i; inst_list_init(&list); - handler = std_assoc_get_handler(ctx, ref); + CU_DEBUG("Getting handler..."); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->assoc_class); - if (!rc) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) goto out; From heidieck at linux.vnet.ibm.com Tue Nov 27 11:24:41 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 12:24:41 +0100 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic In-Reply-To: <07ab148e7311656c997b.1195821423@localhost.localdomain> References: <07ab148e7311656c997b.1195821423@localhost.localdomain> Message-ID: <474BFE79.9070608@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1195821409 -3600 > # Node ID 07ab148e7311656c997bcc8f5ad6249fdc7b42bc > # Parent db20c6206fb6decb484035bec81d7c7f2be75eae > Enhance handling of input parameter of std_association logic > Signed-off-by: Heidi Eckhart Reworked patch due to changes to "[RFC] Enhance handling of association's references". -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 11:52:17 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 12:52:17 +0100 Subject: [Libvirt-cim] [PATCH] [CU][RFC] Correct a few API issues In-Reply-To: <96b651213e50f0258698.1196124878@theine> References: <96b651213e50f0258698.1196124878@theine> Message-ID: <474C04F1.6030308@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1196124861 28800 > # Node ID 96b651213e50f02586988064a014bbe746dc9c59 > # Parent 05f120725e3dc562dc8fa251da698faa474f0b55 > [CU][RFC] Correct a few API issues > that I think need to be resolved before we snap a release. > > Some of the cu_get_* functions returned values instead of a CMPIrc's > like everything else, so this changes that. A great change that makes the functions very consistent now :). > Also, return const char *'s > from the broker memory so that the callers don't need to free the result. > Also a great change. This will really take away a lot of free's from the providers. > This will require some work in libvirt-cim to make sure the new API is > adhered to properly. If this is okay with people, I'll follow up with a > patch to libvirt-cim to make those changes. Any other discussion about > things that should change in the libcmpiutil API is welcomed. > > Signed-off-by: Dan Smith > > diff -r 05f120725e3d -r 96b651213e50 args_util.c > --- a/args_util.c Mon Nov 26 16:51:12 2007 -0800 > +++ b/args_util.c Mon Nov 26 16:54:21 2007 -0800 > @@ -32,28 +32,32 @@ > > #define CU_WEAK_TYPES 1 > > -char *cu_get_str_path(const CMPIObjectPath *reference, const char *key) > +CMPIrc cu_get_str_path(const CMPIObjectPath *ref, > + const char *key, > + const char **val) > { > The patch is rejected at the function above. All others applied fine. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 12:46:37 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 13:46:37 +0100 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references In-Reply-To: <87oddhq8al.fsf@theine.beaverton.ibm.com> References: <87oddhq8al.fsf@theine.beaverton.ibm.com> Message-ID: <474C11AD.10504@linux.vnet.ibm.com> Dan Smith wrote: > HE> # HG changeset patch > HE> # User Heidi Eckhart > HE> # Date 1195819371 -3600 > HE> # Node ID db20c6206fb6decb484035bec81d7c7f2be75eae > HE> # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f > HE> [RFC] Enhance handling of association's references > > HE> The source and target classnames of std_assoc are now lists, > HE> containing all supported classnames. This approach frees the > HE> provider from listing all possible combinations as instances of > HE> std_assoc. > > I'm tentatively okay with this approach. We need to make a decision > and go with it so that we can freeze (at least to some extent) the > libcmpiutil API and make an official code release. If this approach is ok for all, then I can cook up a patch for each association. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Tue Nov 27 11:48:00 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Tue, 27 Nov 2007 13:48:00 +0200 Subject: [Libvirt-cim] [PATCH] [RFC] Check for matching hypervisor prefixes Message-ID: <901bcb9e9fb3272956e5.1196167680@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196167642 -3600 # Node ID 901bcb9e9fb3272956e55b01d2b1eb05f7e35a9c # Parent 6200efdd04aafa69f2f76b1cbc0c3567406e829f [RFC] Check for matching hypervisor prefixes The class prefixes need to be checked for compliance, as a request for KVM_RegisteredProfile with Xen_ECTP as assoc does not return any instances. Signed-off-by: Heidi Eckhart diff -r 6200efdd04aa -r 901bcb9e9fb3 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Tue Nov 27 11:12:59 2007 +0100 +++ b/libxkutil/misc_util.c Tue Nov 27 13:47:22 2007 +0100 @@ -33,6 +33,7 @@ #include "cmpimacs.h" #include "libcmpiutil.h" +#include "std_association.h" #include "misc_util.h" #include "cs_util.h" @@ -304,6 +305,43 @@ bool provider_is_responsible(const CMPIB free(pfx); return rc; } + +bool assoc_match_prefix(const CMPIObjectPath *reference, + struct std_assoc_info *info) +{ + char *ref_pfx = NULL; + char *pfx = NULL; + bool rc = true; + + ref_pfx = class_prefix_name(CLASSNAME(reference)); + + if (info->assoc_class) { + pfx = class_prefix_name(info->assoc_class); + + if (!STREQC(ref_pfx, pfx)) { + if (!STREQC("CIM", pfx)) + rc = false; + } + + free(pfx); + } + + if (info->result_class) { + pfx = class_prefix_name(info->result_class); + + if (!STREQC(ref_pfx, pfx)) { + if (!STREQC("CIM", pfx)) + rc = false; + } + + free(pfx); + } + + free(ref_pfx); + return rc; +} + + bool domain_online(virDomainPtr dom) { diff -r 6200efdd04aa -r 901bcb9e9fb3 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Tue Nov 27 11:12:59 2007 +0100 +++ b/libxkutil/misc_util.h Tue Nov 27 13:47:22 2007 +0100 @@ -32,6 +32,7 @@ #include "cmpimacs.h" #include +#include /* Check if the provider is reponsible for the given class: * e.g. Xen is running on the system and KVM_... is asked for, @@ -105,6 +106,9 @@ bool libvirt_cim_init(void); #endif +bool assoc_match_prefix(const CMPIObjectPath *reference, + struct std_assoc_info *info); + /* * Local Variables: * mode: C diff -r 6200efdd04aa -r 901bcb9e9fb3 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Tue Nov 27 11:12:59 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 13:47:22 2007 +0100 @@ -107,6 +107,9 @@ static CMPIStatus prof_to_elem(const CMP char *id; int i; + if (!assoc_match_prefix(ref, info)) + goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) return s; @@ -147,6 +150,9 @@ static CMPIStatus elem_to_prof(const CMP char *classname; struct reg_prof *candidate; int i; + + if (!assoc_match_prefix(ref, info)) + goto out; conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) From danms at us.ibm.com Tue Nov 27 13:34:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 06:34:34 -0700 Subject: [Libvirt-cim] [PATCH] More rpm spec changes Message-ID: <64e4f6355b52e4b7bcc9.1196174074@theine> # HG changeset patch # User Dan Smith # Date 1196174025 28800 # Node ID 64e4f6355b52e4b7bcc984ec557610a1fa9a9786 # Parent 183df45f2bb6debe6dd9fc4aec82ad8673741107 More rpm spec changes - Make 'rpm' target change permissions on the spec file before building - Disable static library builds - Make install use "install -p" to preserve file timestamps - Include COPYING file in the base package Signed-off-by: Dan Smith diff -r 183df45f2bb6 -r 64e4f6355b52 Makefile.am --- a/Makefile.am Wed Nov 21 07:01:01 2007 -0800 +++ b/Makefile.am Tue Nov 27 06:33:45 2007 -0800 @@ -48,5 +48,5 @@ clean-local: rm -f $(BUILT_SOURCES) *~ rpm: clean - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) + @(unset CDPATH ; chmod 0644 libcmpiutil.spec ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) diff -r 183df45f2bb6 -r 64e4f6355b52 libcmpiutil.spec.in --- a/libcmpiutil.spec.in Wed Nov 21 07:01:01 2007 -0800 +++ b/libcmpiutil.spec.in Tue Nov 27 06:33:45 2007 -0800 @@ -5,7 +5,7 @@ Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@ Release: 1%{?dist}%{?extra_release} License: LGPLv2+ -Group: Development/Libraries +Group: System Environment/Libraries Source: libcmpiutil-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/CIM/ @@ -40,13 +40,13 @@ chmod -x *.c *.y *.h *.l chmod -x *.c *.y *.h *.l %build -%configure +%configure --enable-static=no make %{?_smp_mflags} %install rm -fr $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install +make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a @@ -58,13 +58,13 @@ rm -fr $RPM_BUILD_ROOT %postun -p /sbin/ldconfig %files -%defattr(-, root, root) +%defattr(-, root, root, -) -%doc doc/doxygen.conf doc/mainpage README +%doc doc/doxygen.conf doc/mainpage README COPYING %{_libdir}/lib*.so.* %files devel -%defattr(-, root, root) +%defattr(-, root, root, -) %{_libdir}/lib*.so %dir %{_includedir}/libcmpiutil From danms at us.ibm.com Tue Nov 27 14:35:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 06:35:28 -0800 Subject: [Libvirt-cim] [PATCH] More rpm spec changes In-Reply-To: <20071127083857.GB10190@redhat.com> (Daniel Veillard's message of "Tue, 27 Nov 2007 03:38:57 -0500") References: <05f120725e3dc562dc8f.1196124870@theine> <20071127083857.GB10190@redhat.com> Message-ID: <87oddfpxhr.fsf@theine.beaverton.ibm.com> DV> well the problem of CDPATH is that 'make dist' tends to break DV> if you have a CDPATH (since 'cd' echo the selected directory), DV> so that change doesn't work. Just add the chmods in the @() Okay, replacement patch on the way. DV> GNU autoconf tends to populate COPYING with the GPL licence, DV> we just need to make sure this doesn't happen in practice ... It seems to do the correct thing. The 'dist' tarball has LGPL in COPYING. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Tue Nov 27 14:40:59 2007 From: veillard at redhat.com (Daniel Veillard) Date: Tue, 27 Nov 2007 09:40:59 -0500 Subject: [Libvirt-cim] [PATCH] More rpm spec changes In-Reply-To: <64e4f6355b52e4b7bcc9.1196174074@theine> References: <64e4f6355b52e4b7bcc9.1196174074@theine> Message-ID: <20071127144059.GB8002@redhat.com> On Tue, Nov 27, 2007 at 06:34:34AM -0700, Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1196174025 28800 > # Node ID 64e4f6355b52e4b7bcc984ec557610a1fa9a9786 > # Parent 183df45f2bb6debe6dd9fc4aec82ad8673741107 > More rpm spec changes > > - Make 'rpm' target change permissions on the spec file before building > - Disable static library builds > - Make install use "install -p" to preserve file timestamps > - Include COPYING file in the base package > > Signed-off-by: Dan Smith Looks fine to me ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Tue Nov 27 14:45:46 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 06:45:46 -0800 Subject: [Libvirt-cim] [PATCH] Add installation instructions for root/interop namespace In-Reply-To: (Heidi Eckhart's message of "Tue, 27 Nov 2007 10:07:26 +0200") References: Message-ID: <87k5o3px0l.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1196154214 -3600 HE> # Node ID ea06dd0a020c087d1373551722b89a1da372453d HE> # Parent 31093e14df128c2b0c01480fd5c001ee127d1e0b HE> Add installation instructions for root/interop namespace Applied, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 15:09:35 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 07:09:35 -0800 Subject: [Libvirt-cim] [PATCH] Enumeration on HostSystem class is returning dups In-Reply-To: <533f6c0e7e4dd1b3264e.1196155454@localhost.localdomain> (Heidi Eckhart's message of "Tue, 27 Nov 2007 10:24:14 +0200") References: <533f6c0e7e4dd1b3264e.1196155454@localhost.localdomain> Message-ID: <87d4tvpvww.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1196155366 -3600 HE> # Node ID 533f6c0e7e4dd1b3264e136211d6f84062d9f79d HE> # Parent 278c59f67cb1fe0520e8dfa7b118cd907e8f10a1 HE> Enumeration on HostSystem class is returning dups Applied, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 15:11:57 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 07:11:57 -0800 Subject: [Libvirt-cim] [PATCH] Enumeration on VirtualSystemManagementService class is returning dups In-Reply-To: (Heidi Eckhart's message of "Tue, 27 Nov 2007 10:36:06 +0200") References: Message-ID: <878x4jpvsy.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1196156053 -3600 HE> # Node ID ce846c470102c9c126b027c68d58f5205cadfb10 HE> # Parent a73fce7861b2fef889762fc2c4d8f70e7ea499a1 HE> Enumeration on VirtualSystemManagementService class is returning dups Applied, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 15:18:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 07:18:25 -0800 Subject: [Libvirt-cim] [PATCH 3 of 3] Fix class prefix to depend on established hypervisor connection In-Reply-To: <474BEC8D.4040804@linux.vnet.ibm.com> (Heidi Eckhart's message of "Tue, 27 Nov 2007 11:08:13 +0100") References: <883d767c64256f4d582f.1195812767@localhost.localdomain> <87sl2tq92i.fsf@theine.beaverton.ibm.com> <474BEC8D.4040804@linux.vnet.ibm.com> Message-ID: <874pf7pvi6.fsf@theine.beaverton.ibm.com> HE> So this would establish a second - unnecessary - connection to HE> libvirt. Okay, good call. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 15:36:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 07:36:09 -0800 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic In-Reply-To: (Heidi Eckhart's message of "Tue, 27 Nov 2007 12:04:25 +0200") References: Message-ID: <87zlwzog46.fsf@theine.beaverton.ibm.com> HE> std_assoc_get_handler(const struct std_assoc_ctx *ctx, HE> + struct std_assoc_info *info, HE> const CMPIObjectPath *ref) HE> { HE> struct std_assoc *ptr = NULL; HE> int i; HE> + bool rc; HE> + HE> + CU_DEBUG("Calling Provider: '%s'", HE> + info->provider_name); HE> for (i = 0; ctx->handlers[i]; i++) { HE> ptr = ctx->handlers[i]; HE> if (match_source_class(ctx->brkr, ref, ptr)) HE> - return ptr; HE> - } HE> - HE> + break; HE> + } HE> + HE> + if (ptr) { This starts a large block of indented code that doesn't need to be. Can we replace this with: if (ptr == NULL) goto out; so that the rest of the body can just continue? Otherwise, this seems fine, but I think it would be a good idea to get a sign-off from Kaitlin as she is familiar with this stuff too. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 15:38:23 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 07:38:23 -0800 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references In-Reply-To: <16ac621eb3b34d11caca.1196160420@localhost.localdomain> (Heidi Eckhart's message of "Tue, 27 Nov 2007 11:47:00 +0200") References: <16ac621eb3b34d11caca.1196160420@localhost.localdomain> Message-ID: <87ve7nog0g.fsf@theine.beaverton.ibm.com> HE> # HG changeset patch HE> # User Heidi Eckhart HE> # Date 1196160333 -3600 HE> # Node ID 16ac621eb3b34d11caca00100901d27bede7a7c7 HE> # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f HE> [RFC] Enhance handling of association's references Thanks for making those changes. I think this is okay now. I'd like to hold off committing it until we have a patch set against libvirt-cim to use the new API. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 15:44:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 07:44:58 -0800 Subject: [Libvirt-cim] [PATCH] [RFC] Check for matching hypervisor prefixes In-Reply-To: <901bcb9e9fb3272956e5.1196167680@localhost.localdomain> (Heidi Eckhart's message of "Tue, 27 Nov 2007 13:48:00 +0200") References: <901bcb9e9fb3272956e5.1196167680@localhost.localdomain> Message-ID: <87oddfofph.fsf@theine.beaverton.ibm.com> HE> + if (info->assoc_class) { HE> + pfx = class_prefix_name(info->assoc_class); HE> + HE> + if (!STREQC(ref_pfx, pfx)) { HE> + if (!STREQC("CIM", pfx)) I would rather this be: if (!STREQC(ref_pfx, pfx) && !STREQC("CIM", pfx)) rc = false; It cuts down on the nesting and makes the true condition clearer, I think. Also, could we name this function a little better to avoid confusion with the ASSOC_MATCH macro? ASSOC_MATCH should probably be named ASSOC_MATCH_PN, but it would be easier to make the name of this new function more explicit. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Nov 27 15:54:06 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 07:54:06 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: References: Message-ID: <474C3D9E.1050305@linux.vnet.ibm.com> Heidi Eckhart wrote: > + > + instance = get_typed_instance(broker, > + pfx_from_conn(conn), > + "RegisteredProfile", > + namespace); > + > + if (instance == NULL) { > + CMSetStatusWithChars(broker, &s, > + CMPI_RC_ERR_FAILED, > + "Can't create HostSystem instance."); > goto out; > I think the return message is incorrect here. You're creating attempting to create a RegisteredProfile instance, not a HostSystem instance. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Tue Nov 27 16:13:32 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 11:13:32 -0500 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: <474BE91C.1080804@linux.vnet.ibm.com> References: <474AF158.6040006@linux.vnet.ibm.com> <474BE91C.1080804@linux.vnet.ibm.com> Message-ID: <474C422C.7050102@linux.vnet.ibm.com> Heidi Eckhart wrote: > Jay Gagnon wrote: >> The move to connect_by_classname() work looks good, and in general I >> like the cleanup of reg_prof_instance(), but I have one question about >> it. You added a virConnectPtr to the argument list, and I'll grant the >> function does need a connection it doesn't already have in there, > I have reviewed the code before this change and all function do > already have this connection pointer. They even have to have this > connection, as this is now the provider entry point - first check is > if the requested class is equal to the installed hypervisor. So this > is a performance optimization, as it avoids establishing a second > connection to libvirt, while there is already one that can be used. Okay, good point. There are a couple of callers -- as shown by this patch :) -- that don't actually have a connection already, but they are the vast minority, and the extra connection is something we should avoid. -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 27 16:24:04 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 11:24:04 -0500 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: <690413b4aef454d03ce3.1196158115@localhost.localdomain> References: <690413b4aef454d03ce3.1196158115@localhost.localdomain> Message-ID: <474C44A4.3010207@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1196157587 -3600 > # Node ID 690413b4aef454d03ce31003feea55a65fa5347b > # Parent c3f590ec1553352439cbc6a884817ac13dc8eb40 > Adoption of changes to RegisteredProfile > Signed-off-by: Heidi Eckhart > > if (instance == NULL) { > - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, > + CMSetStatusWithChars(_BROKER, &s, > + CMPI_RC_ERR_FAILED, > "Can't create profile instance."); > Not sure why this hadn't occurred to me earlier, and I don't know if this has been brought up already, but now that we have cu_statusf, should we use that instead of CMSetStatusWithChars even in places where we don't need any fancy formatting? It helps to maintain consistency, and (although this is a bit of a minor point), it is a substantially shorter function name. I believe the calls are the exact same when you don't have any formatting to do. > goto error; > } > @@ -165,6 +172,8 @@ static CMPIStatus elem_to_prof(const CMP > error: > free(classname); > out: > + virConnectClose(conn); > + > return s; > } > Paying more attention to how we free things now that we know virConnectClose is fine when given a NULL, wouldn't the same hold for classname? As long as it is initialized to NULL when it is declared, it can always be freed at the end like conn. I realize that classname was already like that before your patch (I think I wrote it that way actually), but while your fixing this function up it seems like a nice housekeeping thing. Optionally, we can go with "not relevant to the patch" and I'll try and clean up this type of thing wherever I can find it as a separate patch. -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 27 16:28:32 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 11:28:32 -0500 Subject: [Libvirt-cim] [PATCH] [RFC] Enhance handling of association's references In-Reply-To: <474C11AD.10504@linux.vnet.ibm.com> References: <87oddhq8al.fsf@theine.beaverton.ibm.com> <474C11AD.10504@linux.vnet.ibm.com> Message-ID: <474C45B0.4060205@linux.vnet.ibm.com> Heidi Eckhart wrote: > Dan Smith wrote: >> HE> # HG changeset patch >> HE> # User Heidi Eckhart >> HE> # Date 1195819371 -3600 >> HE> # Node ID db20c6206fb6decb484035bec81d7c7f2be75eae >> HE> # Parent bf54de6af2e210bef57d74cf12e4872f6ba2da4f >> HE> [RFC] Enhance handling of association's references >> >> HE> The source and target classnames of std_assoc are now lists, >> HE> containing all supported classnames. This approach frees the >> HE> provider from listing all possible combinations as instances of >> HE> std_assoc. >> >> I'm tentatively okay with this approach. We need to make a decision >> and go with it so that we can freeze (at least to some extent) the >> libcmpiutil API and make an official code release. > If this approach is ok for all, then I can cook up a patch for each > association. > I'm also on the tentatively okay side. It looks sound, and should work, but I always get a little tentative when we deal with the "who handles what" type questions, as I'm a bit over my head on those most of the time. I'd say that if nobody sees anything that looks outright wrong we should go with it, as you seem to have a better understanding of how that sort of thing should go than we do. -- -Jay From danms at us.ibm.com Tue Nov 27 16:41:01 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 08:41:01 -0800 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: <474C44A4.3010207@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 27 Nov 2007 11:24:04 -0500") References: <690413b4aef454d03ce3.1196158115@localhost.localdomain> <474C44A4.3010207@linux.vnet.ibm.com> Message-ID: <87fxyrod42.fsf@theine.beaverton.ibm.com> JG> now that we have cu_statusf, should we use that instead of JG> CMSetStatusWithChars even in places where we don't need any fancy JG> formatting? Yes please! JG> It helps to maintain consistency, and (although this is a bit of a JG> minor point), it is a substantially shorter function name. It's not a minor point to me :) JG> Paying more attention to how we free things now that we know JG> virConnectClose is fine when given a NULL, wouldn't the same hold JG> for classname? Yes. Most of the stuff I write free()'s all the dynamic strings on exit (error or not) to make sure we don't skip one due to a broken exit sequence. JG> Optionally, we can go with "not relevant to the patch" and I'll JG> try and clean up this type of thing wherever I can find it as a JG> separate patch. Sounds good to me. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 27 17:07:33 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 12:07:33 -0500 Subject: [Libvirt-cim] Best practices for patchsets Message-ID: <474C4ED5.2090105@linux.vnet.ibm.com> Lately we've been having more groups of patches than single patches, which I believe to be a good thing because it also means we've been getting less 500 line patches entitled "Fix everything." :) However, it's also increasing our opportunity for confusion, as we have more opportunity for patchset fragmentation. I have a couple of suggestions for how we should handle patchsets, along with a few things that have been floating around my head for a while about patches in general, so I'm laying them out here. I'd like to know what everybody thinks, and eventually get the final version somewhere on the website as well. Patches in general: 1. When you add a patch to the queue you have an idea of where you're going with it, and the commit message should reflect that. Be specific. We have a tendency to say something like "Various fixes to AllocationCapabilities" (I'm a huge offender here), when we really should be saying what was actually fixed, like "add EnumInstances support" or "eliminate duplicate instances." 2. Stay on task with a patch. If you notice other problems while you are working on patch, and they are not most definitely specific to your patch, they should be another patch. 3. This will sound a lot like "Stay on task," but resist the temptation to nitpick with a patch. I have a peculiar desire to have all declares at the beginning of the function, sorted according to length in ascending order. We all have our own idea on how best to name a variable or format a function call. Often, the change is in fact worthwhile, and is welcome, but lots of little changes that don't directly relate to a fix can really make that patch hard to read. They should be another patch. 4. Before you type, "hg email," you should always type, "hg export," first. Review your patch. Does it have any typos in the comments? Did you accidentally include an irrelevant change? Is your commit message still accurate and useful? Patchsets: 1. When you send a group of patches, Mercurial's email extension will create a "header" email. Make the subject and body of that email meaningful, so we know how the patches relate. It's easy to say, "Each patch has a commit message, it's obvious how they work together," but the rest of the list usually won't agree with that. If the commit messages for each patch are good, you shouldn't need more than a sentence or two to tie them all together, but you do need it. 2. If any of your patches are rejected and you rework them, resend the entire set. This prevents things like, "So use patch 1 of 4 from the set I sent yesterday, 2 and 3 of 4 from the patch I sent an hour later, and patch 4 of 4 from today." 3. If you resend a patchset, and the "Patch [0 of 3]" subject line was, "AllocationCapabilities fix," then the new subject line should be, "AllocationCapabilities fix, version 2." This will make it easier for email clients to thread things correctly, and for human readers to know they are looking at the most current revision of your set. I think that's everything for now. Additions, comments, suggestions are welcome. -- -Jay From danms at us.ibm.com Tue Nov 27 18:17:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 10:17:20 -0800 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474C4ED5.2090105@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 27 Nov 2007 12:07:33 -0500") References: <474C4ED5.2090105@linux.vnet.ibm.com> Message-ID: <877ik3o8nj.fsf@theine.beaverton.ibm.com> JG> 1. When you add a patch to the queue you have an idea of where JG> you're going with it, and the commit message should reflect that. JG> Be specific. We have a tendency to say something like "Various JG> fixes to AllocationCapabilities" (I'm a huge offender here), when JG> we really should be saying what was actually fixed, like "add JG> EnumInstances support" or "eliminate duplicate instances." 100% agree. MQ allows you to edit a patch description at any time with "hg qrefresh -e", so it should be easy to update the message with information as you proceed. For patches that do more than one significant thing, a list of changes in the message would be good. JG> 2. Stay on task with a patch. If you notice other problems while JG> you are working on patch, and they are not most definitely JG> specific to your patch, they should be another patch. 110% agree. Patches are much easier to read if they're small. Even if you have two patches, one named "cleanups" and another named "fix specific issue X", that's better than just lumping the cleanups in with the fix. JG> 4. Before you type, "hg email," you should always type, "hg JG> export," first. Review your patch. Does it have any typos in the JG> comments? Did you accidentally include an irrelevant change? Is JG> your commit message still accurate and useful? Agree. JG> 2. If any of your patches are rejected and you rework them, resend JG> the entire set. This prevents things like, "So use patch 1 of 4 JG> from the set I sent yesterday, 2 and 3 of 4 from the patch I sent JG> an hour later, and patch 4 of 4 from today." Yes, re-sending the whole set makes it much easier for me to apply the relevant patches instead of cherry-picking the last-known-good version of each patch of a set. It also helps reviewers set context on a specific change that is being iterated. JG> 3. If you resend a patchset, and the "Patch [0 of 3]" subject line JG> was, "AllocationCapabilities fix," then the new subject line JG> should be, "AllocationCapabilities fix, version 2." This will JG> make it easier for email clients to thread things correctly, and JG> for human readers to know they are looking at the most current JG> revision of your set. Agreed, especially with respect to the "human readers" part. I don't know that ", version 2" needs to be the exact suffix, but something consistent and informative would be good. JG> I think that's everything for now. Additions, comments, JG> suggestions are welcome. Thanks a lot for doing this. After we settle on some of these, can you write this up as a patch to the SubmittingPatches file in the tree? That way we can claim it's policy :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 27 18:29:23 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 13:29:23 -0500 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <877ik3o8nj.fsf@theine.beaverton.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> <877ik3o8nj.fsf@theine.beaverton.ibm.com> Message-ID: <474C6203.3040208@linux.vnet.ibm.com> Dan Smith wrote: > Agreed, especially with respect to the "human readers" part. I don't > know that ", version 2" needs to be the exact suffix, but something > consistent and informative would be good. > I figured this one would be the most likely to generate discussion. I took a couple of stabs at the right suffix while I was writing this, then just decided to go with something and let everyone throw ideas out. Maybe we could go with something more succinct like just "#x". So "AllocationCapabilities EnumInstance" followed by "AllocationCapabilities EnumInstance #2" sort of thing. > JG> I think that's everything for now. Additions, comments, > JG> suggestions are welcome. > > Thanks a lot for doing this. After we settle on some of these, can > you write this up as a patch to the SubmittingPatches file in the > tree? That way we can claim it's policy :) > > Sure, no problem. -- -Jay From danms at us.ibm.com Tue Nov 27 18:35:36 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 10:35:36 -0800 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474C6203.3040208@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 27 Nov 2007 13:29:23 -0500") References: <474C4ED5.2090105@linux.vnet.ibm.com> <877ik3o8nj.fsf@theine.beaverton.ibm.com> <474C6203.3040208@linux.vnet.ibm.com> Message-ID: <873auro7t3.fsf@theine.beaverton.ibm.com> JG> I figured this one would be the most likely to generate JG> discussion. I took a couple of stabs at the right suffix while I JG> was writing this, then just decided to go with something and let JG> everyone throw ideas out. Maybe we could go with something more JG> succinct like just "#x". So "AllocationCapabilities EnumInstance" JG> followed by "AllocationCapabilities EnumInstance #2" sort of JG> thing. Sure. I'd prefer a shorter prefix, so just " #x" is fine with me. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Tue Nov 27 18:49:27 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 10:49:27 -0800 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic In-Reply-To: References: Message-ID: <474C66B7.6010605@linux.vnet.ibm.com> Heidi Eckhart wrote: > for (i = 0; comp_class_list[i]; i++) { > comp_class = comp_class_list[i]; > > - if ((test_class == NULL) || > - (comp_class == NULL) || > - match_op(broker, rop, comp_class)) > + if (!CMClassPathIsA(broker, rop, comp_class, NULL)) > return true; > } > I like the idea of this approach - I think it will help with scalability in the future if we decide to add support for new VMs. I have a few comments though. =) I'm not sure about this change here. If you return true here, then you're accepting just about anything as a possible result class. ECTP for example, the following query accepts Xen_Processor as a valid result class: wbemcli ain -ac Xen_ElementConformsToProfile -arc Xen_Process 'http://root:elm3b41 at localhost/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' I tried modifying this line so that it is + if (CMClassPathIsA(broker, rop, comp_class, NULL)) However, the problem with this is that it only allows result class to be one of the items in the list supplied by the handler. For example, ETCP has: +char* managed_element[] = { + "Xen_HostSystem", + "Xen_ComputerSystem", + "KVM_HostSystem", + "KVM_ComputerSystem", + NULL +}; The result class in the following query would not be valid because it doesn't appear in the list. wbemcli ain -ac Xen_ElementConformsToProfile -arc CIM_ManagedElement 'http://root:elm3b41 at localhost/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' We can't just add CIM_ManagedElement to the list because this same list is being used for the source class. The source class needs to be specific. Thoughts? I'm not sure if I'm correct in this line of thinking. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Tue Nov 27 19:23:34 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 11:23:34 -0800 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <873auro7t3.fsf@theine.beaverton.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> <877ik3o8nj.fsf@theine.beaverton.ibm.com> <474C6203.3040208@linux.vnet.ibm.com> <873auro7t3.fsf@theine.beaverton.ibm.com> Message-ID: <474C6EB6.6050001@linux.vnet.ibm.com> Dan Smith wrote: > JG> I figured this one would be the most likely to generate > JG> discussion. I took a couple of stabs at the right suffix while I > JG> was writing this, then just decided to go with something and let > JG> everyone throw ideas out. Maybe we could go with something more > JG> succinct like just "#x". So "AllocationCapabilities EnumInstance" > JG> followed by "AllocationCapabilities EnumInstance #2" sort of > JG> thing. > > Sure. I'd prefer a shorter prefix, so just " #x" is fine with me. > I don't really have anything else to add - good ideas. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 27 19:20:07 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:20:07 -0700 Subject: [Libvirt-cim] [PATCH] [CU][RFC] Correct a few API issues Message-ID: <256b237ba19f9e178719.1196194807@theine> # HG changeset patch # User Dan Smith # Date 1196194806 28800 # Node ID 256b237ba19f9e178719ed657f2b9a8f0d44d433 # Parent 64e4f6355b52e4b7bcc984ec557610a1fa9a9786 [CU][RFC] Correct a few API issues that I think need to be resolved before we snap a release. Some of the cu_get_* functions returned values instead of a CMPIrc's like everything else, so this changes that. Also, return const char *'s from the broker memory so that the callers don't need to free the result. This will require some work in libvirt-cim to make sure the new API is adhered to properly. If this is okay with people, I'll follow up with a patch to libvirt-cim to make those changes. Any other discussion about things that should change in the libcmpiutil API is welcomed. Changes from last time: - Fix cu_get_str_prop() to return a const broker string as well Patch set to make associated changes to libvirt-cim to follow... Signed-off-by: Dan Smith diff -r 64e4f6355b52 -r 256b237ba19f args_util.c --- a/args_util.c Tue Nov 27 06:33:45 2007 -0800 +++ b/args_util.c Tue Nov 27 12:20:06 2007 -0800 @@ -32,7 +32,9 @@ #define CU_WEAK_TYPES 1 -char *cu_get_str_path(const CMPIObjectPath *reference, const char *key) +CMPIrc cu_get_str_path(const CMPIObjectPath *reference, + const char *key, + const char **val) { CMPIData data; CMPIStatus s; @@ -42,18 +44,20 @@ char *cu_get_str_path(const CMPIObjectPa if ((s.rc != CMPI_RC_OK) || CMIsNullValue(data) || CMIsNullObject(data.value.string)) - return NULL; + return CMPI_RC_ERR_FAILED; value = CMGetCharPtr(data.value.string); if ((value == NULL) || (*value == '\0')) - return NULL; - - return strdup(value); -} - -int cu_get_u16_path(const CMPIObjectPath *reference, - const char *key, - uint16_t *target) + return CMPI_RC_ERR_TYPE_MISMATCH; + + *val = value; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_u16_path(const CMPIObjectPath *reference, + const char *key, + uint16_t *target) { CMPIData data; CMPIStatus s; @@ -61,11 +65,11 @@ int cu_get_u16_path(const CMPIObjectPath data = CMGetKey(reference, key, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(data)) - return 0; + return CMPI_RC_ERR_FAILED; *target = data.value.uint16; - return 1; + return CMPI_RC_OK; } const char *cu_check_args(const CMPIArgs *args, const char **names) @@ -85,92 +89,101 @@ const char *cu_check_args(const CMPIArgs return NULL; } -char *cu_get_str_arg(const CMPIArgs *args, const char *name) -{ - CMPIData argdata; - char *argval; +CMPIrc cu_get_str_arg(const CMPIArgs *args, const char *name, const char **val) +{ + CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) - return NULL; + return CMPI_RC_ERR_INVALID_PARAMETER; if ((argdata.type != CMPI_string) || CMIsNullObject(argdata.value.string)) - return NULL; - - argval = strdup(CMGetCharPtr(argdata.value.string)); - - return argval; -} - -CMPIObjectPath *cu_get_ref_arg(const CMPIArgs *args, const char *name) + return CMPI_RC_ERR_TYPE_MISMATCH; + + *val = CMGetCharPtr(argdata.value.string); + + return CMPI_RC_OK; +} + +CMPIrc cu_get_ref_arg(const CMPIArgs *args, + const char *name, + CMPIObjectPath **op) { CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) - return NULL; + return CMPI_RC_ERR_INVALID_PARAMETER; if ((argdata.type != CMPI_ref) || CMIsNullObject(argdata.value.ref)) - return NULL; - - return argdata.value.ref; -} - -CMPIInstance *cu_get_inst_arg(const CMPIArgs *args, const char *name) -{ - CMPIData argdata; - CMPIStatus s; - - argdata = CMGetArg(args, name, &s); - if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) { - return NULL; - } + return CMPI_RC_ERR_TYPE_MISMATCH; + + *op = argdata.value.ref; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_inst_arg(const CMPIArgs *args, + const char *name, + CMPIInstance **inst) +{ + CMPIData argdata; + CMPIStatus s; + + argdata = CMGetArg(args, name, &s); + if ((s.rc != CMPI_RC_OK) || (CMIsNullValue(argdata))) + return CMPI_RC_ERR_INVALID_PARAMETER; if ((argdata.type != CMPI_instance) || - CMIsNullObject(argdata.value.inst)) { - return NULL; - } - - return argdata.value.inst; -} - -CMPIArray *cu_get_array_arg(const CMPIArgs *args, const char *name) + CMIsNullObject(argdata.value.inst)) + CMPI_RC_ERR_TYPE_MISMATCH; + + *inst = argdata.value.inst; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_array_arg(const CMPIArgs *args, + const char *name, + CMPIArray **array) { CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(argdata)) - return NULL; + return CMPI_RC_ERR_INVALID_PARAMETER; if (!CMIsArray(argdata) || CMIsNullObject(argdata.value.array)) - return NULL; - - return argdata.value.array; -} - -int cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target) + return CMPI_RC_ERR_TYPE_MISMATCH; + + *array = argdata.value.array; + + return CMPI_RC_OK; +} + +CMPIrc cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target) { CMPIData argdata; CMPIStatus s; argdata = CMGetArg(args, name, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullValue(argdata)) - return 0; + return CMPI_RC_ERR_INVALID_PARAMETER; #ifdef CU_WEAK_TYPES if (!(argdata.type & CMPI_INTEGER)) #else if (argdata.type != CMPI_uint16) #endif - return 0; + return CMPI_RC_ERR_TYPE_MISMATCH; *target = argdata.value.uint16; - return 1; + return CMPI_RC_OK; } #define REQUIRE_PROPERTY_DEFINED(i, p, pv, s) \ @@ -182,7 +195,7 @@ int cu_get_u16_arg(const CMPIArgs *args, CMPIrc cu_get_str_prop(const CMPIInstance *inst, const char *prop, - char **target) + const char **target) { CMPIData value; CMPIStatus s; @@ -198,8 +211,7 @@ CMPIrc cu_get_str_prop(const CMPIInstanc if ((prop_val = CMGetCharPtr(value.value.string)) == NULL) return CMPI_RC_ERROR; - if ((*target = strdup(prop_val)) == NULL) - return CMPI_RC_ERROR; + *target = prop_val; return CMPI_RC_OK; } diff -r 64e4f6355b52 -r 256b237ba19f libcmpiutil.h --- a/libcmpiutil.h Tue Nov 27 06:33:45 2007 -0800 +++ b/libcmpiutil.h Tue Nov 27 12:20:06 2007 -0800 @@ -91,18 +91,22 @@ const char *cu_check_args(const CMPIArgs * * @param args The argument list to search * @param name The name of the argument - * @returns The string argument's value, or NULL if error (must be free()'d) - */ -char *cu_get_str_arg(const CMPIArgs *args, const char *name); + * @param val The value of the argument (must be free()'d) + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_str_arg(const CMPIArgs *args, const char *name, const char **val); /** * Get a reference argument * * @param args The argument list to search * @param name The name of the argument - * @returns The reference argument's value, or NULL if error - */ -CMPIObjectPath *cu_get_ref_arg(const CMPIArgs *args, const char *name); + * @param op The reference argument's value + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_ref_arg(const CMPIArgs *args, + const char *name, + CMPIObjectPath **op); /** * Get an instance argument @@ -111,7 +115,9 @@ CMPIObjectPath *cu_get_ref_arg(const CMP * @param name The name of the argument * @returns The instance argument's value, or NULL if error */ -CMPIInstance *cu_get_inst_arg(const CMPIArgs *args, const char *name); +CMPIrc cu_get_inst_arg(const CMPIArgs *args, + const char *name, + CMPIInstance **inst); /** * Get an array argument @@ -120,7 +126,9 @@ CMPIInstance *cu_get_inst_arg(const CMPI * @param name The name of the argument * @returns The array argument's value, or NULL if error */ -CMPIArray *cu_get_array_arg(const CMPIArgs *args, const char *name); +CMPIrc cu_get_array_arg(const CMPIArgs *args, + const char *name, + CMPIArray **array); /** * Get a uint16 argument @@ -128,18 +136,22 @@ CMPIArray *cu_get_array_arg(const CMPIAr * @param args The argument list to search * @param name The name of the argument * @param target The uint16_t to reflect the argument value - * @returns nonzero on success, zero otherwise - */ -int cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target); + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_u16_arg(const CMPIArgs *args, const char *name, uint16_t *target); /** * Get a string component of an object path * - * @param reference The object path + * @param ref The object path * @param key The name of the component to return - * @returns The value of the component, or NULL if error (must be free()'d) - */ -char *cu_get_str_path(const CMPIObjectPath *reference, const char *key); + * @param val The value of the component, or NULL if error (must be + * free()'d) + * @returns CMPI_RC_OK on success + */ +CMPIrc cu_get_str_path(const CMPIObjectPath *ref, + const char *key, + const char **val); /** * Get a uint16 component of an object path @@ -147,11 +159,11 @@ char *cu_get_str_path(const CMPIObjectPa * @param reference The object path * @param key The name of the component to return * @param target A pointer to the uint16 to set - * @returns nonzero on success, zero otherwise - */ -int cu_get_u16_path(const CMPIObjectPath *reference, - const char *key, - uint16_t *target); + * @returns CMPI_RC_OK if successful + */ +CMPIrc cu_get_u16_path(const CMPIObjectPath *reference, + const char *key, + uint16_t *target); /* Forward declaration */ struct inst_list; @@ -202,7 +214,7 @@ unsigned int cu_return_instance_names(co */ CMPIrc cu_get_str_prop(const CMPIInstance *inst, const char *prop, - char **target); + const char **target); /** * Get a boolean property of an instance diff -r 64e4f6355b52 -r 256b237ba19f std_indication.c --- a/std_indication.c Tue Nov 27 06:33:45 2007 -0800 +++ b/std_indication.c Tue Nov 27 12:20:06 2007 -0800 @@ -49,7 +49,8 @@ static CMPIStatus raise(struct std_indic if (ctx->handler->raise_fn == NULL) return (CMPIStatus){CMPI_RC_OK, NULL}; - inst = cu_get_inst_arg(argsin, "Indication"); + if (cu_get_inst_arg(argsin, "Indication", &inst) != CMPI_RC_OK) + return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL}; return ctx->handler->raise_fn(context, inst); } From grendel at linux.vnet.ibm.com Tue Nov 27 20:22:50 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 15:22:50 -0500 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: <87fxyrod42.fsf@theine.beaverton.ibm.com> References: <690413b4aef454d03ce3.1196158115@localhost.localdomain> <474C44A4.3010207@linux.vnet.ibm.com> <87fxyrod42.fsf@theine.beaverton.ibm.com> Message-ID: <474C7C9A.3070908@linux.vnet.ibm.com> Dan Smith wrote: > JG> now that we have cu_statusf, should we use that instead of > JG> CMSetStatusWithChars even in places where we don't need any fancy > JG> formatting? > > Yes please! > > JG> It helps to maintain consistency, and (although this is a bit of a > JG> minor point), it is a substantially shorter function name. > > It's not a minor point to me :) > > JG> Paying more attention to how we free things now that we know > JG> virConnectClose is fine when given a NULL, wouldn't the same hold > JG> for classname? > > Yes. Most of the stuff I write free()'s all the dynamic strings on > exit (error or not) to make sure we don't skip one due to a broken > exit sequence. > > JG> Optionally, we can go with "not relevant to the patch" and I'll > JG> try and clean up this type of thing wherever I can find it as a > JG> separate patch. > > Sounds good to me. > > Okay, I can add these two items as to my list. After all the alloc cap and sdc_rasd stuff, I could go for a few things that require a little less heavy lifting. :) -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 27 20:28:39 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 15:28:39 -0500 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474C4ED5.2090105@linux.vnet.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> Message-ID: <474C7DF7.8060808@linux.vnet.ibm.com> I think I'm going to add one more thing, since I just noticed Dan do it and I like it. For the first section: 5. If you have to rework and resend a patch, the commit message should reflect what changed since you last sent the patch. Nobody likes having to diff two diffs. -- -Jay From danms at us.ibm.com Tue Nov 27 19:28:42 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:42 -0700 Subject: [Libvirt-cim] [PATCH 16 of 18] Fixes to RAFP for libcmpiutil API change In-Reply-To: Message-ID: <1d3cf993995a4d162e11.1196195322@theine> # HG changeset patch # User Dan Smith # Date 1196195250 28800 # Node ID 1d3cf993995a4d162e11890a04cfcbf2446c3ca2 # Parent eeba8399b981b7539a8103fcf1a196e98476073b Fixes to RAFP for libcmpiutil API change Signed-off-by: Dan Smith diff -r eeba8399b981 -r 1d3cf993995a src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Tue Nov 27 12:26:46 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Tue Nov 27 12:27:30 2007 -0800 @@ -43,7 +43,7 @@ static CMPIStatus rasd_to_pool(const CMP { CMPIStatus s; uint16_t type; - char *id = NULL; + const char *id = NULL; char *poolid = NULL; virConnectPtr conn = NULL; struct inst_list _list; @@ -58,8 +58,7 @@ static CMPIStatus rasd_to_pool(const CMP goto out; } - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -92,7 +91,6 @@ static CMPIStatus rasd_to_pool(const CMP } out: - free(id); free(poolid); virConnectClose(conn); inst_list_free(&_list); @@ -106,7 +104,7 @@ static int filter_by_pool(struct inst_li { int i; uint16_t type; - char *rasd_id = NULL; + const char *rasd_id = NULL; char *poolid = NULL; for (i = 0; i < src->cur; i++) { @@ -126,8 +124,6 @@ static int filter_by_pool(struct inst_li poolid = pool_member_of(_BROKER, CLASSNAME(op), type, rasd_id); if (STREQ(poolid, _poolid)) inst_list_add(dest, inst); - - free(rasd_id); } return dest->cur; @@ -182,10 +178,9 @@ static CMPIStatus pool_to_rasd(const CMP struct inst_list *list) { CMPIStatus s; - char *poolid; - - poolid = cu_get_str_path(ref, "InstanceID"); - if (poolid == NULL) { + const char *poolid; + + if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -222,8 +217,6 @@ static CMPIStatus pool_to_rasd(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(poolid); - return s; } From danms at us.ibm.com Tue Nov 27 19:28:44 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:44 -0700 Subject: [Libvirt-cim] [PATCH 18 of 18] Fixes to ElementSettingData for libcmpiutil API change In-Reply-To: Message-ID: <4a88569d292542741d8e.1196195324@theine> # HG changeset patch # User Dan Smith # Date 1196195285 28800 # Node ID 4a88569d292542741d8e9260111e9b2f4d4dee9f # Parent fa0aa635ce2eb93e8a6f8581056f3d0f40122389 Fixes to ElementSettingData for libcmpiutil API change Signed-off-by: Dan Smith diff -r fa0aa635ce2e -r 4a88569d2925 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Tue Nov 27 12:27:48 2007 -0800 +++ b/src/Virt_ElementSettingData.c Tue Nov 27 12:28:05 2007 -0800 @@ -90,13 +90,12 @@ static CMPIStatus rasd_to_rasd(const CMP { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - char *id = NULL; + const char *id = NULL; uint16_t type; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -122,8 +121,6 @@ static CMPIStatus rasd_to_rasd(const CMP inst_list_add(list, inst); out: - free(id); - return s; } From danms at us.ibm.com Tue Nov 27 19:28:37 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:37 -0700 Subject: [Libvirt-cim] [PATCH 11 of 18] Fixes to ECTP for libcmpiutil API change In-Reply-To: Message-ID: <0bbb737215af97d0704b.1196195317@theine> # HG changeset patch # User Dan Smith # Date 1196195105 28800 # Node ID 0bbb737215af97d0704bbbd6e2526f6aec839228 # Parent fd942395e4dc888d1eede22d2dae5b99d9eed4eb Fixes to ECTP for libcmpiutil API change Signed-off-by: Dan Smith diff -r fd942395e4dc -r 0bbb737215af src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Tue Nov 27 12:24:55 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 12:25:05 2007 -0800 @@ -101,11 +101,10 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; - char *id; + const char *id; int i; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); @@ -116,13 +115,11 @@ static CMPIStatus prof_to_elem(const CMP if (STREQ(id, profiles[i]->reg_id)) { s = elem_instances(ref, info, list, profiles[i]); if ((s.rc != CMPI_RC_OK)) - goto error; + goto out; break; } } - - error: - free(id); + out: return s; } From danms at us.ibm.com Tue Nov 27 19:28:36 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:36 -0700 Subject: [Libvirt-cim] [PATCH 10 of 18] Fixes to RegisteredProfile for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196195095 28800 # Node ID fd942395e4dc888d1eede22d2dae5b99d9eed4eb # Parent 7e2a9350d9794c4744ecab188da956434f28ce6c Fixes to RegisteredProfile for libcmpiutil API change Signed-off-by: Dan Smith diff -r 7e2a9350d979 -r fd942395e4dc src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Tue Nov 27 12:24:49 2007 -0800 +++ b/src/Virt_RegisteredProfile.c Tue Nov 27 12:24:55 2007 -0800 @@ -124,11 +124,10 @@ static CMPIStatus get_prof(const CMPIObj { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance = NULL; - char* id; + const char* id; int i; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); @@ -149,9 +148,6 @@ static CMPIStatus get_prof(const CMPIObj CMReturnInstance(results, instance); else CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); - - - free(id); return s; } From danms at us.ibm.com Tue Nov 27 19:28:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:28 -0700 Subject: [Libvirt-cim] [PATCH 02 of 18] Fixes to ComputerSystem for libcmpiutil API change In-Reply-To: Message-ID: <620fadffdb9642fb3794.1196195308@theine> # HG changeset patch # User Dan Smith # Date 1196194865 28800 # Node ID 620fadffdb9642fb379441d5341f89049c634ae7 # Parent dce4d8a891849228a59d3f90b4b2d30dc098fc3a Fixes to ComputerSystem for libcmpiutil API change Signed-off-by: Dan Smith diff -r dce4d8a89184 -r 620fadffdb96 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Tue Nov 27 08:03:00 2007 -0800 +++ b/src/Virt_ComputerSystem.c Tue Nov 27 12:21:05 2007 -0800 @@ -277,7 +277,7 @@ static int instance_from_dom(const CMPIB /* Given a hypervisor connection and a domain name, return an instance */ CMPIInstance *instance_from_name(const CMPIBroker *broker, virConnectPtr conn, - char *name, + const char *name, const CMPIObjectPath *op) { virDomainPtr dom; @@ -376,7 +376,7 @@ static CMPIStatus return_enum_domains(co static CMPIStatus get_domain(const CMPIObjectPath *reference, const CMPIResult *results, - char *name) + const char *name) { CMPIInstance *inst; CMPIStatus s; @@ -440,10 +440,9 @@ static CMPIStatus GetInstance(CMPIInstan const CMPIObjectPath *reference, const char **properties) { - char *name; - - name = cu_get_str_path(reference, "Name"); - if (name == NULL) { + const char *name; + + if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) { CMPIStatus s; CMSetStatusWithChars(_BROKER, &s, @@ -602,7 +601,7 @@ static CMPIStatus state_change_reset(vir return s; } -static CMPIStatus __state_change(char *name, +static CMPIStatus __state_change(const char *name, uint16_t state, const CMPIObjectPath *ref) { @@ -660,7 +659,7 @@ static CMPIStatus state_change(CMPIMetho CMPIStatus s; uint16_t state; int ret; - char *name = NULL; + const char *name = NULL; ret = cu_get_u16_arg(argsin, "RequestedState", &state); if (!ret) { @@ -668,8 +667,7 @@ static CMPIStatus state_change(CMPIMetho goto out; } - name = cu_get_str_path(reference, "Name"); - if (name == NULL) { + if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Name key not specified"); @@ -679,8 +677,6 @@ static CMPIStatus state_change(CMPIMetho s = __state_change(name, state, reference); out: - free(name); - return s; } diff -r dce4d8a89184 -r 620fadffdb96 src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Tue Nov 27 08:03:00 2007 -0800 +++ b/src/Virt_ComputerSystem.h Tue Nov 27 12:21:05 2007 -0800 @@ -34,7 +34,7 @@ */ CMPIInstance *instance_from_name(const CMPIBroker *broker, virConnectPtr conn, - char *name, + const char *name, const CMPIObjectPath *ns); From danms at us.ibm.com Tue Nov 27 19:28:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:26 -0700 Subject: [Libvirt-cim] [PATCH 00 of 18] Updates for libcmpiutil API change Message-ID: This refactors all of the necessary functions in libvirt-cim for the new API. Things only got cleaner, I think. I also found a substantial number of memory leaks in the process, which are fundamentally fixed by the new API which I think is a validation of it as "the right thing to do". All required changes should have been easily spotted by the compiler, but some testing would be good. Tip: To find the leaks, note every time we convert a variable from char * to const char * and don't remove a subsequent free() call :) From danms at us.ibm.com Tue Nov 27 19:28:32 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:32 -0700 Subject: [Libvirt-cim] [PATCH 06 of 18] Fixes to VSMS for libcmpiutil API change In-Reply-To: Message-ID: <6e84b22c2d0251897d1f.1196195312@theine> # HG changeset patch # User Dan Smith # Date 1196195058 28800 # Node ID 6e84b22c2d0251897d1f12a97fc79a0cfa2c0db9 # Parent bf7fc8b2c3b68b409052757853b450002bb7e1da Fixes to VSMS for libcmpiutil API change Changed the name of a variable to avoid having to break a line in an ugly way. If this is too much of a violation of the recently defined policy, I'll changed it :) Signed-off-by: Dan Smith diff -r bf7fc8b2c3b6 -r 6e84b22c2d02 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Tue Nov 27 12:22:26 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Tue Nov 27 12:24:18 2007 -0800 @@ -92,12 +92,11 @@ static CMPIStatus define_system_parse_ar struct inst_list *res) { CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; - char *sys_str = NULL; + const char *sys_str = NULL; CMPIArray *res_arr; int ret; - sys_str = cu_get_str_arg(argsin, "SystemSettings"); - if (sys_str == NULL) { + if (cu_get_str_arg(argsin, "SystemSettings", &sys_str) != CMPI_RC_OK) { CU_DEBUG("No SystemSettings string argument"); goto out; } @@ -114,8 +113,8 @@ static CMPIStatus define_system_parse_ar goto out; } - res_arr = cu_get_array_arg(argsin, "ResourceSettings"); - if (res_arr == NULL) { + if (cu_get_array_arg(argsin, "ResourceSettings", &res_arr) != + CMPI_RC_OK) { CU_DEBUG("Failed to get array arg"); goto out; } @@ -125,8 +124,6 @@ static CMPIStatus define_system_parse_ar CMSetStatus(&s, CMPI_RC_OK); out: - free(sys_str); - return s; } @@ -135,11 +132,14 @@ static int vssd_to_domain(CMPIInstance * { uint16_t tmp; int ret = 0; + const char *val; + + ret = cu_get_str_prop(inst, "VirtualSystemIdentifier", &val); + if (ret != CMPI_RC_OK) + goto out; free(domain->name); - ret = cu_get_str_prop(inst, "VirtualSystemIdentifier", &domain->name); - if (ret != CMPI_RC_OK) - goto out; + domain->name = strdup(val); ret = cu_get_u16_prop(inst, "AutomaticShutdownAction", &tmp); if (ret != CMPI_RC_OK) @@ -153,15 +153,19 @@ static int vssd_to_domain(CMPIInstance * domain->on_crash = (int)tmp; + ret = cu_get_str_prop(inst, "Bootloader", &val); + if (ret != CMPI_RC_OK) + val = ""; + free(domain->bootloader); - ret = cu_get_str_prop(inst, "Bootloader", &domain->bootloader); + domain->bootloader = strdup(val); + + ret = cu_get_str_prop(inst, "BootloaderArgs", &val); if (ret != CMPI_RC_OK) - domain->bootloader = strdup(""); + val = ""; free(domain->bootloader_args); - ret = cu_get_str_prop(inst, "BootloaderArgs", &domain->bootloader_args); - if (ret != CMPI_RC_OK) - domain->bootloader_args = strdup(""); + domain->bootloader_args = strdup(val); ret = 1; out: @@ -172,7 +176,8 @@ static int rasd_to_vdev(CMPIInstance *in struct virt_device *dev) { uint16_t type; - char *id = NULL; + const char *id = NULL; + const char *val = NULL; char *name = NULL; char *devid = NULL; CMPIObjectPath *op; @@ -196,16 +201,20 @@ static int rasd_to_vdev(CMPIInstance *in free(dev->dev.disk.virtual_dev); dev->dev.disk.virtual_dev = devid; + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) + val = "/dev/null"; + free(dev->dev.disk.source); - cu_get_str_prop(inst, "Address", &dev->dev.disk.source); + dev->dev.disk.source = strdup(val); } else if (type == VIRT_DEV_NET) { free(dev->dev.net.mac); dev->dev.net.mac = devid; + if (cu_get_str_prop(inst, "NetworkType", &val) != CMPI_RC_OK) + val = "bridge"; + free(dev->dev.net.type); - cu_get_str_prop(inst, "NetworkType", &dev->dev.net.type); - if (dev->dev.net.type == NULL) - dev->dev.net.type = strdup("bridge"); + dev->dev.net.type = strdup(val); } else if (type == VIRT_DEV_MEM) { cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); @@ -215,12 +224,10 @@ static int rasd_to_vdev(CMPIInstance *in dev->dev.mem.maxsize <<= 10; } - free(id); free(name); return 1; err: - free(id); free(name); free(devid); @@ -411,7 +418,7 @@ static CMPIStatus destroy_system(CMPIMet const CMPIArgs *argsin, CMPIArgs *argsout) { - char *dom_name = NULL; + const char *dom_name = NULL; CMPIStatus status = {CMPI_RC_OK, NULL}; CMPIValue rc; CMPIObjectPath *sys; @@ -426,8 +433,7 @@ static CMPIStatus destroy_system(CMPIMet goto error1; } - sys = cu_get_ref_arg(argsin, "AffectedSystem"); - if (sys == NULL) { + if (cu_get_ref_arg(argsin, "AffectedSystem", &sys) != CMPI_RC_OK) { rc.uint32 = IM_RC_FAILED; goto error2; } @@ -455,7 +461,6 @@ static CMPIStatus destroy_system(CMPIMet rc.uint32 = IM_RC_SYS_NOT_FOUND; } - free(dom_name); error2: virConnectClose(conn); error1: @@ -467,7 +472,7 @@ static CMPIStatus update_system_settings CMPIInstance *vssd) { CMPIStatus s; - char *name = NULL; + const char *name = NULL; CMPIrc ret; virConnectPtr conn = NULL; virDomainPtr dom = NULL; @@ -513,7 +518,6 @@ static CMPIStatus update_system_settings out: free(xml); - free(name); virDomainFree(dom); virConnectClose(conn); cleanup_dominfo(&dominfo); @@ -529,11 +533,10 @@ static CMPIStatus mod_system_settings(CM const CMPIArgs *argsin, CMPIArgs *argsout) { - char *inst_str; + const char *inst_str; CMPIInstance *inst; - inst_str = cu_get_str_arg(argsin, "SystemSettings"); - if (inst == NULL) { + if (cu_get_str_arg(argsin, "SystemSettings", &inst_str) != CMPI_RC_OK) { CMPIStatus s; cu_statusf(_BROKER, &s, @@ -878,7 +881,7 @@ static CMPIStatus _update_resource_setti for (i = 0; i < list->cur; i++) { CMPIInstance *inst = list->list[i]; - char *id = NULL; + const char *id = NULL; char *name = NULL; char *devid = NULL; virDomainPtr dom = NULL; @@ -910,7 +913,6 @@ static CMPIStatus _update_resource_setti end: free(name); free(devid); - free(id); virDomainFree(dom); if (s.rc != CMPI_RC_OK) @@ -927,21 +929,20 @@ static CMPIStatus update_resource_settin const CMPIArgs *argsin, resmod_fn func) { - CMPIArray *array; + CMPIArray *arr; CMPIStatus s; struct inst_list list; inst_list_init(&list); - array = cu_get_array_arg(argsin, "ResourceSettings"); - if (array == NULL) { + if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing ResourceSettings"); goto out; } - parse_str_inst_array(array, NAMESPACE(ref), &list); + parse_str_inst_array(arr, NAMESPACE(ref), &list); s = _update_resource_settings(ref, &list, func); @@ -1052,7 +1053,7 @@ CMPIStatus get_vsms(const CMPIObjectPath CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; CMPIInstance *host = NULL; - char *val = NULL; + const char *val = NULL; virConnectPtr conn = NULL; *_inst = NULL; @@ -1089,7 +1090,6 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetProperty(inst, "SystemName", (CMPIValue *)val, CMPI_chars); - free(val); if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK) { cu_statusf(broker, &s, @@ -1100,7 +1100,6 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetProperty(inst, "SystemCreationClassName", (CMPIValue *)val, CMPI_chars); - free(val); CMSetStatus(&s, CMPI_RC_OK); From danms at us.ibm.com Tue Nov 27 19:28:33 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:33 -0700 Subject: [Libvirt-cim] [PATCH 07 of 18] Fixes to VSMC for libcmpiutil API change In-Reply-To: Message-ID: <393868c380f668d3d5e7.1196195313@theine> # HG changeset patch # User Dan Smith # Date 1196195061 28800 # Node ID 393868c380f668d3d5e765f6503be3eb3eac0a62 # Parent 6e84b22c2d0251897d1f12a97fc79a0cfa2c0db9 Fixes to VSMC for libcmpiutil API change Signed-off-by: Dan Smith diff -r 6e84b22c2d02 -r 393868c380f6 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Tue Nov 27 12:24:18 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Tue Nov 27 12:24:21 2007 -0800 @@ -95,10 +95,9 @@ CMPIStatus get_vsm_cap(const CMPIBroker CMPIStatus s; CMPIObjectPath *op; char *classname = NULL; - char *sys_name = NULL; - - sys_name = cu_get_str_path(ref, "Name"); - if (sys_name == NULL) { + const char *sys_name = NULL; + + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, "Missing key: Name"); @@ -134,7 +133,6 @@ CMPIStatus get_vsm_cap(const CMPIBroker out: free(classname); - free(sys_name); return s; } From danms at us.ibm.com Tue Nov 27 19:28:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:30 -0700 Subject: [Libvirt-cim] [PATCH 04 of 18] Fixes to SystemDevice for libcmpiutil API change In-Reply-To: Message-ID: <64da04a35e65ed87ee6b.1196195310@theine> # HG changeset patch # User Dan Smith # Date 1196194912 28800 # Node ID 64da04a35e65ed87ee6bd144cdbf5a9d8efd9383 # Parent 57656dc04de25a4b9b4986d94f73b42c9db571b9 Fixes to SystemDevice for libcmpiutil API change Signed-off-by: Dan Smith diff -r 57656dc04de2 -r 64da04a35e65 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Tue Nov 27 12:21:29 2007 -0800 +++ b/src/Virt_SystemDevice.c Tue Nov 27 12:21:52 2007 -0800 @@ -158,14 +158,13 @@ static CMPIStatus sys_to_dev(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *host = NULL; + const char *host = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; int ret; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - host = cu_get_str_path(ref, "Name"); - if (host == NULL) { + if (cu_get_str_path(ref, "Name", &host) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing Name"); @@ -205,7 +204,7 @@ static CMPIStatus dev_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *devid = NULL; + const char *devid = NULL; char *host = NULL; char *dev = NULL; CMPIInstance *sys; @@ -213,8 +212,7 @@ static CMPIStatus dev_to_sys(const CMPIO ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - devid = cu_get_str_path(ref, "DeviceID"); - if (devid == NULL) { + if (cu_get_str_path(ref, "DeviceID", &devid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -242,7 +240,6 @@ static CMPIStatus dev_to_sys(const CMPIO out: free(dev); free(host); - free(devid); return s; } From danms at us.ibm.com Tue Nov 27 19:28:27 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:27 -0700 Subject: [Libvirt-cim] [PATCH 01 of 18] Fixes to misc_util for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196179380 28800 # Node ID dce4d8a891849228a59d3f90b4b2d30dc098fc3a # Parent dca4cb9c22da97bfef6c2771bf082efbd6d32bc4 Fixes to misc_util for libcmpiutil API change Signed-off-by: Dan Smith diff -r dca4cb9c22da -r dce4d8a89184 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Tue Nov 27 10:34:13 2007 +0100 +++ b/libxkutil/misc_util.c Tue Nov 27 08:03:00 2007 -0800 @@ -85,15 +85,18 @@ void free_domain_list(virDomainPtr *list virDomainFree(list[i]); } -char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key) +const char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key) { CMPIObjectPath *ref = NULL; - - ref = cu_get_ref_arg(args, arg); - if (ref == NULL) - return NULL; - - return cu_get_str_path(ref, key); + const char *val = NULL; + + if (cu_get_ref_arg(args, arg, &ref) != CMPI_RC_OK) + return NULL; + + if (cu_get_str_path(ref, key, &val) != CMPI_RC_OK) + return NULL; + + return val; } bool domain_exists(virConnectPtr conn, const char *name) @@ -316,7 +319,7 @@ bool domain_online(virDomainPtr dom) (info.state == VIR_DOMAIN_RUNNING); } -int parse_id(char *id, +int parse_id(const char *id, char **pfx, char **name) { @@ -350,15 +353,12 @@ bool parse_instanceid(const CMPIObjectPa char **name) { int ret; - char *id = NULL; - - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) + const char *id = NULL; + + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) return false; ret = parse_id(id, pfx, name); - - free(id); if (!ret) return false; diff -r dca4cb9c22da -r dce4d8a89184 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Tue Nov 27 10:34:13 2007 +0100 +++ b/libxkutil/misc_util.h Tue Nov 27 08:03:00 2007 -0800 @@ -83,7 +83,7 @@ CMPIInstance *get_typed_instance(const C /* Parse an OrgID:LocID string into its constituent parts */ int parse_instance_id(char *iid, char **orgid, char **locid); -char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key); +const char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key); bool domain_exists(virConnectPtr conn, const char *name); bool domain_online(virDomainPtr dom); @@ -93,7 +93,7 @@ char *association_prefix(const char *pro char *association_prefix(const char *provider_name); bool match_pn_to_cn(const char *pn, const char *cn); -int parse_id(char *id, char **pfx, char **name); +int parse_id(const char *id, char **pfx, char **name); bool parse_instanceid(const CMPIObjectPath *ref, char **pfx, char **name); bool libvirt_cim_init(void); From danms at us.ibm.com Tue Nov 27 19:28:39 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:39 -0700 Subject: [Libvirt-cim] [PATCH 13 of 18] Fixes to ElementCapabilities for libcmpiutil API change In-Reply-To: Message-ID: <589cad1316a9eb3fe021.1196195319@theine> # HG changeset patch # User Dan Smith # Date 1196195127 28800 # Node ID 589cad1316a9eb3fe0214cf9515bb72ccaef91f8 # Parent fecc81fd400c780ecb496af2ed9ba17001ff2f05 Fixes to ElementCapabilities for libcmpiutil API change Signed-off-by: Dan Smith diff -r fecc81fd400c -r 589cad1316a9 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Tue Nov 27 12:25:14 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Tue Nov 27 12:25:27 2007 -0800 @@ -53,8 +53,8 @@ static CMPIStatus sys_to_cap(const CMPIO { CMPIInstance *inst; CMPIrc host_rc; - char *host_name = NULL; - char *sys_name = NULL; + const char *host_name = NULL; + const char *sys_name = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; s = get_host_cs(_BROKER, ref, &inst); @@ -65,8 +65,7 @@ static CMPIStatus sys_to_cap(const CMPIO if (host_rc != CMPI_RC_OK) goto out; - sys_name = cu_get_str_path(ref, "Name"); - if (!STREQ(sys_name, host_name)) { + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "System '%s' is not a host system.", sys_name); goto out; @@ -76,7 +75,6 @@ static CMPIStatus sys_to_cap(const CMPIO if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); out: - free(sys_name); return s; } @@ -84,16 +82,15 @@ static CMPIStatus cap_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *inst_id; + const char *inst_id; char *host; char *device; - char *host_name; + const char *host_name; CMPIrc host_rc; CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); @@ -123,7 +120,6 @@ static CMPIStatus cap_to_sys(const CMPIO out: free(host); free(device); - free(inst_id); return s; } @@ -145,15 +141,14 @@ static CMPIStatus cap_to_cs(const CMPIOb struct std_assoc_info *info, struct inst_list *list) { - char *inst_id; + const char *inst_id; char *host; char *device; CMPIInstance *inst; virConnectPtr conn; CMPIStatus s = {CMPI_RC_OK, NULL}; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); @@ -179,7 +174,7 @@ static CMPIStatus cap_to_cs(const CMPIOb error1: free(host); free(device); - free(inst_id); + return s; } @@ -196,13 +191,12 @@ static CMPIStatus pool_to_alloc(const CM struct inst_list *list) { int ret; - char *inst_id; + const char *inst_id; uint16_t type; CMPIInstance *inst = NULL; CMPIStatus s = {CMPI_RC_OK}; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); goto out; @@ -225,8 +219,6 @@ static CMPIStatus pool_to_alloc(const CM inst_list_add(list, inst); out: - free(inst_id); - return s; } static CMPIInstance *make_ref(const CMPIObjectPath *ref, From danms at us.ibm.com Tue Nov 27 19:28:35 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:35 -0700 Subject: [Libvirt-cim] [PATCH 09 of 18] Fixes to DevicePool for libcmpiutil API change In-Reply-To: Message-ID: <7e2a9350d9794c4744ec.1196195315@theine> # HG changeset patch # User Dan Smith # Date 1196195089 28800 # Node ID 7e2a9350d9794c4744ecab188da956434f28ce6c # Parent 0d30be4ad77c9a476eeee6dcd56c183c7de566a2 Fixes to DevicePool for libcmpiutil API change Signed-off-by: Dan Smith diff -r 0d30be4ad77c -r 7e2a9350d979 src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Tue Nov 27 12:24:41 2007 -0800 +++ b/src/Virt_DevicePool.c Tue Nov 27 12:24:49 2007 -0800 @@ -730,10 +730,9 @@ static CMPIStatus GetInstance(CMPIInstan CMPIStatus s; CMPIInstance *inst; virConnectPtr conn = NULL; - char *id = NULL; - - id = cu_get_str_path(reference, "InstanceID"); - if (id == NULL) { + const char *id = NULL; + + if (cu_get_str_path(reference, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -756,7 +755,6 @@ static CMPIStatus GetInstance(CMPIInstan out: - free(id); virConnectClose(conn); return s; From danms at us.ibm.com Tue Nov 27 19:28:29 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:29 -0700 Subject: [Libvirt-cim] [PATCH 03 of 18] Fixes to Device for libcmpiutil API change In-Reply-To: Message-ID: <57656dc04de25a4b9b49.1196195309@theine> # HG changeset patch # User Dan Smith # Date 1196194889 28800 # Node ID 57656dc04de25a4b9b4986d94f73b42c9db571b9 # Parent 620fadffdb9642fb379441d5341f89049c634ae7 Fixes to Device for libcmpiutil API change Signed-off-by: Dan Smith diff -r 620fadffdb96 -r 57656dc04de2 src/Virt_Device.c --- a/src/Virt_Device.c Tue Nov 27 12:21:05 2007 -0800 +++ b/src/Virt_Device.c Tue Nov 27 12:21:29 2007 -0800 @@ -470,7 +470,7 @@ CMPIInstance *instance_from_devid(const static CMPIStatus get_device(const CMPIObjectPath *reference, const CMPIResult *results, - char *devid) + const char *devid) { CMPIStatus s; virConnectPtr conn; @@ -525,10 +525,9 @@ static CMPIStatus GetInstance(CMPIInstan const CMPIObjectPath *reference, const char **properties) { - char *devid; - - devid = cu_get_str_path(reference, "DeviceID"); - if (devid == NULL) { + const char *devid; + + if (cu_get_str_path(reference, "DeviceID", &devid) != CMPI_RC_OK) { CMPIStatus s; CMSetStatusWithChars(_BROKER, &s, From danms at us.ibm.com Tue Nov 27 19:28:43 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:43 -0700 Subject: [Libvirt-cim] [PATCH 17 of 18] Fixes to EAFP for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196195268 28800 # Node ID fa0aa635ce2eb93e8a6f8581056f3d0f40122389 # Parent 1d3cf993995a4d162e11890a04cfcbf2446c3ca2 Fixes to EAFP for libcmpiutil API change Signed-off-by: Dan Smith diff -r 1d3cf993995a -r fa0aa635ce2e src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Tue Nov 27 12:27:30 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Tue Nov 27 12:27:48 2007 -0800 @@ -63,7 +63,7 @@ static CMPIStatus vdev_to_pool(const CMP { CMPIStatus s; uint16_t type; - char *id = NULL; + const char *id = NULL; char *poolid = NULL; virConnectPtr conn = NULL; CMPIInstance *pool = NULL; @@ -76,8 +76,7 @@ static CMPIStatus vdev_to_pool(const CMP goto out; } - id = cu_get_str_path(ref, "DeviceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "DeviceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -107,7 +106,6 @@ static CMPIStatus vdev_to_pool(const CMP } out: - free(id); free(poolid); virConnectClose(conn); @@ -124,23 +122,20 @@ static int filter_by_pool(struct inst_li for (i = 0; i < src->cur; i++) { CMPIInstance *inst = src->list[i]; - char *cn = NULL; - char *dev_id = NULL; + const char *cn = NULL; + const char *dev_id = NULL; cu_get_str_prop(inst, "CreationClassName", &cn); cu_get_str_prop(inst, "DeviceID", &dev_id); if ((dev_id == NULL) || (cn == NULL)) - goto end; + continue; printf("Device %hhi:%s", type, dev_id); poolid = pool_member_of(_BROKER, cn, type, dev_id); if (poolid && STREQ(poolid, _poolid)) inst_list_add(dest, inst); - end: - free(dev_id); - free(cn); } return dest->cur; @@ -200,11 +195,10 @@ static CMPIStatus pool_to_vdev(const CMP struct std_assoc_info *info, struct inst_list *list) { - char *poolid; + const char *poolid; CMPIStatus s; - poolid = cu_get_str_path(ref, "InstanceID"); - if (poolid == NULL) { + if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -244,8 +238,6 @@ static CMPIStatus pool_to_vdev(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(poolid); - return s; } From danms at us.ibm.com Tue Nov 27 19:28:41 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:41 -0700 Subject: [Libvirt-cim] [PATCH 15 of 18] Fixes to SettingsDefineState for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196195206 28800 # Node ID eeba8399b981b7539a8103fcf1a196e98476073b # Parent 4036e27b892058dbe0ea944d74932554b53c2c67 Fixes to SettingsDefineState for libcmpiutil API change Signed-off-by: Dan Smith diff -r 4036e27b8920 -r eeba8399b981 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Tue Nov 27 12:26:40 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Tue Nov 27 12:26:46 2007 -0800 @@ -46,7 +46,7 @@ static CMPIInstance *find_rasd(struct in CMPIInstance *inst; for (i = 0; i < list->cur; i++) { - char *id; + const char *id; int ret; inst = list->list[i]; @@ -55,12 +55,8 @@ static CMPIInstance *find_rasd(struct in if (ret != CMPI_RC_OK) continue; - if (STREQ(id, devid)) { - free(id); + if (STREQ(id, devid)) return inst; - } else { - free(id); - } } return NULL; @@ -73,15 +69,14 @@ static CMPIStatus dev_to_rasd(const CMPI CMPIStatus s; CMPIInstance *rasd; struct inst_list rasds; - char *id = NULL; + const char *id = NULL; char *name = NULL; char *devid = NULL; int ret; inst_list_init(&rasds); - id = cu_get_str_path(ref, "DeviceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "DeviceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -109,14 +104,13 @@ static CMPIStatus dev_to_rasd(const CMPI CMSetStatus(&s, CMPI_RC_OK); out: - free(id); free(name); free(devid); return s; } -static CMPIInstance *_get_typed_device(char *id, +static CMPIInstance *_get_typed_device(const char *id, int type, const CMPIObjectPath *ref, CMPIStatus *s) @@ -161,13 +155,12 @@ static CMPIStatus rasd_to_dev(const CMPI { CMPIStatus s; CMPIInstance *dev = NULL; - char *id = NULL; + const char *id = NULL; uint16_t type; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -190,8 +183,6 @@ static CMPIStatus rasd_to_dev(const CMPI CMSetStatus(&s, CMPI_RC_OK); out: - free(id); - return s; } @@ -201,7 +192,7 @@ static CMPIStatus vs_to_vssd(const CMPIO { virConnectPtr conn = NULL; virDomainPtr dom = NULL; - char *name; + const char *name; CMPIInstance *vssd; CMPIStatus s; @@ -209,8 +200,7 @@ static CMPIStatus vs_to_vssd(const CMPIO if (conn == NULL) return s; - name = cu_get_str_path(ref, "Name"); - if (name == NULL) { + if (cu_get_str_path(ref, "Name", &name) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing Name property"); @@ -232,7 +222,6 @@ static CMPIStatus vs_to_vssd(const CMPIO CMSetStatus(&s, CMPI_RC_OK); out: - free(name); virDomainFree(dom); virConnectClose(conn); @@ -244,7 +233,7 @@ static CMPIStatus vssd_to_vs(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *id = NULL; + const char *id = NULL; char *pfx = NULL; char *name = NULL; int ret; @@ -252,8 +241,7 @@ static CMPIStatus vssd_to_vs(const CMPIO CMPIStatus s; CMPIInstance *cs; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -284,7 +272,6 @@ static CMPIStatus vssd_to_vs(const CMPIO out: free(name); free(pfx); - free(id); virConnectClose(conn); From danms at us.ibm.com Tue Nov 27 19:28:31 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:31 -0700 Subject: [Libvirt-cim] [PATCH 05 of 18] Fixes to RASD for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196194946 28800 # Node ID bf7fc8b2c3b68b409052757853b450002bb7e1da # Parent 64da04a35e65ed87ee6bd144cdbf5a9d8efd9383 Fixes to RASD for libcmpiutil API change Signed-off-by: Dan Smith diff -r 64da04a35e65 -r bf7fc8b2c3b6 src/Virt_RASD.c --- a/src/Virt_RASD.c Tue Nov 27 12:21:52 2007 -0800 +++ b/src/Virt_RASD.c Tue Nov 27 12:22:26 2007 -0800 @@ -247,11 +247,10 @@ static CMPIStatus GetInstance(CMPIInstan { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - char *id = NULL; + const char *id = NULL; uint16_t type; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -274,8 +273,6 @@ static CMPIStatus GetInstance(CMPIInstan CMPI_RC_ERR_FAILED, "Unknown instance"); out: - free(id); - return s; } From danms at us.ibm.com Tue Nov 27 19:28:40 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:40 -0700 Subject: [Libvirt-cim] [PATCH 14 of 18] Fixes to VSSDComponent for libcmpiutil API change In-Reply-To: Message-ID: <4036e27b892058dbe0ea.1196195320@theine> # HG changeset patch # User Dan Smith # Date 1196195200 28800 # Node ID 4036e27b892058dbe0ea944d74932554b53c2c67 # Parent 589cad1316a9eb3fe0214cf9515bb72ccaef91f8 Fixes to VSSDComponent for libcmpiutil API change Signed-off-by: Dan Smith diff -r 589cad1316a9 -r 4036e27b8920 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Tue Nov 27 12:25:27 2007 -0800 +++ b/src/Virt_VSSDComponent.c Tue Nov 27 12:26:40 2007 -0800 @@ -117,15 +117,14 @@ static CMPIStatus rasd_to_vssd(const CMP { CMPIStatus s; CMPIInstance *vssd = NULL; - char *id = NULL; + const char *id = NULL; char *host = NULL; char *devid = NULL; int ret; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -145,7 +144,6 @@ static CMPIStatus rasd_to_vssd(const CMP inst_list_add(list, vssd); out: - free(id); free(host); free(devid); From danms at us.ibm.com Tue Nov 27 19:28:34 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:34 -0700 Subject: [Libvirt-cim] [PATCH 08 of 18] Fixes to ELEC for libcmpiutil API change In-Reply-To: Message-ID: <0d30be4ad77c9a476eee.1196195314@theine> # HG changeset patch # User Dan Smith # Date 1196195081 28800 # Node ID 0d30be4ad77c9a476eeee6dcd56c183c7de566a2 # Parent 393868c380f668d3d5e765f6503be3eb3eac0a62 Fixes to ELEC for libcmpiutil API change Signed-off-by: Dan Smith diff -r 393868c380f6 -r 0d30be4ad77c src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Tue Nov 27 12:24:21 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Tue Nov 27 12:24:41 2007 -0800 @@ -108,10 +108,9 @@ CMPIStatus get_ele_cap(const CMPIBroker CMPIStatus s; CMPIObjectPath *op; char *classname = NULL; - char *sys_name = NULL; - - sys_name = cu_get_str_path(ref, "Name"); - if (sys_name == NULL) { + const char *sys_name = NULL; + + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, "Missing key: Name"); @@ -147,7 +146,6 @@ CMPIStatus get_ele_cap(const CMPIBroker out: free(classname); - free(sys_name); return s; } From danms at us.ibm.com Tue Nov 27 19:28:38 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:28:38 -0700 Subject: [Libvirt-cim] [PATCH 12 of 18] Changes to SettingsDefineCapabilities for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196195114 28800 # Node ID fecc81fd400c780ecb496af2ed9ba17001ff2f05 # Parent 0bbb737215af97d0704bbbd6e2526f6aec839228 Changes to SettingsDefineCapabilities for libcmpiutil API change Signed-off-by: Dan Smith diff -r 0bbb737215af -r fecc81fd400c src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Tue Nov 27 12:25:05 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 27 12:25:14 2007 -0800 @@ -499,7 +499,7 @@ static struct sdc_rasd_prop *disk_max(co CMPIStatus *s) { bool ret; - char *inst_id; + const char *inst_id; CMPIrc prop_ret; uint16_t free_space; uint64_t free_64; @@ -507,8 +507,7 @@ static struct sdc_rasd_prop *disk_max(co CMPIInstance *pool_inst; struct sdc_rasd_prop *rasd = NULL; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); @@ -558,7 +557,6 @@ static struct sdc_rasd_prop *disk_max(co } out: - free(inst_id); return rasd; } From danms at us.ibm.com Tue Nov 27 20:32:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 12:32:54 -0800 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474C7DF7.8060808@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 27 Nov 2007 15:28:39 -0500") References: <474C4ED5.2090105@linux.vnet.ibm.com> <474C7DF7.8060808@linux.vnet.ibm.com> Message-ID: <87k5o3l98p.fsf@theine.beaverton.ibm.com> JG> 5. If you have to rework and resend a patch, the commit message JG> should reflect what changed since you last sent the patch. Nobody JG> likes having to diff two diffs. Obviously, I agree with this point :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 27 20:14:49 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 16:14:49 -0400 Subject: [Libvirt-cim] [PATCH] Convert CMSetStatusWithChars calls to cu_statusf, clean up Message-ID: # HG changeset patch # User Jay Gagnon # Date 1196197789 18000 # Node ID d798c4c8a940eeb6d24cdb89eb0bf7141c928e19 # Parent c1c0c6a064474701ec5e743d32819f179553c540 Convert CMSetStatusWithChars calls to cu_statusf, clean up. We use cu_statusf everywhere already, the minimum call syntax is the same (plus printf style formatting for free) and the name is about sixty characters shorter. Also make sure the calls are formatted correctly. Signed-off-by: Jay Gagnon diff -r c1c0c6a06447 -r d798c4c8a940 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Mon Nov 26 10:32:08 2007 -0800 +++ b/libxkutil/misc_util.c Tue Nov 27 16:09:49 2007 -0500 @@ -60,9 +60,9 @@ virConnectPtr connect_by_classname(const uri = cn_to_uri(classname); if (!uri) { - CMSetStatusWithChars(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to generate URI from classname"); + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "Unable to generate URI from classname"); return NULL; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_AllocationCapabilities.c Tue Nov 27 16:09:49 2007 -0500 @@ -51,15 +51,17 @@ CMPIStatus get_alloc_cap(const CMPIBroke NAMESPACE(ref)); if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get ResourceType."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get ResourceType."); goto out; } ret = asprintf(&inst_id, "%hi/%s", type, "0"); if (ret == -1) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); goto out; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_ComputerSystem.c Tue Nov 27 16:09:49 2007 -0500 @@ -446,9 +446,9 @@ static CMPIStatus GetInstance(CMPIInstan if (name == NULL) { CMPIStatus s; - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No domain name specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No domain name specified"); return s; } @@ -492,15 +492,15 @@ static CMPIStatus state_change_enable(vi break; default: printf("Cannot go to enabled state from %i\n", info->state); - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid state transition"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Invalid state transition"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -517,15 +517,15 @@ static CMPIStatus state_change_disable(v break; default: printf("Cannot go to disabled state from %i\n", info->state); - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid state transition"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Invalid state transition"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -541,15 +541,15 @@ static CMPIStatus state_change_pause(vir ret = virDomainSuspend(dom); break; default: - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not running"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not running"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -565,15 +565,15 @@ static CMPIStatus state_change_reboot(vi ret = virDomainReboot(dom, 0); break; default: - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not running"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not running"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -589,15 +589,15 @@ static CMPIStatus state_change_reset(vir ret = domain_reset(dom); break; default: - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not running"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not running"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -617,16 +617,16 @@ static CMPIStatus __state_change(char *n dom = virDomainLookupByName(conn, name); if (dom == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not found"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not found"); goto out; } if (virDomainGetInfo(dom, &info) != 0) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to get current state"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get current state"); goto out; } @@ -670,9 +670,9 @@ static CMPIStatus state_change(CMPIMetho name = cu_get_str_path(reference, "Name"); if (name == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Name key not specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Name key not specified"); goto out; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_Device.c --- a/src/Virt_Device.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_Device.c Tue Nov 27 16:09:49 2007 -0500 @@ -371,9 +371,9 @@ static CMPIStatus enum_devices(const CMP return s; if (!dom_list_devices(conn, reference, &list)) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to list domains"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to list domains"); return s; } @@ -492,9 +492,9 @@ static CMPIStatus get_device(const CMPIO CMReturnInstance(results, inst); CMSetStatus(&s, CMPI_RC_OK); } else { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to get device instance"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get device instance"); } virConnectClose(conn); @@ -531,9 +531,9 @@ static CMPIStatus GetInstance(CMPIInstan if (devid == NULL) { CMPIStatus s; - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No DeviceID specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No DeviceID specified"); return s; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Tue Nov 27 16:09:49 2007 -0500 @@ -67,7 +67,8 @@ static CMPIStatus sys_to_cap(const CMPIO sys_name = cu_get_str_path(ref, "Name"); if (!STREQ(sys_name, host_name)) { - cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, "System '%s' is not a host system.", sys_name); goto out; } @@ -203,8 +204,9 @@ static CMPIStatus pool_to_alloc(const CM inst_id = cu_get_str_path(ref, "InstanceID"); if (inst_id == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID."); goto out; } @@ -216,8 +218,9 @@ static CMPIStatus pool_to_alloc(const CM ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != 1) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get ResourceType."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get ResourceType."); goto out; } CMSetProperty(inst, "ResourceType", &type, CMPI_uint16); diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Tue Nov 27 16:09:49 2007 -0500 @@ -60,9 +60,9 @@ static CMPIStatus elem_instances(const C classname = get_typed_class("Xen", profile->provider_name); if (classname == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Can't assemble classname." ); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't assemble classname." ); goto out; } @@ -72,18 +72,18 @@ static CMPIStatus elem_instances(const C en = CBEnumInstances(_BROKER, info->context , op, NULL, &s); if (en == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Upcall enumInstances to target class failed."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Upcall enumInstances to target class failed."); goto error; } while (CMHasNext(en, &s)) { data = CMGetNext(en, &s); if (CMIsNullObject(data.value.inst)) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to retrieve enumeration entry."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to retrieve enumeration entry."); goto error; } @@ -106,9 +106,9 @@ static CMPIStatus prof_to_elem(const CMP id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No InstanceID specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); goto out; } @@ -139,8 +139,9 @@ static CMPIStatus elem_to_prof(const CMP classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't get class name."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't get class name."); goto out; } @@ -154,8 +155,9 @@ static CMPIStatus elem_to_prof(const CMP NULL, candidate); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't create profile instance."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't create profile instance."); goto error; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Tue Nov 27 16:09:49 2007 -0500 @@ -64,8 +64,9 @@ static CMPIStatus set_inst_properties(co devid = get_fq_devid((char *)sys_name, "0"); if (devid == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get full ID."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get full ID."); goto error1; } @@ -112,34 +113,34 @@ CMPIStatus get_ele_cap(const CMPIBroker sys_name = cu_get_str_path(ref, "Name"); if (sys_name == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Missing key: Name"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Missing key: Name"); goto out; } classname = get_typed_class(CLASSNAME(ref), "EnabledLogicalElementCapabilities"); if (classname == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Invalid class"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Invalid class"); goto out; } op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for ELECapabilities"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Cannot get object path for ELECapabilities"); goto out; } *inst = CMNewInstance(broker, op, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(*inst))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Failed to instantiate HostSystem"); goto out; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_HostSystem.c Tue Nov 27 16:09:49 2007 -0500 @@ -67,25 +67,25 @@ CMPIStatus get_host_cs(const CMPIBroker classname = get_typed_class(CLASSNAME(reference), "HostSystem"); if (classname == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Invalid class"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Invalid class"); goto out; } op = CMNewObjectPath(broker, ns, classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for HostSystem"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Cannot get object path for HostSystem"); goto out; } inst = CMNewInstance(broker, op, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(op))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Failed to instantiate HostSystem"); goto out; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_HostedDependency.c Tue Nov 27 16:09:49 2007 -0500 @@ -66,9 +66,9 @@ static CMPIStatus host_to_vs(const CMPIO if (ret) { CMSetStatus(&s, CMPI_RC_OK); } else { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to get domain list"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to get domain list"); } CMSetStatus(&s, CMPI_RC_OK); diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_HostedResourcePool.c Tue Nov 27 16:09:49 2007 -0500 @@ -71,8 +71,7 @@ static CMPIStatus sys_to_pool(const CMPI if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, - "No such HostSystem instance (%s)", - prop); + "No such HostSystem instance (%s)", prop); return s; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_RegisteredProfile.c Tue Nov 27 16:09:49 2007 -0500 @@ -103,8 +103,9 @@ static CMPIStatus enum_profs(const CMPIO properties, profiles[i]); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't create profile instance."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't create profile instance."); goto out; } @@ -129,9 +130,9 @@ static CMPIStatus get_prof(const CMPIObj id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No InstanceID specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); return s; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Tue Nov 27 16:09:49 2007 -0500 @@ -697,8 +697,9 @@ static CMPIInstance *sdc_rasd_inst(const range = SDC_RANGE_POINT; break; default: - CMSetStatusWithChars(broker, s, CMPI_RC_ERR_FAILED, - "Unsupported sdc_rasd type."); + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "Unsupported sdc_rasd type."); goto out; } @@ -765,8 +766,9 @@ static CMPIStatus sdc_rasds_for_type(con } else { CU_DEBUG("Unsupported type."); - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Unsupported device type."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unsupported device type."); } out: @@ -785,8 +787,9 @@ static CMPIStatus alloc_cap_to_rasd(cons ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != 1) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get ResourceType."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get ResourceType."); goto out; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_VSSD.c Tue Nov 27 16:09:49 2007 -0500 @@ -143,9 +143,9 @@ static CMPIStatus enum_vssd(const CMPIOb count = get_domain_list(conn, &list); if (count < 0) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to enumerate domains"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to enumerate domains"); goto out; } else if (count == 0) { CMSetStatus(&s, CMPI_RC_OK); @@ -229,7 +229,7 @@ static CMPIStatus GetInstance(CMPIInstan if (!parse_instanceid(reference, NULL, &locid)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Invalid InstanceID specified"); + "Invalid InstanceID specified"); return s; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Tue Nov 27 16:09:49 2007 -0500 @@ -60,8 +60,9 @@ static CMPIStatus set_inst_properties(co devid = get_fq_devid((char *)sys_name, "0"); if (devid == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get full ID."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get full ID."); goto out; } CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars); @@ -99,34 +100,34 @@ CMPIStatus get_vsm_cap(const CMPIBroker sys_name = cu_get_str_path(ref, "Name"); if (sys_name == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Missing key: Name"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Missing key: Name"); goto out; } classname = get_typed_class(CLASSNAME(ref), "VirtualSystemManagementCapabilities"); if (classname == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Invalid class"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Invalid class"); goto out; } op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for VSMCapabilities"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Cannot get object path for VSMCapabilities"); goto out; } *inst = CMNewInstance(broker, op, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(*inst))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Failed to instantiate HostSystem"); goto out; } diff -r c1c0c6a06447 -r d798c4c8a940 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Mon Nov 26 10:32:08 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Tue Nov 27 16:09:49 2007 -0500 @@ -108,9 +108,9 @@ static CMPIStatus define_system_parse_ar sys); if (ret) { CU_DEBUG("Unable to parse SystemSettings instance"); - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "SystemSettings parse error"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "SystemSettings parse error"); goto out; } @@ -287,9 +287,9 @@ static CMPIInstance *connect_and_create( dom = virDomainDefineXML(conn, xml); if (dom == NULL) { CU_DEBUG("Failed to define domain from XML"); - CMSetStatusWithChars(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Failed to create domain"); + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to create domain"); return NULL; } @@ -297,9 +297,9 @@ static CMPIInstance *connect_and_create( inst = instance_from_name(_BROKER, conn, (char *)name, ref); if (inst == NULL) { CU_DEBUG("Failed to get new instance"); - CMSetStatusWithChars(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Failed to lookup resulting system"); + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to lookup resulting system"); } virConnectClose(conn); @@ -636,8 +636,7 @@ static CMPIStatus _resource_dynamic(stru if (func(dom, dev) == 0) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Unable to change (%i) device", - action); + "Unable to change (%i) device", action); } else { CMSetStatus(&s, CMPI_RC_OK); } @@ -670,8 +669,7 @@ static CMPIStatus resource_del(struct do else { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Cannot delete resources of type %" PRIu16, - type); + "Cannot delete resources of type %" PRIu16, type); goto out; } @@ -716,8 +714,7 @@ static CMPIStatus resource_add(struct do if ((type == CIM_RASD_TYPE_MEM) || (_list == NULL)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Cannot add resources of type %" PRIu16, - type); + "Cannot add resources of type %" PRIu16, type); goto out; } @@ -727,8 +724,7 @@ static CMPIStatus resource_add(struct do */ cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "[TEMP] Cannot add resources of type %" PRIu16, - type); + "[TEMP] Cannot add resources of type %" PRIu16, type); goto out; } @@ -781,8 +777,7 @@ static CMPIStatus resource_mod(struct do else { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Cannot modify resources of type %" PRIu16, - type); + "Cannot modify resources of type %" PRIu16, type); goto out; } From grendel at linux.vnet.ibm.com Tue Nov 27 21:27:10 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 16:27:10 -0500 Subject: [Libvirt-cim] [PATCH] [CU][RFC] Correct a few API issues In-Reply-To: <256b237ba19f9e178719.1196194807@theine> References: <256b237ba19f9e178719.1196194807@theine> Message-ID: <474C8BAE.7030704@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1196194806 28800 > # Node ID 256b237ba19f9e178719ed657f2b9a8f0d44d433 > # Parent 64e4f6355b52e4b7bcc984ec557610a1fa9a9786 > [CU][RFC] Correct a few API issues > that I think need to be resolved before we snap a release. > > Some of the cu_get_* functions returned values instead of a CMPIrc's > like everything else, so this changes that. Also, return const char *'s > from the broker memory so that the callers don't need to free the result. > > This will require some work in libvirt-cim to make sure the new API is > adhered to properly. If this is okay with people, I'll follow up with a > patch to libvirt-cim to make those changes. Any other discussion about > things that should change in the libcmpiutil API is welcomed. > > Changes from last time: > - Fix cu_get_str_prop() to return a const broker string as well > > Patch set to make associated changes to libvirt-cim to follow... > > Signed-off-by: Dan Smith > > > > CMPIrc cu_get_str_prop(const CMPIInstance *inst, > const char *prop, > - char **target) > + const char **target) > { > CMPIData value; > CMPIStatus s; > @@ -198,8 +211,7 @@ CMPIrc cu_get_str_prop(const CMPIInstanc > if ((prop_val = CMGetCharPtr(value.value.string)) == NULL) > return CMPI_RC_ERROR; > > - if ((*target = strdup(prop_val)) == NULL) > - return CMPI_RC_ERROR; > + *target = prop_val; > > return CMPI_RC_OK; > } The "callers don't need to free the result" part was not immediately obvious to me so I want to make sure I understand it. My guess is that adding the const makes it so that callers can't modify the resulting string, which means that we can just hand them all pointers to the same string, so there is no need to strdup, so they don't have to free? Is that close? -- -Jay From kaitlin at linux.vnet.ibm.com Tue Nov 27 21:39:42 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 13:39:42 -0800 Subject: [Libvirt-cim] [PATCH 0 of 2] Fix problem with EnabledLogicalElementCapabilities EnumInstances. Message-ID: This set of patches fixes the problem where ein/ei on EnabledLogicalElementCapabilities returns a "Missing key: Name" error. From kaitlin at linux.vnet.ibm.com Tue Nov 27 21:39:43 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 13:39:43 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Fix an issue where EnabledLogicalElementCapabilities ein/ei returns an error In-Reply-To: Message-ID: <651039e9392c60f96b6c.1196199583@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1196199118 28800 # Node ID 651039e9392c60f96b6cbaa63f0a239df5357550 # Parent 140613919317633ad4b325b6321809849ecfbd41 Fix an issue where EnabledLogicalElementCapabilities ein/ei returns an error. Enumerating this class currently returns: "Missing key: Name". The problem is that get_ele_cap() expects the ref to have a Name property, which isn't the case on an ein/ei call. This fix makes the get_ele_cap() call more generic by accepting a char * to use in building the InstanceID. Also, the return_ele_cap() function wasn't properly returning an instance for each domain on the system. This fix grabs the domain list and returns an instance accordingly. NOTE: I don't like how I handled the virDomainFree() - not sure how else to do this except for changing goto end to goto out and then looping through the list to free. Signed-off-by: Kaitlin Rupert diff -r 140613919317 -r 651039e9392c src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Wed Nov 21 08:23:33 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Tue Nov 27 13:31:58 2007 -0800 @@ -31,6 +31,7 @@ #include "misc_util.h" #include "device_parsing.h" +#include "cs_util.h" #include "Virt_EnabledLogicalElementCapabilities.h" @@ -103,20 +104,12 @@ static CMPIStatus set_inst_properties(co CMPIStatus get_ele_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, + const char *sys_name, CMPIInstance **inst) { CMPIStatus s; CMPIObjectPath *op; char *classname = NULL; - char *sys_name = NULL; - - sys_name = cu_get_str_path(ref, "Name"); - if (sys_name == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Missing key: Name"); - goto out; - } classname = get_typed_class(CLASSNAME(ref), "EnabledLogicalElementCapabilities"); @@ -147,7 +140,6 @@ CMPIStatus get_ele_cap(const CMPIBroker out: free(classname); - free(sys_name); return s; } @@ -158,16 +150,50 @@ static CMPIStatus return_ele_cap(const C { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - - s = get_ele_cap(_BROKER, ref, &inst); - if (s.rc != CMPI_RC_OK) - goto out; - - if (names_only) - cu_return_instance_name(results, inst); - else - CMReturnInstance(results, inst); + virConnectPtr conn = NULL; + virDomainPtr *list = NULL; + int count; + int i; + const char *name; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + goto out; + + count = get_domain_list(conn, &list); + if (count <= 0) + goto out; + + for (i = 0; i < count; i++) { + name = virDomainGetName(list[i]); + if (name == NULL) { + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get domain names"); + goto end; + } + + s = get_ele_cap(_BROKER, ref, name, &inst); + if (s.rc != CMPI_RC_OK) + goto end; + + if (names_only) + cu_return_instance_name(results, inst); + else + CMReturnInstance(results, inst); + + end: + virDomainFree(list[i]); + + if (s.rc != CMPI_RC_OK) + goto out; + } + out: + free(list); + + virConnectClose(conn); + return s; } diff -r 140613919317 -r 651039e9392c src/Virt_EnabledLogicalElementCapabilities.h --- a/src/Virt_EnabledLogicalElementCapabilities.h Wed Nov 21 08:23:33 2007 -0800 +++ b/src/Virt_EnabledLogicalElementCapabilities.h Tue Nov 27 13:31:58 2007 -0800 @@ -20,6 +20,7 @@ */ CMPIStatus get_ele_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, + const char *sys_name, CMPIInstance **inst); /* * Local Variables: From kaitlin at linux.vnet.ibm.com Tue Nov 27 21:39:44 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 13:39:44 -0800 Subject: [Libvirt-cim] [PATCH 2 of 2] Updated to support changes to get_ele_cap() In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1196199121 28800 # Node ID d9fa7a6eb180e5489209a7b893e40c15ad0f1943 # Parent 651039e9392c60f96b6cbaa63f0a239df5357550 Updated to support changes to get_ele_cap(). get_ele_cap() now takes a char * argument to use for building the InstanceID. The function needs to get the Name from the ref and pass that to get_ele_cap(). This bit of code used to be in get_ele_cap() itself, but get_ele_cap() needs to be more generic. Signed-off-by: Kaitlin Rupert diff -r 651039e9392c -r d9fa7a6eb180 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Tue Nov 27 13:31:58 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Tue Nov 27 13:32:01 2007 -0800 @@ -133,10 +133,22 @@ static CMPIStatus cs_to_cap(const CMPIOb { CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; - - s = get_ele_cap(_BROKER, ref, &inst); + char *sys_name = NULL; + + sys_name = cu_get_str_path(ref, "Name"); + if (sys_name == NULL) { + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing key: Name"); + goto out; + } + + s = get_ele_cap(_BROKER, ref, sys_name, &inst); if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); + + out: + free(sys_name); return s; } From danms at us.ibm.com Tue Nov 27 21:39:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 13:39:30 -0800 Subject: [Libvirt-cim] [PATCH] Convert CMSetStatusWithChars calls to cu_statusf, clean up In-Reply-To: (Jay Gagnon's message of "Tue, 27 Nov 2007 16:14:49 -0400") References: Message-ID: <877ik3l65p.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1196197789 18000 JG> # Node ID d798c4c8a940eeb6d24cdb89eb0bf7141c928e19 JG> # Parent c1c0c6a064474701ec5e743d32819f179553c540 JG> Convert CMSetStatusWithChars calls to cu_statusf, clean up. Sweet! JG> - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, JG> - "Could not get ResourceType."); JG> + cu_statusf(broker, &s, JG> + CMPI_RC_ERR_FAILED, JG> + "Could not get ResourceType."); I know that these are pre-existing error messages, but could I convince you to remove trailing periods from all the error messages? Not only are they inconsistent with the rest of the code, but rather unconventional, I'd say. Looks good otherwise, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 21:49:24 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 13:49:24 -0800 Subject: [Libvirt-cim] [PATCH] [CU][RFC] Correct a few API issues In-Reply-To: <474C8BAE.7030704@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 27 Nov 2007 16:27:10 -0500") References: <256b237ba19f9e178719.1196194807@theine> <474C8BAE.7030704@linux.vnet.ibm.com> Message-ID: <873aurl5p7.fsf@theine.beaverton.ibm.com> JG> My guess is that adding the const makes it so that callers can't JG> modify the resulting string, Right, which makes free() choke on it, thus indicating all the free()'s that I needed to remove in this case :) JG> which means that we can just hand them all pointers to the same JG> string, so there is no need to strdup, so they don't have to free? No. The const doesn't really have anything to do with not needing to free() it. The reason it doesn't need to be free()'d is because it's memory from a broker-managed object, which will be freed when the current provider returns back to the CIMOM. The same reason you don't need to free() a CMPIInstance or CMPIObjectPath. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 27 21:54:39 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 16:54:39 -0500 Subject: [Libvirt-cim] [PATCH 00 of 18] Updates for libcmpiutil API change In-Reply-To: References: Message-ID: <474C921F.2030404@linux.vnet.ibm.com> Dan Smith wrote: > This refactors all of the necessary functions in libvirt-cim for the new > API. Things only got cleaner, I think. I also found a substantial number > of memory leaks in the process, which are fundamentally fixed by the new > API which I think is a validation of it as "the right thing to do". All > required changes should have been easily spotted by the compiler, but some > testing would be good. > > Tip: To find the leaks, note every time we convert a variable from > char * to const char * and don't remove a subsequent free() call :) > > I read through as many as I could force myself to, and they all look fine. Once my build machine is back up I'll try to test a few of mine to make sure they work like they used to. -- -Jay From grendel at linux.vnet.ibm.com Tue Nov 27 22:09:23 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 17:09:23 -0500 Subject: [Libvirt-cim] [PATCH] Convert CMSetStatusWithChars calls to cu_statusf, clean up In-Reply-To: <877ik3l65p.fsf@theine.beaverton.ibm.com> References: <877ik3l65p.fsf@theine.beaverton.ibm.com> Message-ID: <474C9593.50906@linux.vnet.ibm.com> Dan Smith wrote: > Sweet! > > JG> - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, > JG> - "Could not get ResourceType."); > JG> + cu_statusf(broker, &s, > JG> + CMPI_RC_ERR_FAILED, > JG> + "Could not get ResourceType."); > > I know that these are pre-existing error messages, but could I > convince you to remove trailing periods from all the error messages? > Not only are they inconsistent with the rest of the code, but rather > unconventional, I'd say. > Yup, can do. I had always gone back and forth on the issue when I typed stuff, and I guess it shows. Answering it either way is fine by me. -- -Jay From danms at us.ibm.com Tue Nov 27 21:39:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 13:39:30 -0800 Subject: [Libvirt-cim] [PATCH] Convert CMSetStatusWithChars calls to cu_statusf, clean up In-Reply-To: (Jay Gagnon's message of "Tue, 27 Nov 2007 16:14:49 -0400") References: Message-ID: <877ik3l65p.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1196197789 18000 JG> # Node ID d798c4c8a940eeb6d24cdb89eb0bf7141c928e19 JG> # Parent c1c0c6a064474701ec5e743d32819f179553c540 JG> Convert CMSetStatusWithChars calls to cu_statusf, clean up. Sweet! JG> - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, JG> - "Could not get ResourceType."); JG> + cu_statusf(broker, &s, JG> + CMPI_RC_ERR_FAILED, JG> + "Could not get ResourceType."); I know that these are pre-existing error messages, but could I convince you to remove trailing periods from all the error messages? Not only are they inconsistent with the rest of the code, but rather unconventional, I'd say. Looks good otherwise, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Tue Nov 27 20:29:47 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Tue, 27 Nov 2007 16:29:47 -0400 Subject: [Libvirt-cim] [PATCH] [CU] Convert to cu_statusf Message-ID: <7b6ed8beebcf7c15cc28.1196198987@wulfgar> # HG changeset patch # User Jay Gagnon # Date 1196198953 18000 # Node ID 7b6ed8beebcf7c15cc28f9492baa0d4ebdfb76f8 # Parent c57cd3b49b6109110331ee64ea3a629c16ff4423 [CU] Convert to cu_statusf. Signed-off-by: Jay Gagnon diff -r c57cd3b49b61 -r 7b6ed8beebcf std_invokemethod.c --- a/std_invokemethod.c Tue Nov 27 12:20:06 2007 -0800 +++ b/std_invokemethod.c Tue Nov 27 16:29:13 2007 -0500 @@ -100,9 +100,9 @@ CMPIStatus _std_invokemethod(CMPIMethodM } if (h == NULL) { - CMSetStatusWithChars(ctx->broker, &s, - CMPI_RC_ERR_FAILED, - "Unknown Method"); + cu_statusf(ctx->broker, &s, + CMPI_RC_ERR_FAILED, + "Unknown Method"); goto exit; } From kaitlin at linux.vnet.ibm.com Tue Nov 27 23:18:45 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Tue, 27 Nov 2007 15:18:45 -0800 Subject: [Libvirt-cim] [PATCH] [CU] Convert to cu_statusf In-Reply-To: <7b6ed8beebcf7c15cc28.1196198987@wulfgar> References: <7b6ed8beebcf7c15cc28.1196198987@wulfgar> Message-ID: <474CA5D5.1080205@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1196198953 18000 > # Node ID 7b6ed8beebcf7c15cc28f9492baa0d4ebdfb76f8 > # Parent c57cd3b49b6109110331ee64ea3a629c16ff4423 > [CU] Convert to cu_statusf. > I think this one is ready to apply. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Tue Nov 27 23:31:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 15:31:54 -0800 Subject: [Libvirt-cim] [PATCH] Convert CMSetStatusWithChars calls to cu_statusf, clean up In-Reply-To: <474C9593.50906@linux.vnet.ibm.com> (Jay Gagnon's message of "Tue, 27 Nov 2007 17:09:23 -0500") References: <877ik3l65p.fsf@theine.beaverton.ibm.com> <474C9593.50906@linux.vnet.ibm.com> Message-ID: <87prxvi7th.fsf@theine.beaverton.ibm.com> JG> Yup, can do. I had always gone back and forth on the issue when I JG> typed stuff, and I guess it shows. Answering it either way is JG> fine by me. Well, the example I would use to justify this is: char *err = get_err_msg() printf("Error occurred (%s)") would print: Error occurred (No such file or directory.) Which just looks dumb :) I think perror() wins the precedent here, anyway, so lets remove the periods :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 23:44:33 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 15:44:33 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Fix an issue where EnabledLogicalElementCapabilities ein/ei returns an error In-Reply-To: <651039e9392c60f96b6c.1196199583@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Tue, 27 Nov 2007 13:39:43 -0800") References: <651039e9392c60f96b6c.1196199583@elm3b41.beaverton.ibm.com> Message-ID: <87ejebi78e.fsf@theine.beaverton.ibm.com> KR> + count = get_domain_list(conn, &list); KR> + if (count <= 0) KR> + goto out; You create the list before the for() loop, KR> + KR> + for (i = 0; i < count; i++) { KR> + name = virDomainGetName(list[i]); KR> + if (name == NULL) { KR> + cu_statusf(_BROKER, &s, KR> + CMPI_RC_ERR_FAILED, KR> + "Unable to get domain names"); KR> + goto end; KR> + } KR> + KR> + s = get_ele_cap(_BROKER, ref, name, &inst); KR> + if (s.rc != CMPI_RC_OK) KR> + goto end; KR> + KR> + if (names_only) KR> + cu_return_instance_name(results, inst); KR> + else KR> + CMReturnInstance(results, inst); KR> + KR> + end: KR> + virDomainFree(list[i]); KR> + KR> + if (s.rc != CMPI_RC_OK) KR> + goto out; But then clean it up every time through the loop, which should be causing a crash on the 1..n iterations. If you're not seeing a crash, I imagine you're getting lucky. virDomainFree() protects against a double-free with some magic, I think, but using list after the first time through here is broken. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Tue Nov 27 23:57:10 2007 From: danms at us.ibm.com (Dan Smith) Date: Tue, 27 Nov 2007 15:57:10 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Fix an issue where EnabledLogicalElementCapabilities ein/ei returns an error In-Reply-To: <87ejebi78e.fsf@theine.beaverton.ibm.com> (Dan Smith's message of "Tue, 27 Nov 2007 15:44:33 -0800") References: <651039e9392c60f96b6c.1196199583@elm3b41.beaverton.ibm.com> <87ejebi78e.fsf@theine.beaverton.ibm.com> Message-ID: <878x4ji6nd.fsf@theine.beaverton.ibm.com> DS> But then clean it up every time through the loop, which should be DS> causing a crash on the 1..n iterations. If you're not seeing a DS> crash, I imagine you're getting lucky. virDomainFree() protects DS> against a double-free with some magic, I think, but using list DS> after the first time through here is broken. Okay, that was just dumb of me. I took something in your commit message and inferred code from it without reading it carefully. What you're doing is correct, and it's how we do it elsewhere in the providers. My mistake :) -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From veillard at redhat.com Wed Nov 28 09:08:10 2007 From: veillard at redhat.com (Daniel Veillard) Date: Wed, 28 Nov 2007 04:08:10 -0500 Subject: [Libvirt-cim] [PATCH 00 of 18] Updates for libcmpiutil API change In-Reply-To: References: Message-ID: <20071128090809.GA7777@redhat.com> On Tue, Nov 27, 2007 at 12:28:26PM -0700, Dan Smith wrote: > This refactors all of the necessary functions in libvirt-cim for the new > API. Things only got cleaner, I think. I also found a substantial number > of memory leaks in the process, which are fundamentally fixed by the new > API which I think is a validation of it as "the right thing to do". All > required changes should have been easily spotted by the compiler, but some > testing would be good. > > Tip: To find the leaks, note every time we convert a variable from > char * to const char * and don't remove a subsequent free() call :) Hum, for normal code we usually rely on valgrind to find leaks in the code, for example by instrumenting test program using the code as part of soem regression tests, but with the way CIM providers are used it looks harder to do this. Or would it be possible to design a minimal C(++) program loading the /usr/lib*/cmpi/ shared libraries exercising them locally ? Maybe this exists already, an in general how can we design regression tests for libvirt-cim sounds something worth spending time on :-) Ideas, opinion, or tools pointer anyone ? Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From heidieck at linux.vnet.ibm.com Wed Nov 28 09:08:53 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:08:53 +0100 Subject: [Libvirt-cim] [PATCH 1 of 3] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: <474C3D9E.1050305@linux.vnet.ibm.com> References: <474C3D9E.1050305@linux.vnet.ibm.com> Message-ID: <474D3025.3020102@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> + >> + instance = get_typed_instance(broker, >> + pfx_from_conn(conn), >> + "RegisteredProfile", >> + namespace); >> + >> + if (instance == NULL) { >> + CMSetStatusWithChars(broker, &s, >> + CMPI_RC_ERR_FAILED, >> + "Can't create HostSystem >> instance."); >> goto out; >> > I think the return message is incorrect here. You're creating > attempting to create a RegisteredProfile instance, not a HostSystem > instance. > very good eyes and a very good catch :) ... thanks ... Heidi -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 08:44:05 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:44:05 +0200 Subject: [Libvirt-cim] [PATCH 0 of 4] #3 - Fixes to RegisteredProfile and ECTP depending on connect_by_classname approach Message-ID: -ixes duplicates of RegisteredProfile, adopt changes to RegisteredProfile to association ECTP - fix hypervisor prefix for ECTP; remove error label and let label out do all the free() stuff From heidieck at linux.vnet.ibm.com Wed Nov 28 08:44:06 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:44:06 +0200 Subject: [Libvirt-cim] [PATCH 1 of 4] Enumeration of RegisteredProfile class is returning wrong instances In-Reply-To: Message-ID: <82a65502cfb3814efe40.1196243046@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196240875 -3600 # Node ID 82a65502cfb3814efe409879675f486d6f282c7d # Parent dca4cb9c22da97bfef6c2771bf082efbd6d32bc4 Enumeration of RegisteredProfile class is returning wrong instances Signed-off-by: Heidi Eckhart diff -r dca4cb9c22da -r 82a65502cfb3 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Tue Nov 27 10:34:13 2007 +0100 +++ b/src/Virt_RegisteredProfile.c Wed Nov 28 10:07:55 2007 +0100 @@ -43,25 +43,23 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *reg_prof_instance(const CMPIBroker *broker, const char *namespace, const char **properties, + virConnectPtr conn, struct reg_prof *profile) { CMPIStatus s = {CMPI_RC_OK, NULL}; - CMPIObjectPath *op; CMPIInstance *instance = NULL; - char *classname; - - classname = get_typed_class("Xen", "RegisteredProfile"); - if (classname == NULL) { + + instance = get_typed_instance(broker, + pfx_from_conn(conn), + "RegisteredProfile", + namespace); + + if (instance == NULL) { + CMSetStatusWithChars(broker, &s, + CMPI_RC_ERR_FAILED, + "Can't create RegisteredProfile instance."); goto out; } - - op = CMNewObjectPath(broker, namespace, classname, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; - - instance = CMNewInstance(broker, op, &s); - if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto out; if (properties) { s = CMSetPropertyFilter(instance, properties, NULL); @@ -83,8 +81,6 @@ CMPIInstance *reg_prof_instance(const CM (CMPIValue *)profile->reg_version, CMPI_chars); out: - free(classname); - return instance; } @@ -95,12 +91,18 @@ static CMPIStatus enum_profs(const CMPIO { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + virConnectPtr conn = NULL; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; for (i = 0; profiles[i] != NULL; i++) { instance = reg_prof_instance(_BROKER, NAMESPACE(ref), - properties, + properties, + conn, profiles[i]); if (instance == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -115,6 +117,8 @@ static CMPIStatus enum_profs(const CMPIO } out: + virConnectClose(conn); + return s; } @@ -124,15 +128,20 @@ static CMPIStatus get_prof(const CMPIObj { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance = NULL; + virConnectPtr conn = NULL; char* id; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); - return s; + goto out; } for (i = 0; profiles[i] != NULL; i++) { @@ -140,6 +149,7 @@ static CMPIStatus get_prof(const CMPIObj instance = reg_prof_instance(_BROKER, NAMESPACE(ref), properties, + conn, profiles[i]); break; } @@ -150,8 +160,10 @@ static CMPIStatus get_prof(const CMPIObj else CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); - free(id); + + out: + virConnectClose(conn); return s; } diff -r dca4cb9c22da -r 82a65502cfb3 src/Virt_RegisteredProfile.h --- a/src/Virt_RegisteredProfile.h Tue Nov 27 10:34:13 2007 +0100 +++ b/src/Virt_RegisteredProfile.h Wed Nov 28 10:07:55 2007 +0100 @@ -24,6 +24,7 @@ CMPIInstance *reg_prof_instance(const CM CMPIInstance *reg_prof_instance(const CMPIBroker *broker, const char *namespace, const char **properties, + virConnectPtr conn, struct reg_prof *profile); #endif From heidieck at linux.vnet.ibm.com Wed Nov 28 08:44:07 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:44:07 +0200 Subject: [Libvirt-cim] [PATCH 2 of 4] Adoption of changes to RegisteredProfile In-Reply-To: Message-ID: <99b7a3180bca444d3670.1196243047@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196242330 -3600 # Node ID 99b7a3180bca444d3670a9f6295e47a920b1da11 # Parent 82a65502cfb3814efe409879675f486d6f282c7d Adoption of changes to RegisteredProfile Signed-off-by: Heidi Eckhart diff -r 82a65502cfb3 -r 99b7a3180bca src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:07:55 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:32:10 2007 +0100 @@ -133,9 +133,14 @@ static CMPIStatus elem_to_prof(const CMP { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance; + virConnectPtr conn = NULL; char *classname; struct reg_prof *candidate; int i; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { @@ -151,10 +156,12 @@ static CMPIStatus elem_to_prof(const CMP instance = reg_prof_instance(_BROKER, "/root/interop", - NULL, + NULL, + conn, candidate); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, + CMSetStatusWithChars(_BROKER, &s, + CMPI_RC_ERR_FAILED, "Can't create profile instance."); goto error; } @@ -165,6 +172,8 @@ static CMPIStatus elem_to_prof(const CMP error: free(classname); out: + virConnectClose(conn); + return s; } From heidieck at linux.vnet.ibm.com Wed Nov 28 08:44:08 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:44:08 +0200 Subject: [Libvirt-cim] [PATCH 3 of 4] Fix class prefix to depend on established hypervisor connection In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196242413 -3600 # Node ID d86ff33c049964d91fe8b800e5562f178b3cf4a0 # Parent 99b7a3180bca444d3670a9f6295e47a920b1da11 Fix class prefix to depend on established hypervisor connection Signed-off-by: Heidi Eckhart diff -r 99b7a3180bca -r d86ff33c0499 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:32:10 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:33:33 2007 +0100 @@ -50,7 +50,8 @@ static CMPIStatus elem_instances(const C static CMPIStatus elem_instances(const CMPIObjectPath *ref, struct std_assoc_info *info, struct inst_list *list, - struct reg_prof *profile) + struct reg_prof *profile, + virConnectPtr conn) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIObjectPath *op; @@ -58,7 +59,8 @@ static CMPIStatus elem_instances(const C CMPIData data ; char *classname; - classname = get_typed_class("Xen", profile->provider_name); + classname = get_typed_class(pfx_from_conn(conn), + profile->provider_name); if (classname == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, @@ -101,9 +103,14 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; + virConnectPtr conn = NULL; char *id; int i; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return s; + id = cu_get_str_path(ref, "InstanceID"); if (id == NULL) { CMSetStatusWithChars(_BROKER, &s, @@ -114,7 +121,8 @@ static CMPIStatus prof_to_elem(const CMP for (i = 0; profiles[i] != NULL; i++) { if (STREQ(id, profiles[i]->reg_id)) { - s = elem_instances(ref, info, list, profiles[i]); + s = elem_instances(ref, info, list, + profiles[i], conn); if ((s.rc != CMPI_RC_OK)) goto error; break; @@ -124,6 +132,8 @@ static CMPIStatus prof_to_elem(const CMP error: free(id); out: + virConnectClose(conn); + return s; } @@ -182,10 +192,16 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *assoc_inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *assoc_inst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(source_op), &s); + if (conn == NULL) + return NULL; assoc_inst = get_typed_instance(_BROKER, - "Xen", + pfx_from_conn(conn), "ElementConformsToProfile", NAMESPACE(source_op)); @@ -198,6 +214,8 @@ static CMPIInstance *make_ref(const CMPI CMSetProperty(assoc_inst, assoc->target_prop, (CMPIValue *)&(target_op), CMPI_ref); } + + virConnectClose(conn); return assoc_inst; } From heidieck at linux.vnet.ibm.com Wed Nov 28 08:44:09 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:44:09 +0200 Subject: [Libvirt-cim] [PATCH 4 of 4] Housekeeping of label error to ECTP In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196242630 -3600 # Node ID ebb86619d5ca80ad7815f9d70d2c8a87698a5f0f # Parent d86ff33c049964d91fe8b800e5562f178b3cf4a0 Housekeeping of label error to ECTP Removed labels error and let label out do all the free() stuff Signed-off-by: Heidi Eckhart diff -r d86ff33c0499 -r ebb86619d5ca src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:33:33 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 10:37:10 2007 +0100 @@ -70,14 +70,14 @@ static CMPIStatus elem_instances(const C op = CMNewObjectPath(_BROKER, CIM_VIRT_NS, classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) - goto error; + goto out; en = CBEnumInstances(_BROKER, info->context , op, NULL, &s); if (en == NULL) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Upcall enumInstances to target class failed."); - goto error; + goto out; } while (CMHasNext(en, &s)) { @@ -86,15 +86,15 @@ static CMPIStatus elem_instances(const C CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Failed to retrieve enumeration entry."); - goto error; + goto out; } inst_list_add(list, data.value.inst); } - error: + out: free(classname); - out: + return s; } @@ -124,14 +124,13 @@ static CMPIStatus prof_to_elem(const CMP s = elem_instances(ref, info, list, profiles[i], conn); if ((s.rc != CMPI_RC_OK)) - goto error; + goto out; break; } } - error: + out: free(id); - out: virConnectClose(conn); return s; @@ -173,15 +172,14 @@ static CMPIStatus elem_to_prof(const CMP CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Can't create profile instance."); - goto error; + goto out; } inst_list_add(list, instance); } - - error: + + out: free(classname); - out: virConnectClose(conn); return s; From heidieck at linux.vnet.ibm.com Wed Nov 28 09:49:10 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:49:10 +0100 Subject: [Libvirt-cim] [PATCH 2 of 3] Adoption of changes to RegisteredProfile In-Reply-To: <474C7C9A.3070908@linux.vnet.ibm.com> References: <690413b4aef454d03ce3.1196158115@localhost.localdomain> <474C44A4.3010207@linux.vnet.ibm.com> <87fxyrod42.fsf@theine.beaverton.ibm.com> <474C7C9A.3070908@linux.vnet.ibm.com> Message-ID: <474D3996.3000708@linux.vnet.ibm.com> Jay Gagnon wrote: > Dan Smith wrote: > >> JG> Paying more attention to how we free things now that we know >> JG> virConnectClose is fine when given a NULL, wouldn't the same hold >> JG> for classname? >> >> Yes. Most of the stuff I write free()'s all the dynamic strings on >> exit (error or not) to make sure we don't skip one due to a broken >> exit sequence. >> This is now fixed in an additional patch to this series for association ECTP. Nothing like that found in RegisteredProfile. As I saw that jay has already created a patch for the Status messages, I haven't touched this part - but fixed the issue Kaitlin found. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 09:57:51 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 10:57:51 +0100 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <873auro7t3.fsf@theine.beaverton.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> <877ik3o8nj.fsf@theine.beaverton.ibm.com> <474C6203.3040208@linux.vnet.ibm.com> <873auro7t3.fsf@theine.beaverton.ibm.com> Message-ID: <474D3B9F.2040802@linux.vnet.ibm.com> Dan Smith wrote: > JG> I figured this one would be the most likely to generate > JG> discussion. I took a couple of stabs at the right suffix while I > JG> was writing this, then just decided to go with something and let > JG> everyone throw ideas out. Maybe we could go with something more > JG> succinct like just "#x". So "AllocationCapabilities EnumInstance" > JG> followed by "AllocationCapabilities EnumInstance #2" sort of > JG> thing. > > Sure. I'd prefer a shorter prefix, so just " #x" is fine with me. Agreed, a short prefix is a very good eye catcher. I'd prefer to have the prefix at the beginning of the message. The subjects are sometimes that long, that they are not completely shown in the email client's preview pane. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 10:11:45 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 11:11:45 +0100 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474C4ED5.2090105@linux.vnet.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> Message-ID: <474D3EE1.1060101@linux.vnet.ibm.com> Jay Gagnon wrote: > 4. Before you type, "hg email," you should always type, "hg export," > first. Review your patch. Does it have any typos in the comments? Did > you accidentally include an irrelevant change? Is your commit message > still accurate and useful? > What am I doing wrong, if "hg export" returns with: abort: export requires at least one changeset I'd like to suggest to add another thing to section 1 6. If a discussion for a certain patch (set) identified an issue, that will be fixed in a separate patch (set) and by another developer, but the second patch (set) will touch same code parts as the first patch (set), its recommended to wait with the second one until the first patch (set) was finished and accepted. This avoids reworking patches because of problems during apply. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 10:18:27 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 12:18:27 +0200 Subject: [Libvirt-cim] [PATCH 0 of 2] #2 - Check for matching hypervisor prefixes Message-ID: - renamed helper function to match_hypervisor_prefix to become clearer on the intent - updated ECTP to make use of match_hypervisor_prefix() function If this approach is ok, I can coop up a patch set for all association classes. From heidieck at linux.vnet.ibm.com Wed Nov 28 10:18:28 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 12:18:28 +0200 Subject: [Libvirt-cim] [PATCH 1 of 2] Add helper function to check for matching hypervisor class prefixes In-Reply-To: Message-ID: <96c97073edc357edb1ff.1196248708@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196245629 -3600 # Node ID 96c97073edc357edb1ff554d8c92207e644998c5 # Parent ebb86619d5ca80ad7815f9d70d2c8a87698a5f0f Add helper function to check for matching hypervisor class prefixes The class prefixes need to be checked for compliance, as a request for KVM_RegisteredProfile with Xen_ECTP as assoc does not return any instances. Signed-off-by: Heidi Eckhart diff -r ebb86619d5ca -r 96c97073edc3 libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Nov 28 10:37:10 2007 +0100 +++ b/libxkutil/misc_util.c Wed Nov 28 11:27:09 2007 +0100 @@ -33,6 +33,7 @@ #include "cmpimacs.h" #include "libcmpiutil.h" +#include "std_association.h" #include "misc_util.h" #include "cs_util.h" @@ -304,6 +305,41 @@ bool provider_is_responsible(const CMPIB free(pfx); return rc; } + +bool match_hypervisor_prefix(const CMPIObjectPath *reference, + struct std_assoc_info *info) +{ + char *ref_pfx = NULL; + char *pfx = NULL; + bool rc = true; + + ref_pfx = class_prefix_name(CLASSNAME(reference)); + + if (info->assoc_class) { + pfx = class_prefix_name(info->assoc_class); + + if (!STREQC(ref_pfx, pfx) && + !STREQC("CIM", pfx)) + rc = false; + + free(pfx); + } + + if (info->result_class) { + pfx = class_prefix_name(info->result_class); + + if (!STREQC(ref_pfx, pfx) && + !STREQC("CIM", pfx)) + rc = false; + + free(pfx); + } + + free(ref_pfx); + return rc; +} + + bool domain_online(virDomainPtr dom) { diff -r ebb86619d5ca -r 96c97073edc3 libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Nov 28 10:37:10 2007 +0100 +++ b/libxkutil/misc_util.h Wed Nov 28 11:27:09 2007 +0100 @@ -32,6 +32,7 @@ #include "cmpimacs.h" #include +#include /* Check if the provider is reponsible for the given class: * e.g. Xen is running on the system and KVM_... is asked for, @@ -105,6 +106,9 @@ bool libvirt_cim_init(void); #endif +bool match_hypervisor_prefix(const CMPIObjectPath *reference, + struct std_assoc_info *info); + /* * Local Variables: * mode: C From heidieck at linux.vnet.ibm.com Wed Nov 28 10:18:29 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 12:18:29 +0200 Subject: [Libvirt-cim] [PATCH 2 of 2] ECTP: make use of function to check for hypervisor prefixes In-Reply-To: Message-ID: <89962d7f2e1b440d1ca5.1196248709@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196246395 -3600 # Node ID 89962d7f2e1b440d1ca525a9ec40a6c76cdc0e58 # Parent 96c97073edc357edb1ff554d8c92207e644998c5 ECTP: make use of function to check for hypervisor prefixes Signed-off-by: Heidi Eckhart diff -r 96c97073edc3 -r 89962d7f2e1b src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:27:09 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:39:55 2007 +0100 @@ -107,6 +107,9 @@ static CMPIStatus prof_to_elem(const CMP char *id; int i; + if (!match_hypervisor_prefix(ref, info)) + return s; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) return s; @@ -146,6 +149,9 @@ static CMPIStatus elem_to_prof(const CMP char *classname; struct reg_prof *candidate; int i; + + if (!match_hypervisor_prefix(ref, info)) + return s; conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); if (conn == NULL) From heidieck at linux.vnet.ibm.com Wed Nov 28 11:33:16 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 12:33:16 +0100 Subject: [Libvirt-cim] [PATCH 00 of 18] Updates for libcmpiutil API change In-Reply-To: <20071128090809.GA7777@redhat.com> References: <20071128090809.GA7777@redhat.com> Message-ID: <474D51FC.5060209@linux.vnet.ibm.com> Daniel Veillard wrote: > On Tue, Nov 27, 2007 at 12:28:26PM -0700, Dan Smith wrote: > >> This refactors all of the necessary functions in libvirt-cim for the new >> API. Things only got cleaner, I think. I also found a substantial number >> of memory leaks in the process, which are fundamentally fixed by the new >> API which I think is a validation of it as "the right thing to do". All >> required changes should have been easily spotted by the compiler, but some >> testing would be good. >> >> Tip: To find the leaks, note every time we convert a variable from >> char * to const char * and don't remove a subsequent free() call :) >> > > Hum, for normal code we usually rely on valgrind to find leaks in > the code, for example by instrumenting test program using the code > as part of soem regression tests, but with the way CIM providers are > used it looks harder to do this. > You can start the CIMOM with valgrind (e.g. "valgrind cimserver" or "valgrind sfcbd"), but the output is really hard to read. > Or would it be possible to design a minimal C(++) program loading > the /usr/lib*/cmpi/ shared libraries exercising them locally ? > Mhh, I suppose in that case we would write another tiny CIMOM. > Maybe this exists already, an in general how can we design regression > tests for libvirt-cim sounds something worth spending time on :-) > absolutely > Ideas, opinion, or tools pointer anyone ? > > Daniel > > > -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 12:27:49 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 13:27:49 +0100 Subject: [Libvirt-cim] [PATCH 0 of 2] Fix problem with EnabledLogicalElementCapabilities EnumInstances. In-Reply-To: References: Message-ID: <474D5EC5.2080705@linux.vnet.ibm.com> Kaitlin Rupert wrote: > This set of patches fixes the problem where ein/ei on EnabledLogicalElementCapabilities returns a "Missing key: Name" error. > works for me :) ... +1 -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 13:17:41 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 14:17:41 +0100 Subject: [Libvirt-cim] [PATCH 06 of 18] Fixes to VSMS for libcmpiutil API change In-Reply-To: <6e84b22c2d0251897d1f.1196195312@theine> References: <6e84b22c2d0251897d1f.1196195312@theine> Message-ID: <474D6A75.3080301@linux.vnet.ibm.com> Dan Smith wrote: > # HG changeset patch > # User Dan Smith > # Date 1196195058 28800 > # Node ID 6e84b22c2d0251897d1f12a97fc79a0cfa2c0db9 > # Parent bf7fc8b2c3b68b409052757853b450002bb7e1da > Fixes to VSMS for libcmpiutil API change > > Changed the name of a variable to avoid having to break a line in an ugly > way. If this is too much of a violation of the recently defined policy, > I'll changed it :) no problem ;) ... +1 -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From danms at us.ibm.com Wed Nov 28 14:35:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 06:35:15 -0800 Subject: [Libvirt-cim] [PATCH 00 of 18] Updates for libcmpiutil API change In-Reply-To: <20071128090809.GA7777@redhat.com> (Daniel Veillard's message of "Wed, 28 Nov 2007 04:08:10 -0500") References: <20071128090809.GA7777@redhat.com> Message-ID: <87d4tuh1zw.fsf@theine.beaverton.ibm.com> DV> Hum, for normal code we usually rely on valgrind to find leaks in DV> the code, for example by instrumenting test program using the code DV> as part of soem regression tests, but with the way CIM providers DV> are used it looks harder to do this. Right, *much* harder. DV> Or would it be possible to design a minimal C(++) program loading DV> the /usr/lib*/cmpi/ shared libraries exercising them locally ? There is a *ton* of infrastructure that has to be in place to run the providers, which I'm not sure is worth implementing. DV> Maybe this exists already, an in general how can we design DV> regression tests for libvirt-cim sounds something worth spending DV> time on :-) For the most part, I think we've been quite good about this kind of thing. Keeping functions small and using CIMOM-managed memory where we can helps us avoid these types of issues. Maybe we could spend some time running a CIMOM under valgrind to see if we can get some suppression filters tweaked to make the output reasonable. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Nov 28 14:40:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 06:40:09 -0800 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474D3EE1.1060101@linux.vnet.ibm.com> (Heidi Eckhart's message of "Wed, 28 Nov 2007 11:11:45 +0100") References: <474C4ED5.2090105@linux.vnet.ibm.com> <474D3EE1.1060101@linux.vnet.ibm.com> Message-ID: <878x4ih1rq.fsf@theine.beaverton.ibm.com> HE> What am I doing wrong, if "hg export" returns with: HE> abort: export requires at least one changeset The patch must be applied before you can export it. You can also just do "less .hg/patches/foo" to see the patch if it's not applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From grendel at linux.vnet.ibm.com Wed Nov 28 15:19:19 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Wed, 28 Nov 2007 10:19:19 -0500 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <878x4ih1rq.fsf@theine.beaverton.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> <474D3EE1.1060101@linux.vnet.ibm.com> <878x4ih1rq.fsf@theine.beaverton.ibm.com> Message-ID: <474D86F7.7090104@linux.vnet.ibm.com> Dan Smith wrote: > HE> What am I doing wrong, if "hg export" returns with: > HE> abort: export requires at least one changeset > > The patch must be applied before you can export it. You can also just > do "less .hg/patches/foo" to see the patch if it's not applied. > > > I think I was unclear. Typing "hg export" or "hg email" alone will not do anything; both require a patch name for their argument. In other words, if your patch is named alloc_cap_fix, type "hg export alloc_cap_fix" to check it over, then "hg email alloc_cap_fix" to email it. -- -Jay From kaitlin at linux.vnet.ibm.com Wed Nov 28 16:21:24 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 08:21:24 -0800 Subject: [Libvirt-cim] Best practices for patchsets In-Reply-To: <474D3B9F.2040802@linux.vnet.ibm.com> References: <474C4ED5.2090105@linux.vnet.ibm.com> <877ik3o8nj.fsf@theine.beaverton.ibm.com> <474C6203.3040208@linux.vnet.ibm.com> <873auro7t3.fsf@theine.beaverton.ibm.com> <474D3B9F.2040802@linux.vnet.ibm.com> Message-ID: <474D9584.9060009@linux.vnet.ibm.com> Heidi Eckhart wrote: > Dan Smith wrote: >> JG> I figured this one would be the most likely to generate >> JG> discussion. I took a couple of stabs at the right suffix while I >> JG> was writing this, then just decided to go with something and let >> JG> everyone throw ideas out. Maybe we could go with something more >> JG> succinct like just "#x". So "AllocationCapabilities EnumInstance" >> JG> followed by "AllocationCapabilities EnumInstance #2" sort of >> JG> thing. >> >> Sure. I'd prefer a shorter prefix, so just " #x" is fine with me. > Agreed, a short prefix is a very good eye catcher. I'd prefer to have > the prefix at the beginning of the message. The subjects are sometimes > that long, that they are not completely shown in the email client's > preview pane. > I think having the revision number at the beginning is a good suggestion. I'm an offender of the sometimes long e-mail subject. ;) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 28 17:39:12 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 09:39:12 -0800 Subject: [Libvirt-cim] [PATCH 13 of 18] Fixes to ElementCapabilities for libcmpiutil API change In-Reply-To: <589cad1316a9eb3fe021.1196195319@theine> References: <589cad1316a9eb3fe021.1196195319@theine> Message-ID: <474DA7C0.8080801@linux.vnet.ibm.com> Dan Smith wrote: > > - sys_name = cu_get_str_path(ref, "Name"); > - if (!STREQ(sys_name, host_name)) { > + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { > cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, > "System '%s' is not a host system.", sys_name); > goto out; > You're removing the check that confirms the sys_name and host_name match. This looks like it's trying to filter out any potential domains that might be passed in as a ref. Is this check no longer necessary? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 28 17:41:47 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 09:41:47 -0800 Subject: [Libvirt-cim] [PATCH 06 of 18] Fixes to VSMS for libcmpiutil API change In-Reply-To: <6e84b22c2d0251897d1f.1196195312@theine> References: <6e84b22c2d0251897d1f.1196195312@theine> Message-ID: <474DA85B.4090703@linux.vnet.ibm.com> Dan Smith wrote: > free(dev->dev.net.type); > - cu_get_str_prop(inst, "NetworkType", &dev->dev.net.type); > - if (dev->dev.net.type == NULL) > - dev->dev.net.type = strdup("bridge"); > + dev->dev.net.type = strdup(val); > } else if (type == VIRT_DEV_MEM) { > cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); > cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); > @@ -215,12 +224,10 @@ static int rasd_to_vdev(CMPIInstance *in > I'm not as familiar with the device support as a I should be. =) It looks like your removing support for the NULL case here. Is returning the network type of "bridge" in the NULL case no longer valid? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 28 17:46:55 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 09:46:55 -0800 Subject: [Libvirt-cim] [PATCH 00 of 18] Updates for libcmpiutil API change In-Reply-To: References: Message-ID: <474DA98F.7050205@linux.vnet.ibm.com> Dan Smith wrote: > This refactors all of the necessary functions in libvirt-cim for the new > API. Things only got cleaner, I think. I also found a substantial number > of memory leaks in the process, which are fundamentally fixed by the new > API which I think is a validation of it as "the right thing to do". All > required changes should have been easily spotted by the compiler, but some > testing would be good. > > Tip: To find the leaks, note every time we convert a variable from > char * to const char * and don't remove a subsequent free() call :) > Applied your patches and did a quick test. I sent two comments (see previous mails). I ran into some problems testing SettingsDefineCapabilities due to a possible issue with AllocationCapabilities. I'm looking into that further. Otherwise, things look good. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Wed Nov 28 17:53:56 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 09:53:56 -0800 Subject: [Libvirt-cim] [PATCH 06 of 18] Fixes to VSMS for libcmpiutil API change In-Reply-To: <474DA85B.4090703@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 28 Nov 2007 09:41:47 -0800") References: <6e84b22c2d0251897d1f.1196195312@theine> <474DA85B.4090703@linux.vnet.ibm.com> Message-ID: <87aboyfe8b.fsf@theine.beaverton.ibm.com> >> - cu_get_str_prop(inst, "NetworkType", &dev->dev.net.type); >> - if (dev->dev.net.type == NULL) >> - dev->dev.net.type = strdup("bridge"); >> + dev->dev.net.type = strdup(val); KR> I'm not as familiar with the device support as a I should be. =) KR> It looks like your removing support for the NULL case here. Is KR> returning the network type of "bridge" in the NULL case no longer KR> valid? No, that case is still handled. For full context: + if (cu_get_str_prop(inst, "NetworkType", &val) != CMPI_RC_OK) + val = "bridge"; + free(dev->dev.net.type); - cu_get_str_prop(inst, "NetworkType", &dev->dev.net.type); - if (dev->dev.net.type == NULL) - dev->dev.net.type = strdup("bridge"); + dev->dev.net.type = strdup(val); I moved the "not set" (NULL) case above, and set val to "bridge", so that below, I can assume it is a valid const string and strdup it directly. So val either gets the actual type, or "bridge" by the time I get to the strdup. I did the same reordering in disk with the Address field, making "/dev/null" the default if unspecified. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Wed Nov 28 17:57:05 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 09:57:05 -0800 Subject: [Libvirt-cim] [PATCH 13 of 18] Fixes to ElementCapabilities for libcmpiutil API change In-Reply-To: <474DA7C0.8080801@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 28 Nov 2007 09:39:12 -0800") References: <589cad1316a9eb3fe021.1196195319@theine> <474DA7C0.8080801@linux.vnet.ibm.com> Message-ID: <8763zmfe32.fsf@theine.beaverton.ibm.com> KR> You're removing the check that confirms the sys_name and host_name KR> match. This looks like it's trying to filter out any potential KR> domains that might be passed in as a ref. Is this check no longer KR> necessary? Oops, looks like my pattern-matching eyeballs got a little cut-happy. We probably need both the "!= CMPI_RC_OK" check and then the STREQ() check below that, right? I'll fix that and repost the set. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Nov 28 17:59:48 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 09:59:48 -0800 Subject: [Libvirt-cim] [PATCH 06 of 18] Fixes to VSMS for libcmpiutil API change In-Reply-To: <474DABA9.4050508@linux.vnet.ibm.com> References: <6e84b22c2d0251897d1f.1196195312@theine> <474DA85B.4090703@linux.vnet.ibm.com> <87aboyfe8b.fsf@theine.beaverton.ibm.com> <474DABA9.4050508@linux.vnet.ibm.com> Message-ID: <474DAC94.3040205@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Dan Smith wrote: >> No, that case is still handled. For full context: >> >> + if (cu_get_str_prop(inst, "NetworkType", &val) != >> CMPI_RC_OK) >> + val = "bridge"; >> + >> free(dev->dev.net.type); >> - cu_get_str_prop(inst, "NetworkType", >> &dev->dev.net.type); >> - if (dev->dev.net.type == NULL) >> - dev->dev.net.type = strdup("bridge"); >> + dev->dev.net.type = strdup(val); >> >> I moved the "not set" (NULL) case above, and set val to "bridge", so >> that below, I can assume it is a valid const string and strdup it >> directly. So val either gets the actual type, or "bridge" by the time >> I get to the strdup. >> >> I did the same reordering in disk with the Address field, making >> "/dev/null" the default if unspecified. Oops.. thanks for the clarification. I caught the Address part, but I missed it for the NetworkType part. Looks good then. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Wed Nov 28 17:10:29 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:29 -0700 Subject: [Libvirt-cim] [PATCH 16 of 17] Fixes to EAFP for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196273390 28800 # Node ID d2ca8217aebe475321b531657cbebcf90cd755c2 # Parent 7d60f525a9732ff3635001565ae0ef8b72b38eb7 Fixes to EAFP for libcmpiutil API change Signed-off-by: Dan Smith diff -r 7d60f525a973 -r d2ca8217aebe src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Wed Nov 28 10:09:50 2007 -0800 +++ b/src/Virt_ElementAllocatedFromPool.c Wed Nov 28 10:09:50 2007 -0800 @@ -63,7 +63,7 @@ static CMPIStatus vdev_to_pool(const CMP { CMPIStatus s; uint16_t type; - char *id = NULL; + const char *id = NULL; char *poolid = NULL; virConnectPtr conn = NULL; CMPIInstance *pool = NULL; @@ -76,8 +76,7 @@ static CMPIStatus vdev_to_pool(const CMP goto out; } - id = cu_get_str_path(ref, "DeviceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "DeviceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -107,7 +106,6 @@ static CMPIStatus vdev_to_pool(const CMP } out: - free(id); free(poolid); virConnectClose(conn); @@ -124,23 +122,20 @@ static int filter_by_pool(struct inst_li for (i = 0; i < src->cur; i++) { CMPIInstance *inst = src->list[i]; - char *cn = NULL; - char *dev_id = NULL; + const char *cn = NULL; + const char *dev_id = NULL; cu_get_str_prop(inst, "CreationClassName", &cn); cu_get_str_prop(inst, "DeviceID", &dev_id); if ((dev_id == NULL) || (cn == NULL)) - goto end; + continue; printf("Device %hhi:%s", type, dev_id); poolid = pool_member_of(_BROKER, cn, type, dev_id); if (poolid && STREQ(poolid, _poolid)) inst_list_add(dest, inst); - end: - free(dev_id); - free(cn); } return dest->cur; @@ -200,11 +195,10 @@ static CMPIStatus pool_to_vdev(const CMP struct std_assoc_info *info, struct inst_list *list) { - char *poolid; + const char *poolid; CMPIStatus s; - poolid = cu_get_str_path(ref, "InstanceID"); - if (poolid == NULL) { + if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -244,8 +238,6 @@ static CMPIStatus pool_to_vdev(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(poolid); - return s; } From danms at us.ibm.com Wed Nov 28 17:10:15 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:15 -0700 Subject: [Libvirt-cim] [PATCH 02 of 17] Fixes to ComputerSystem for libcmpiutil API change In-Reply-To: Message-ID: <6d9aed8314c6a9c00ee5.1196273415@theine> # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID 6d9aed8314c6a9c00ee506d724695859c623e396 # Parent cc0d80e1229bbd45e62c409336ce6020fbdebdbf Fixes to ComputerSystem for libcmpiutil API change Signed-off-by: Dan Smith diff -r cc0d80e1229b -r 6d9aed8314c6 src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_ComputerSystem.c Wed Nov 28 09:50:29 2007 -0800 @@ -277,7 +277,7 @@ static int instance_from_dom(const CMPIB /* Given a hypervisor connection and a domain name, return an instance */ CMPIInstance *instance_from_name(const CMPIBroker *broker, virConnectPtr conn, - char *name, + const char *name, const CMPIObjectPath *op) { virDomainPtr dom; @@ -376,7 +376,7 @@ static CMPIStatus return_enum_domains(co static CMPIStatus get_domain(const CMPIObjectPath *reference, const CMPIResult *results, - char *name) + const char *name) { CMPIInstance *inst; CMPIStatus s; @@ -440,10 +440,9 @@ static CMPIStatus GetInstance(CMPIInstan const CMPIObjectPath *reference, const char **properties) { - char *name; - - name = cu_get_str_path(reference, "Name"); - if (name == NULL) { + const char *name; + + if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) { CMPIStatus s; CMSetStatusWithChars(_BROKER, &s, @@ -602,7 +601,7 @@ static CMPIStatus state_change_reset(vir return s; } -static CMPIStatus __state_change(char *name, +static CMPIStatus __state_change(const char *name, uint16_t state, const CMPIObjectPath *ref) { @@ -660,7 +659,7 @@ static CMPIStatus state_change(CMPIMetho CMPIStatus s; uint16_t state; int ret; - char *name = NULL; + const char *name = NULL; ret = cu_get_u16_arg(argsin, "RequestedState", &state); if (!ret) { @@ -668,8 +667,7 @@ static CMPIStatus state_change(CMPIMetho goto out; } - name = cu_get_str_path(reference, "Name"); - if (name == NULL) { + if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Name key not specified"); @@ -679,8 +677,6 @@ static CMPIStatus state_change(CMPIMetho s = __state_change(name, state, reference); out: - free(name); - return s; } diff -r cc0d80e1229b -r 6d9aed8314c6 src/Virt_ComputerSystem.h --- a/src/Virt_ComputerSystem.h Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_ComputerSystem.h Wed Nov 28 09:50:29 2007 -0800 @@ -34,7 +34,7 @@ */ CMPIInstance *instance_from_name(const CMPIBroker *broker, virConnectPtr conn, - char *name, + const char *name, const CMPIObjectPath *ns); From danms at us.ibm.com Wed Nov 28 17:10:13 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:13 -0700 Subject: [Libvirt-cim] [PATCH 00 of 17] #2 Updates for libcmpiutil API change Message-ID: Fixed ElementCapabilities after Kaitlin's recent fix patch. Fixed the STREQ check that was accidentally removed in the last version. This refactors all of the necessary functions in libvirt-cim for the new API. Things only got cleaner, I think. I also found a substantial number of memory leaks in the process, which are fundamentally fixed by the new API which I think is a validation of it as "the right thing to do". All required changes should have been easily spotted by the compiler, but some testing would be good. From danms at us.ibm.com Wed Nov 28 17:10:23 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:23 -0700 Subject: [Libvirt-cim] [PATCH 10 of 17] Fixes to ECTP for libcmpiutil API change In-Reply-To: Message-ID: <89505650ebf53eadacd7.1196273423@theine> # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID 89505650ebf53eadacd7dbac45c5a0c5cd664907 # Parent d144424ac5e89ea217f1a6dda6842c4b9643fb74 Fixes to ECTP for libcmpiutil API change Signed-off-by: Dan Smith diff -r d144424ac5e8 -r 89505650ebf5 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 09:50:29 2007 -0800 @@ -101,11 +101,10 @@ static CMPIStatus prof_to_elem(const CMP struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; - char *id; + const char *id; int i; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); @@ -116,13 +115,11 @@ static CMPIStatus prof_to_elem(const CMP if (STREQ(id, profiles[i]->reg_id)) { s = elem_instances(ref, info, list, profiles[i]); if ((s.rc != CMPI_RC_OK)) - goto error; + goto out; break; } } - - error: - free(id); + out: return s; } From danms at us.ibm.com Wed Nov 28 17:10:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:30 -0700 Subject: [Libvirt-cim] [PATCH 17 of 17] Fixes to ElementSettingData for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196273390 28800 # Node ID dbc8be685fa5a1588fad5dfec31310ef520c5007 # Parent d2ca8217aebe475321b531657cbebcf90cd755c2 Fixes to ElementSettingData for libcmpiutil API change Signed-off-by: Dan Smith diff -r d2ca8217aebe -r dbc8be685fa5 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Wed Nov 28 10:09:50 2007 -0800 +++ b/src/Virt_ElementSettingData.c Wed Nov 28 10:09:50 2007 -0800 @@ -90,13 +90,12 @@ static CMPIStatus rasd_to_rasd(const CMP { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - char *id = NULL; + const char *id = NULL; uint16_t type; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -122,8 +121,6 @@ static CMPIStatus rasd_to_rasd(const CMP inst_list_add(list, inst); out: - free(id); - return s; } From danms at us.ibm.com Wed Nov 28 17:10:22 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:22 -0700 Subject: [Libvirt-cim] [PATCH 09 of 17] Fixes to RegisteredProfile for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID d144424ac5e89ea217f1a6dda6842c4b9643fb74 # Parent fde363d69d8db4a85a2fdc52cad40ccc5ccc4236 Fixes to RegisteredProfile for libcmpiutil API change Signed-off-by: Dan Smith diff -r fde363d69d8d -r d144424ac5e8 src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_RegisteredProfile.c Wed Nov 28 09:50:29 2007 -0800 @@ -124,11 +124,10 @@ static CMPIStatus get_prof(const CMPIObj { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *instance = NULL; - char* id; + const char* id; int i; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "No InstanceID specified"); @@ -149,9 +148,6 @@ static CMPIStatus get_prof(const CMPIObj CMReturnInstance(results, instance); else CMSetStatus(&s, CMPI_RC_ERR_NOT_FOUND); - - - free(id); return s; } From danms at us.ibm.com Wed Nov 28 17:10:24 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:24 -0700 Subject: [Libvirt-cim] [PATCH 11 of 17] Changes to SettingsDefineCapabilities for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID becc78027309750c7cfd300e55d33b9e774eef6a # Parent 89505650ebf53eadacd7dbac45c5a0c5cd664907 Changes to SettingsDefineCapabilities for libcmpiutil API change Signed-off-by: Dan Smith diff -r 89505650ebf5 -r becc78027309 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Nov 28 09:50:29 2007 -0800 @@ -499,7 +499,7 @@ static struct sdc_rasd_prop *disk_max(co CMPIStatus *s) { bool ret; - char *inst_id; + const char *inst_id; CMPIrc prop_ret; uint16_t free_space; uint64_t free_64; @@ -507,8 +507,7 @@ static struct sdc_rasd_prop *disk_max(co CMPIInstance *pool_inst; struct sdc_rasd_prop *rasd = NULL; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); @@ -558,7 +557,6 @@ static struct sdc_rasd_prop *disk_max(co } out: - free(inst_id); return rasd; } From danms at us.ibm.com Wed Nov 28 17:10:17 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:17 -0700 Subject: [Libvirt-cim] [PATCH 04 of 17] Fixes to SystemDevice for libcmpiutil API change In-Reply-To: Message-ID: <06430b32cb03cf118ec1.1196273417@theine> # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID 06430b32cb03cf118ec1c8e866b2bc12ad7513a3 # Parent ca82a00fd6dafc045f2d5958feeb2decb2f750bc Fixes to SystemDevice for libcmpiutil API change Signed-off-by: Dan Smith diff -r ca82a00fd6da -r 06430b32cb03 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_SystemDevice.c Wed Nov 28 09:50:29 2007 -0800 @@ -158,14 +158,13 @@ static CMPIStatus sys_to_dev(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *host = NULL; + const char *host = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; int ret; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - host = cu_get_str_path(ref, "Name"); - if (host == NULL) { + if (cu_get_str_path(ref, "Name", &host) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing Name"); @@ -205,7 +204,7 @@ static CMPIStatus dev_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *devid = NULL; + const char *devid = NULL; char *host = NULL; char *dev = NULL; CMPIInstance *sys; @@ -213,8 +212,7 @@ static CMPIStatus dev_to_sys(const CMPIO ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - devid = cu_get_str_path(ref, "DeviceID"); - if (devid == NULL) { + if (cu_get_str_path(ref, "DeviceID", &devid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -242,7 +240,6 @@ static CMPIStatus dev_to_sys(const CMPIO out: free(dev); free(host); - free(devid); return s; } From danms at us.ibm.com Wed Nov 28 17:10:16 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:16 -0700 Subject: [Libvirt-cim] [PATCH 03 of 17] Fixes to Device for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID ca82a00fd6dafc045f2d5958feeb2decb2f750bc # Parent 6d9aed8314c6a9c00ee506d724695859c623e396 Fixes to Device for libcmpiutil API change Signed-off-by: Dan Smith diff -r 6d9aed8314c6 -r ca82a00fd6da src/Virt_Device.c --- a/src/Virt_Device.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_Device.c Wed Nov 28 09:50:29 2007 -0800 @@ -470,7 +470,7 @@ CMPIInstance *instance_from_devid(const static CMPIStatus get_device(const CMPIObjectPath *reference, const CMPIResult *results, - char *devid) + const char *devid) { CMPIStatus s; virConnectPtr conn; @@ -525,10 +525,9 @@ static CMPIStatus GetInstance(CMPIInstan const CMPIObjectPath *reference, const char **properties) { - char *devid; - - devid = cu_get_str_path(reference, "DeviceID"); - if (devid == NULL) { + const char *devid; + + if (cu_get_str_path(reference, "DeviceID", &devid) != CMPI_RC_OK) { CMPIStatus s; CMSetStatusWithChars(_BROKER, &s, From danms at us.ibm.com Wed Nov 28 17:10:18 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:18 -0700 Subject: [Libvirt-cim] [PATCH 05 of 17] Fixes to RASD for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID e66205565a64aaaf90b62604948ab5d6c9b52d05 # Parent 06430b32cb03cf118ec1c8e866b2bc12ad7513a3 Fixes to RASD for libcmpiutil API change Signed-off-by: Dan Smith diff -r 06430b32cb03 -r e66205565a64 src/Virt_RASD.c --- a/src/Virt_RASD.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_RASD.c Wed Nov 28 09:50:29 2007 -0800 @@ -247,11 +247,10 @@ static CMPIStatus GetInstance(CMPIInstan { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst; - char *id = NULL; + const char *id = NULL; uint16_t type; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -274,8 +273,6 @@ static CMPIStatus GetInstance(CMPIInstan CMPI_RC_ERR_FAILED, "Unknown instance"); out: - free(id); - return s; } From danms at us.ibm.com Wed Nov 28 17:10:20 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:20 -0700 Subject: [Libvirt-cim] [PATCH 07 of 17] Fixes to VSMC for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID cac519783620f111b033536c6e57978bc3eb7798 # Parent 19721bc1591be90ca7d419fa807fee68fb56d6ae Fixes to VSMC for libcmpiutil API change Signed-off-by: Dan Smith diff -r 19721bc1591b -r cac519783620 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Wed Nov 28 09:50:29 2007 -0800 @@ -95,10 +95,9 @@ CMPIStatus get_vsm_cap(const CMPIBroker CMPIStatus s; CMPIObjectPath *op; char *classname = NULL; - char *sys_name = NULL; - - sys_name = cu_get_str_path(ref, "Name"); - if (sys_name == NULL) { + const char *sys_name = NULL; + + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, "Missing key: Name"); @@ -134,7 +133,6 @@ CMPIStatus get_vsm_cap(const CMPIBroker out: free(classname); - free(sys_name); return s; } From danms at us.ibm.com Wed Nov 28 17:10:25 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:25 -0700 Subject: [Libvirt-cim] [PATCH 12 of 17] Fixes to ElementCapabilities for libcmpiutil API change In-Reply-To: Message-ID: <30dcc8eaa9a5455815da.1196273425@theine> # HG changeset patch # User Dan Smith # Date 1196273290 28800 # Node ID 30dcc8eaa9a5455815dae18df6b0a98e7e352fc5 # Parent becc78027309750c7cfd300e55d33b9e774eef6a Fixes to ElementCapabilities for libcmpiutil API change Changes: - Updated to reflect new code in Kaitlin's recent patch - Fixed to *not* remove a valid STREQ() check in sys_to_cap() Signed-off-by: Dan Smith diff -r becc78027309 -r 30dcc8eaa9a5 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Wed Nov 28 10:08:10 2007 -0800 @@ -53,8 +53,8 @@ static CMPIStatus sys_to_cap(const CMPIO { CMPIInstance *inst; CMPIrc host_rc; - char *host_name = NULL; - char *sys_name = NULL; + const char *host_name = NULL; + const char *sys_name = NULL; CMPIStatus s = {CMPI_RC_OK, NULL}; s = get_host_cs(_BROKER, ref, &inst); @@ -65,7 +65,13 @@ static CMPIStatus sys_to_cap(const CMPIO if (host_rc != CMPI_RC_OK) goto out; - sys_name = cu_get_str_path(ref, "Name"); + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { + cu_statusf(_BROKER, *s, + CMPI_RC_ERR_FAILED, + "Missing `Name' property"); + goto out; + } + if (!STREQ(sys_name, host_name)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "System '%s' is not a host system.", sys_name); @@ -76,7 +82,6 @@ static CMPIStatus sys_to_cap(const CMPIO if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); out: - free(sys_name); return s; } @@ -84,16 +89,15 @@ static CMPIStatus cap_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *inst_id; + const char *inst_id; char *host; char *device; - char *host_name; + const char *host_name; CMPIrc host_rc; CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); @@ -123,7 +127,6 @@ static CMPIStatus cap_to_sys(const CMPIO out: free(host); free(device); - free(inst_id); return s; } @@ -133,10 +136,9 @@ static CMPIStatus cs_to_cap(const CMPIOb { CMPIInstance *inst; CMPIStatus s = {CMPI_RC_OK, NULL}; - char *sys_name = NULL; - - sys_name = cu_get_str_path(ref, "Name"); - if (sys_name == NULL) { + const char *sys_name = NULL; + + if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing key: Name"); @@ -148,8 +150,6 @@ static CMPIStatus cs_to_cap(const CMPIOb inst_list_add(list, inst); out: - free(sys_name); - return s; } @@ -157,15 +157,14 @@ static CMPIStatus cap_to_cs(const CMPIOb struct std_assoc_info *info, struct inst_list *list) { - char *inst_id; + const char *inst_id; char *host; char *device; CMPIInstance *inst; virConnectPtr conn; CMPIStatus s = {CMPI_RC_OK, NULL}; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); @@ -191,7 +190,7 @@ static CMPIStatus cap_to_cs(const CMPIOb error1: free(host); free(device); - free(inst_id); + return s; } @@ -208,13 +207,12 @@ static CMPIStatus pool_to_alloc(const CM struct inst_list *list) { int ret; - char *inst_id; + const char *inst_id; uint16_t type; CMPIInstance *inst = NULL; CMPIStatus s = {CMPI_RC_OK}; - inst_id = cu_get_str_path(ref, "InstanceID"); - if (inst_id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get InstanceID."); goto out; @@ -237,8 +235,6 @@ static CMPIStatus pool_to_alloc(const CM inst_list_add(list, inst); out: - free(inst_id); - return s; } static CMPIInstance *make_ref(const CMPIObjectPath *ref, From danms at us.ibm.com Wed Nov 28 17:10:21 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:21 -0700 Subject: [Libvirt-cim] [PATCH 08 of 17] Fixes to DevicePool for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID fde363d69d8db4a85a2fdc52cad40ccc5ccc4236 # Parent cac519783620f111b033536c6e57978bc3eb7798 Fixes to DevicePool for libcmpiutil API change Signed-off-by: Dan Smith diff -r cac519783620 -r fde363d69d8d src/Virt_DevicePool.c --- a/src/Virt_DevicePool.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_DevicePool.c Wed Nov 28 09:50:29 2007 -0800 @@ -730,10 +730,9 @@ static CMPIStatus GetInstance(CMPIInstan CMPIStatus s; CMPIInstance *inst; virConnectPtr conn = NULL; - char *id = NULL; - - id = cu_get_str_path(reference, "InstanceID"); - if (id == NULL) { + const char *id = NULL; + + if (cu_get_str_path(reference, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -756,7 +755,6 @@ static CMPIStatus GetInstance(CMPIInstan out: - free(id); virConnectClose(conn); return s; From danms at us.ibm.com Wed Nov 28 17:10:19 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:19 -0700 Subject: [Libvirt-cim] [PATCH 06 of 17] Fixes to VSMS for libcmpiutil API change In-Reply-To: Message-ID: <19721bc1591be90ca7d4.1196273419@theine> # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID 19721bc1591be90ca7d419fa807fee68fb56d6ae # Parent e66205565a64aaaf90b62604948ab5d6c9b52d05 Fixes to VSMS for libcmpiutil API change Changed the name of a variable to avoid having to break a line in an ugly way. If this is too much of a violation of the recently defined policy, I'll changed it :) Signed-off-by: Dan Smith diff -r e66205565a64 -r 19721bc1591b src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Nov 28 09:50:29 2007 -0800 +++ b/src/Virt_VirtualSystemManagementService.c Wed Nov 28 09:50:29 2007 -0800 @@ -92,12 +92,11 @@ static CMPIStatus define_system_parse_ar struct inst_list *res) { CMPIStatus s = {CMPI_RC_ERR_FAILED, NULL}; - char *sys_str = NULL; + const char *sys_str = NULL; CMPIArray *res_arr; int ret; - sys_str = cu_get_str_arg(argsin, "SystemSettings"); - if (sys_str == NULL) { + if (cu_get_str_arg(argsin, "SystemSettings", &sys_str) != CMPI_RC_OK) { CU_DEBUG("No SystemSettings string argument"); goto out; } @@ -114,8 +113,8 @@ static CMPIStatus define_system_parse_ar goto out; } - res_arr = cu_get_array_arg(argsin, "ResourceSettings"); - if (res_arr == NULL) { + if (cu_get_array_arg(argsin, "ResourceSettings", &res_arr) != + CMPI_RC_OK) { CU_DEBUG("Failed to get array arg"); goto out; } @@ -125,8 +124,6 @@ static CMPIStatus define_system_parse_ar CMSetStatus(&s, CMPI_RC_OK); out: - free(sys_str); - return s; } @@ -135,11 +132,14 @@ static int vssd_to_domain(CMPIInstance * { uint16_t tmp; int ret = 0; + const char *val; + + ret = cu_get_str_prop(inst, "VirtualSystemIdentifier", &val); + if (ret != CMPI_RC_OK) + goto out; free(domain->name); - ret = cu_get_str_prop(inst, "VirtualSystemIdentifier", &domain->name); - if (ret != CMPI_RC_OK) - goto out; + domain->name = strdup(val); ret = cu_get_u16_prop(inst, "AutomaticShutdownAction", &tmp); if (ret != CMPI_RC_OK) @@ -153,15 +153,19 @@ static int vssd_to_domain(CMPIInstance * domain->on_crash = (int)tmp; + ret = cu_get_str_prop(inst, "Bootloader", &val); + if (ret != CMPI_RC_OK) + val = ""; + free(domain->bootloader); - ret = cu_get_str_prop(inst, "Bootloader", &domain->bootloader); + domain->bootloader = strdup(val); + + ret = cu_get_str_prop(inst, "BootloaderArgs", &val); if (ret != CMPI_RC_OK) - domain->bootloader = strdup(""); + val = ""; free(domain->bootloader_args); - ret = cu_get_str_prop(inst, "BootloaderArgs", &domain->bootloader_args); - if (ret != CMPI_RC_OK) - domain->bootloader_args = strdup(""); + domain->bootloader_args = strdup(val); ret = 1; out: @@ -172,7 +176,8 @@ static int rasd_to_vdev(CMPIInstance *in struct virt_device *dev) { uint16_t type; - char *id = NULL; + const char *id = NULL; + const char *val = NULL; char *name = NULL; char *devid = NULL; CMPIObjectPath *op; @@ -196,16 +201,20 @@ static int rasd_to_vdev(CMPIInstance *in free(dev->dev.disk.virtual_dev); dev->dev.disk.virtual_dev = devid; + if (cu_get_str_prop(inst, "Address", &val) != CMPI_RC_OK) + val = "/dev/null"; + free(dev->dev.disk.source); - cu_get_str_prop(inst, "Address", &dev->dev.disk.source); + dev->dev.disk.source = strdup(val); } else if (type == VIRT_DEV_NET) { free(dev->dev.net.mac); dev->dev.net.mac = devid; + if (cu_get_str_prop(inst, "NetworkType", &val) != CMPI_RC_OK) + val = "bridge"; + free(dev->dev.net.type); - cu_get_str_prop(inst, "NetworkType", &dev->dev.net.type); - if (dev->dev.net.type == NULL) - dev->dev.net.type = strdup("bridge"); + dev->dev.net.type = strdup(val); } else if (type == VIRT_DEV_MEM) { cu_get_u64_prop(inst, "VirtualQuantity", &dev->dev.mem.size); cu_get_u64_prop(inst, "Reservation", &dev->dev.mem.size); @@ -215,12 +224,10 @@ static int rasd_to_vdev(CMPIInstance *in dev->dev.mem.maxsize <<= 10; } - free(id); free(name); return 1; err: - free(id); free(name); free(devid); @@ -411,7 +418,7 @@ static CMPIStatus destroy_system(CMPIMet const CMPIArgs *argsin, CMPIArgs *argsout) { - char *dom_name = NULL; + const char *dom_name = NULL; CMPIStatus status = {CMPI_RC_OK, NULL}; CMPIValue rc; CMPIObjectPath *sys; @@ -426,8 +433,7 @@ static CMPIStatus destroy_system(CMPIMet goto error1; } - sys = cu_get_ref_arg(argsin, "AffectedSystem"); - if (sys == NULL) { + if (cu_get_ref_arg(argsin, "AffectedSystem", &sys) != CMPI_RC_OK) { rc.uint32 = IM_RC_FAILED; goto error2; } @@ -455,7 +461,6 @@ static CMPIStatus destroy_system(CMPIMet rc.uint32 = IM_RC_SYS_NOT_FOUND; } - free(dom_name); error2: virConnectClose(conn); error1: @@ -467,7 +472,7 @@ static CMPIStatus update_system_settings CMPIInstance *vssd) { CMPIStatus s; - char *name = NULL; + const char *name = NULL; CMPIrc ret; virConnectPtr conn = NULL; virDomainPtr dom = NULL; @@ -513,7 +518,6 @@ static CMPIStatus update_system_settings out: free(xml); - free(name); virDomainFree(dom); virConnectClose(conn); cleanup_dominfo(&dominfo); @@ -529,11 +533,10 @@ static CMPIStatus mod_system_settings(CM const CMPIArgs *argsin, CMPIArgs *argsout) { - char *inst_str; + const char *inst_str; CMPIInstance *inst; - inst_str = cu_get_str_arg(argsin, "SystemSettings"); - if (inst == NULL) { + if (cu_get_str_arg(argsin, "SystemSettings", &inst_str) != CMPI_RC_OK) { CMPIStatus s; cu_statusf(_BROKER, &s, @@ -878,7 +881,7 @@ static CMPIStatus _update_resource_setti for (i = 0; i < list->cur; i++) { CMPIInstance *inst = list->list[i]; - char *id = NULL; + const char *id = NULL; char *name = NULL; char *devid = NULL; virDomainPtr dom = NULL; @@ -910,7 +913,6 @@ static CMPIStatus _update_resource_setti end: free(name); free(devid); - free(id); virDomainFree(dom); if (s.rc != CMPI_RC_OK) @@ -927,21 +929,20 @@ static CMPIStatus update_resource_settin const CMPIArgs *argsin, resmod_fn func) { - CMPIArray *array; + CMPIArray *arr; CMPIStatus s; struct inst_list list; inst_list_init(&list); - array = cu_get_array_arg(argsin, "ResourceSettings"); - if (array == NULL) { + if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing ResourceSettings"); goto out; } - parse_str_inst_array(array, NAMESPACE(ref), &list); + parse_str_inst_array(arr, NAMESPACE(ref), &list); s = _update_resource_settings(ref, &list, func); @@ -1052,7 +1053,7 @@ CMPIStatus get_vsms(const CMPIObjectPath CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; CMPIInstance *host = NULL; - char *val = NULL; + const char *val = NULL; virConnectPtr conn = NULL; *_inst = NULL; @@ -1089,7 +1090,6 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetProperty(inst, "SystemName", (CMPIValue *)val, CMPI_chars); - free(val); if (cu_get_str_prop(host, "CreationClassName", &val) != CMPI_RC_OK) { cu_statusf(broker, &s, @@ -1100,7 +1100,6 @@ CMPIStatus get_vsms(const CMPIObjectPath CMSetProperty(inst, "SystemCreationClassName", (CMPIValue *)val, CMPI_chars); - free(val); CMSetStatus(&s, CMPI_RC_OK); From danms at us.ibm.com Wed Nov 28 17:10:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:28 -0700 Subject: [Libvirt-cim] [PATCH 15 of 17] Fixes to RAFP for libcmpiutil API change In-Reply-To: Message-ID: <7d60f525a9732ff36350.1196273428@theine> # HG changeset patch # User Dan Smith # Date 1196273390 28800 # Node ID 7d60f525a9732ff3635001565ae0ef8b72b38eb7 # Parent e8350716e6731e00ba1d7e093d9cdef696a9f9bb Fixes to RAFP for libcmpiutil API change Signed-off-by: Dan Smith diff -r e8350716e673 -r 7d60f525a973 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Wed Nov 28 10:09:50 2007 -0800 +++ b/src/Virt_ResourceAllocationFromPool.c Wed Nov 28 10:09:50 2007 -0800 @@ -43,7 +43,7 @@ static CMPIStatus rasd_to_pool(const CMP { CMPIStatus s; uint16_t type; - char *id = NULL; + const char *id = NULL; char *poolid = NULL; virConnectPtr conn = NULL; struct inst_list _list; @@ -58,8 +58,7 @@ static CMPIStatus rasd_to_pool(const CMP goto out; } - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -92,7 +91,6 @@ static CMPIStatus rasd_to_pool(const CMP } out: - free(id); free(poolid); virConnectClose(conn); inst_list_free(&_list); @@ -106,7 +104,7 @@ static int filter_by_pool(struct inst_li { int i; uint16_t type; - char *rasd_id = NULL; + const char *rasd_id = NULL; char *poolid = NULL; for (i = 0; i < src->cur; i++) { @@ -126,8 +124,6 @@ static int filter_by_pool(struct inst_li poolid = pool_member_of(_BROKER, CLASSNAME(op), type, rasd_id); if (STREQ(poolid, _poolid)) inst_list_add(dest, inst); - - free(rasd_id); } return dest->cur; @@ -182,10 +178,9 @@ static CMPIStatus pool_to_rasd(const CMP struct inst_list *list) { CMPIStatus s; - char *poolid; - - poolid = cu_get_str_path(ref, "InstanceID"); - if (poolid == NULL) { + const char *poolid; + + if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -222,8 +217,6 @@ static CMPIStatus pool_to_rasd(const CMP CMSetStatus(&s, CMPI_RC_OK); out: - free(poolid); - return s; } From danms at us.ibm.com Wed Nov 28 17:10:26 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:26 -0700 Subject: [Libvirt-cim] [PATCH 13 of 17] Fixes to VSSDComponent for libcmpiutil API change In-Reply-To: Message-ID: <03b1c5492150286774f9.1196273426@theine> # HG changeset patch # User Dan Smith # Date 1196273390 28800 # Node ID 03b1c5492150286774f9087cb273146553d86f37 # Parent 30dcc8eaa9a5455815dae18df6b0a98e7e352fc5 Fixes to VSSDComponent for libcmpiutil API change Signed-off-by: Dan Smith diff -r 30dcc8eaa9a5 -r 03b1c5492150 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Wed Nov 28 10:08:10 2007 -0800 +++ b/src/Virt_VSSDComponent.c Wed Nov 28 10:09:50 2007 -0800 @@ -117,15 +117,14 @@ static CMPIStatus rasd_to_vssd(const CMP { CMPIStatus s; CMPIInstance *vssd = NULL; - char *id = NULL; + const char *id = NULL; char *host = NULL; char *devid = NULL; int ret; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -145,7 +144,6 @@ static CMPIStatus rasd_to_vssd(const CMP inst_list_add(list, vssd); out: - free(id); free(host); free(devid); From danms at us.ibm.com Wed Nov 28 17:10:27 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:27 -0700 Subject: [Libvirt-cim] [PATCH 14 of 17] Fixes to SettingsDefineState for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196273390 28800 # Node ID e8350716e6731e00ba1d7e093d9cdef696a9f9bb # Parent 03b1c5492150286774f9087cb273146553d86f37 Fixes to SettingsDefineState for libcmpiutil API change Signed-off-by: Dan Smith diff -r 03b1c5492150 -r e8350716e673 src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Wed Nov 28 10:09:50 2007 -0800 +++ b/src/Virt_SettingsDefineState.c Wed Nov 28 10:09:50 2007 -0800 @@ -46,7 +46,7 @@ static CMPIInstance *find_rasd(struct in CMPIInstance *inst; for (i = 0; i < list->cur; i++) { - char *id; + const char *id; int ret; inst = list->list[i]; @@ -55,12 +55,8 @@ static CMPIInstance *find_rasd(struct in if (ret != CMPI_RC_OK) continue; - if (STREQ(id, devid)) { - free(id); + if (STREQ(id, devid)) return inst; - } else { - free(id); - } } return NULL; @@ -73,15 +69,14 @@ static CMPIStatus dev_to_rasd(const CMPI CMPIStatus s; CMPIInstance *rasd; struct inst_list rasds; - char *id = NULL; + const char *id = NULL; char *name = NULL; char *devid = NULL; int ret; inst_list_init(&rasds); - id = cu_get_str_path(ref, "DeviceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "DeviceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing DeviceID"); @@ -109,14 +104,13 @@ static CMPIStatus dev_to_rasd(const CMPI CMSetStatus(&s, CMPI_RC_OK); out: - free(id); free(name); free(devid); return s; } -static CMPIInstance *_get_typed_device(char *id, +static CMPIInstance *_get_typed_device(const char *id, int type, const CMPIObjectPath *ref, CMPIStatus *s) @@ -161,13 +155,12 @@ static CMPIStatus rasd_to_dev(const CMPI { CMPIStatus s; CMPIInstance *dev = NULL; - char *id = NULL; + const char *id = NULL; uint16_t type; ASSOC_MATCH(info->provider_name, CLASSNAME(ref)); - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -190,8 +183,6 @@ static CMPIStatus rasd_to_dev(const CMPI CMSetStatus(&s, CMPI_RC_OK); out: - free(id); - return s; } @@ -201,7 +192,7 @@ static CMPIStatus vs_to_vssd(const CMPIO { virConnectPtr conn = NULL; virDomainPtr dom = NULL; - char *name; + const char *name; CMPIInstance *vssd; CMPIStatus s; @@ -209,8 +200,7 @@ static CMPIStatus vs_to_vssd(const CMPIO if (conn == NULL) return s; - name = cu_get_str_path(ref, "Name"); - if (name == NULL) { + if (cu_get_str_path(ref, "Name", &name) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing Name property"); @@ -232,7 +222,6 @@ static CMPIStatus vs_to_vssd(const CMPIO CMSetStatus(&s, CMPI_RC_OK); out: - free(name); virDomainFree(dom); virConnectClose(conn); @@ -244,7 +233,7 @@ static CMPIStatus vssd_to_vs(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - char *id = NULL; + const char *id = NULL; char *pfx = NULL; char *name = NULL; int ret; @@ -252,8 +241,7 @@ static CMPIStatus vssd_to_vs(const CMPIO CMPIStatus s; CMPIInstance *cs; - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) { + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, "Missing InstanceID"); @@ -284,7 +272,6 @@ static CMPIStatus vssd_to_vs(const CMPIO out: free(name); free(pfx); - free(id); virConnectClose(conn); From danms at us.ibm.com Wed Nov 28 17:10:14 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:10:14 -0700 Subject: [Libvirt-cim] [PATCH 01 of 17] Fixes to misc_util for libcmpiutil API change In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196272229 28800 # Node ID cc0d80e1229bbd45e62c409336ce6020fbdebdbf # Parent f230e4d57a78a48efb5c32e70e048ce229c2cca4 Fixes to misc_util for libcmpiutil API change Signed-off-by: Dan Smith diff -r f230e4d57a78 -r cc0d80e1229b libxkutil/misc_util.c --- a/libxkutil/misc_util.c Wed Nov 28 11:27:09 2007 +0100 +++ b/libxkutil/misc_util.c Wed Nov 28 09:50:29 2007 -0800 @@ -86,15 +86,18 @@ void free_domain_list(virDomainPtr *list virDomainFree(list[i]); } -char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key) +const char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key) { CMPIObjectPath *ref = NULL; - - ref = cu_get_ref_arg(args, arg); - if (ref == NULL) - return NULL; - - return cu_get_str_path(ref, key); + const char *val = NULL; + + if (cu_get_ref_arg(args, arg, &ref) != CMPI_RC_OK) + return NULL; + + if (cu_get_str_path(ref, key, &val) != CMPI_RC_OK) + return NULL; + + return val; } bool domain_exists(virConnectPtr conn, const char *name) @@ -352,7 +355,7 @@ bool domain_online(virDomainPtr dom) (info.state == VIR_DOMAIN_RUNNING); } -int parse_id(char *id, +int parse_id(const char *id, char **pfx, char **name) { @@ -386,15 +389,12 @@ bool parse_instanceid(const CMPIObjectPa char **name) { int ret; - char *id = NULL; - - id = cu_get_str_path(ref, "InstanceID"); - if (id == NULL) + const char *id = NULL; + + if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) return false; ret = parse_id(id, pfx, name); - - free(id); if (!ret) return false; diff -r f230e4d57a78 -r cc0d80e1229b libxkutil/misc_util.h --- a/libxkutil/misc_util.h Wed Nov 28 11:27:09 2007 +0100 +++ b/libxkutil/misc_util.h Wed Nov 28 09:50:29 2007 -0800 @@ -84,7 +84,7 @@ CMPIInstance *get_typed_instance(const C /* Parse an OrgID:LocID string into its constituent parts */ int parse_instance_id(char *iid, char **orgid, char **locid); -char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key); +const char *get_key_from_ref_arg(const CMPIArgs *args, char *arg, char *key); bool domain_exists(virConnectPtr conn, const char *name); bool domain_online(virDomainPtr dom); @@ -94,7 +94,7 @@ char *association_prefix(const char *pro char *association_prefix(const char *provider_name); bool match_pn_to_cn(const char *pn, const char *cn); -int parse_id(char *id, char **pfx, char **name); +int parse_id(const char *id, char **pfx, char **name); bool parse_instanceid(const CMPIObjectPath *ref, char **pfx, char **name); bool libvirt_cim_init(void); From danms at us.ibm.com Wed Nov 28 18:15:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 10:15:06 -0800 Subject: [Libvirt-cim] [PATCH 12 of 17] Fixes to ElementCapabilities for libcmpiutil API change In-Reply-To: <30dcc8eaa9a5455815da.1196273425@theine> (Dan Smith's message of "Wed, 28 Nov 2007 10:10:25 -0700") References: <30dcc8eaa9a5455815da.1196273425@theine> Message-ID: <87tzn6dyol.fsf@theine.beaverton.ibm.com> DS> + cu_statusf(_BROKER, *s, ^^ Should be &s. Forgot to qref before sending out the set. Fixed locally. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Wed Nov 28 18:15:39 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 10:15:39 -0800 Subject: [Libvirt-cim] [PATCH 0 of 4] #3 - Fixes to RegisteredProfile and ECTP depending on connect_by_classname approach In-Reply-To: References: Message-ID: <474DB04B.6020403@linux.vnet.ibm.com> Heidi Eckhart wrote: > -ixes duplicates of RegisteredProfile, adopt changes to RegisteredProfile to association ECTP > - fix hypervisor prefix for ECTP; remove error label and let label out do all the free() stuff > This set looks good to me. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 28 18:22:22 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 10:22:22 -0800 Subject: [Libvirt-cim] [PATCH 00 of 17] #2 Updates for libcmpiutil API change In-Reply-To: References: Message-ID: <474DB1DE.4030707@linux.vnet.ibm.com> Dan Smith wrote: > Fixed ElementCapabilities after Kaitlin's recent fix patch. > Cool - didn't realize that had been applied. > Fixed the STREQ check that was accidentally removed in the last version. > Thanks! +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 28 18:31:30 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 10:31:30 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Add helper function to check for matching hypervisor class prefixes In-Reply-To: <96c97073edc357edb1ff.1196248708@localhost.localdomain> References: <96c97073edc357edb1ff.1196248708@localhost.localdomain> Message-ID: <474DB402.3030608@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1196245629 -3600 > # Node ID 96c97073edc357edb1ff554d8c92207e644998c5 > # Parent ebb86619d5ca80ad7815f9d70d2c8a87698a5f0f > Add helper function to check for matching hypervisor class prefixes > > The class prefixes need to be checked for compliance, as a > request for KVM_RegisteredProfile with Xen_ECTP as assoc > does not return any instances. > Signed-off-by: Heidi Eckhart > This looks like a good set of patches. It seems like a reasonable way to ensure the caller doesn't hand us mismatching VM types. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Wed Nov 28 19:12:38 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 11:12:38 -0800 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities install issue Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1196276782 28800 # Node ID b6fdc32e25897a3cc0b38d31a738d4217c467328 # Parent f230e4d57a78a48efb5c32e70e048ce229c2cca4 Fix AllocationCapabilities install issue. The Virt_AllocationCapabilities provider install fails because it links with Virt_DevicePool, which is installed after Virt_AllocationCapabilities. When you run make install, you should see the following error: /usr/bin/ld: cannot find -lVirt_DevicePool collect2: ld returned 1 exit status libtool: install: error: relink `libVirt_AllocationCapabilities.la' with the above command before installing it Signed-off-by: Kaitlin Rupert diff -r f230e4d57a78 -r b6fdc32e2589 src/Makefile.am --- a/src/Makefile.am Wed Nov 28 11:27:09 2007 +0100 +++ b/src/Makefile.am Wed Nov 28 11:06:22 2007 -0800 @@ -34,12 +34,12 @@ provider_LTLIBRARIES = libVirt_ComputerS libVirt_VirtualSystemManagementService.la \ libVirt_VirtualSystemManagementCapabilities.la \ libVirt_EnabledLogicalElementCapabilities.la \ + libVirt_DevicePool.la \ libVirt_AllocationCapabilities.la \ libVirt_VSSD.la \ libVirt_HostedDependency.la \ libVirt_RegisteredProfile.la \ libVirt_ElementConformsToProfile.la \ - libVirt_DevicePool.la \ libVirt_SettingsDefineCapabilities.la \ libVirt_HostedResourcePool.la \ libVirt_ElementCapabilities.la \ From danms at us.ibm.com Wed Nov 28 20:50:00 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 12:50:00 -0800 Subject: [Libvirt-cim] [PATCH] Fix AllocationCapabilities install issue In-Reply-To: (Kaitlin Rupert's message of "Wed, 28 Nov 2007 11:12:38 -0800") References: Message-ID: <87mysydrif.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1196276782 28800 KR> # Node ID b6fdc32e25897a3cc0b38d31a738d4217c467328 KR> # Parent f230e4d57a78a48efb5c32e70e048ce229c2cca4 KR> Fix AllocationCapabilities install issue. Well, I don't get why you see that and I don't, but the patch is fine, so I've applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From heidieck at linux.vnet.ibm.com Wed Nov 28 21:53:15 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 22:53:15 +0100 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic In-Reply-To: <474C66B7.6010605@linux.vnet.ibm.com> References: <474C66B7.6010605@linux.vnet.ibm.com> Message-ID: <474DE34B.8090104@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> for (i = 0; comp_class_list[i]; i++) { >> comp_class = comp_class_list[i]; >> >> - if ((test_class == NULL) || >> - (comp_class == NULL) || >> - match_op(broker, rop, comp_class)) >> + if (!CMClassPathIsA(broker, rop, comp_class, NULL)) >> return true; >> } >> > I like the idea of this approach - I think it will help with > scalability in the future if we decide to add support for new VMs. I > have a few comments though. =) > > I'm not sure about this change here. If you return true here, then > you're accepting just about anything as a possible result class. ECTP > for example, the following query accepts Xen_Processor as a valid > result class: > > wbemcli ain -ac Xen_ElementConformsToProfile -arc Xen_Process > 'http://root:elm3b41 at localhost/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' > > > I tried modifying this line so that it is > + if (CMClassPathIsA(broker, rop, comp_class, NULL)) > A very good catch :) ! Fixed this in the new version. Thanks :) ! > > However, the problem with this is that it only allows result class to > be one of the items in the list supplied by the handler. For example, > ETCP has: > +char* managed_element[] = { > + "Xen_HostSystem", > + "Xen_ComputerSystem", > + "KVM_HostSystem", > + "KVM_ComputerSystem", > + NULL > +}; > > The result class in the following query would not be valid because it > doesn't appear in the list. > wbemcli ain -ac Xen_ElementConformsToProfile -arc > CIM_ManagedElement > 'http://root:elm3b41 at localhost/root/interop:Xen_RegisteredProfile.InstanceID="CIM:DSP1042-SystemVirtualization-1.0.0"' > > > We can't just add CIM_ManagedElement to the list because this same > list is being used for the source class. The source class needs to be > specific. Thoughts? I'm not sure if I'm correct in this line of > thinking. =) The problem was, that I swapped the classes - the next patch will show it correct: + rop = CMNewObjectPath(broker, ns, comp_class, NULL); + + if (CMClassPathIsA(broker, rop, test_class, NULL)) return true; The CMPI Spec tells the following about CMClassPathIsA: Function to determine whether a CIM class is of "type" or any of "type" subclasses. CMPIBoolean CMClassPathIsA (const CMPIBroker* mb, const CMPIObjectPath* op, const char* type, CMPIStatus* rc) So with the fixes your mentioned wbemain request works now. One thing that also caused a problem was, that the classes Xen/KVM_ComputerSystem and Xen/KVM_HostSystem haven't been registered to the interop namespace (sure, why should they ... ;) ). This is now also fixed with the patch for ECTP. But only the classes, not the provider are registered, because the DMTF Profile Spec tells us, that no instances of them are available in the interop namespace. It was my fault to choose the one cross-namespace association we have for implementing this functionality... ;). -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 20:53:40 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 22:53:40 +0200 Subject: [Libvirt-cim] [PATCH 1 of 3] Enhance handling of association's references In-Reply-To: Message-ID: <85f916da818a0d078d21.1196286820@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196283440 -3600 # Node ID 85f916da818a0d078d21efbb09df724e9cbf31dc # Parent 074c037c19ce46559f36a3fd06b943f5fe3c6009 Enhance handling of association's references The source and target classnames of std_assoc are now lists, containing all supported classnames. This approach frees the provider from listing all possible combinations as instances of std_assoc. Signed-off-by: Heidi Eckhart diff -r 074c037c19ce -r 85f916da818a std_association.c --- a/std_association.c Tue Nov 27 16:29:13 2007 -0500 +++ b/std_association.c Wed Nov 28 21:57:20 2007 +0100 @@ -61,18 +61,44 @@ static bool match_class(const CMPIBroker static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, - const char *comp_class) + char **comp_class_list) { CMPIObjectPath *rop; + char *comp_class; + int i; rop = CMNewObjectPath(broker, ns, test_class, NULL); - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) - return true; - else - return false; + for (i = 0; comp_class_list[i]; i++) { + comp_class = comp_class_list[i]; + + if ((test_class == NULL) || + (comp_class == NULL) || + match_op(broker, rop, comp_class)) + return true; + } + + return false; +} + +static bool match_source_class(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc *ptr) +{ + char *source_class; + int i; + + for (i = 0; ptr->source_class[i]; i++) { + source_class = ptr->source_class[i]; + + if (CMClassPathIsA(broker, + ref, + source_class, + NULL)) + return true; + } + + return false; } static CMPIStatus filter_results(struct inst_list *list, @@ -113,13 +139,13 @@ std_assoc_get_handler(const struct std_a std_assoc_get_handler(const struct std_assoc_ctx *ctx, const CMPIObjectPath *ref) { - struct std_assoc *ptr; + struct std_assoc *ptr = NULL; int i; for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) + if (match_source_class(ctx->brkr, ref, ptr)) return ptr; } diff -r 074c037c19ce -r 85f916da818a std_association.h --- a/std_association.h Tue Nov 27 16:29:13 2007 -0500 +++ b/std_association.h Wed Nov 28 21:57:20 2007 +0100 @@ -37,13 +37,13 @@ typedef CMPIInstance *(*make_ref_t)(cons struct std_assoc *); struct std_assoc { - char *source_class; + char **source_class; char *source_prop; - char *target_class; + char **target_class; char *target_prop; - char *assoc_class; + char **assoc_class; assoc_handler_t handler; make_ref_t make_ref; From heidieck at linux.vnet.ibm.com Wed Nov 28 20:53:41 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 22:53:41 +0200 Subject: [Libvirt-cim] [PATCH 2 of 3] Removed error messages that cause wrong error returns In-Reply-To: Message-ID: <53d512fbf05747b7bca5.1196286821@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196283441 -3600 # Node ID 53d512fbf05747b7bca5c189b0d6ab5e7e63f90b # Parent 85f916da818a0d078d21efbb09df724e9cbf31dc Removed error messages that cause wrong error returns The case that no handler was found for a request caused an error as return. This is wrong as the not-found handler tells only, that the provider is not responsible for the given request. In scenarios with a general request causing the call of several association providers that return valid instances, the former behavior causes a wrong result, as the CIMOM would return the error and revoke all valid results. Signed-off-by: Heidi Eckhart diff -r 85f916da818a -r 53d512fbf057 std_association.c --- a/std_association.c Wed Nov 28 21:57:20 2007 +0100 +++ b/std_association.c Wed Nov 28 21:57:21 2007 +0100 @@ -170,9 +170,6 @@ static CMPIStatus do_assoc(struct std_as handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { CU_DEBUG("No handler found."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); goto out; } @@ -269,9 +266,7 @@ static CMPIStatus do_ref(struct std_asso handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); + CU_DEBUG("No handler found."); goto out; } From heidieck at linux.vnet.ibm.com Wed Nov 28 20:53:39 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 22:53:39 +0200 Subject: [Libvirt-cim] [PATCH 0 of 3] #2 - Enhance std association logic for reference lists and input parameter handling Message-ID: This patch set fixes: - enhance the std_assoc struct to support lists for source, target and association classnames - fixed a wrong error return for a NULL handler - reworked check for input parameter: assocClass, resultClass, role, resultRole From heidieck at linux.vnet.ibm.com Wed Nov 28 20:53:42 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 22:53:42 +0200 Subject: [Libvirt-cim] [PATCH 3 of 3] Enhance handling of input parameter of std_association logic In-Reply-To: Message-ID: <1936036d498363aa3ca9.1196286822@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196285921 -3600 # Node ID 1936036d498363aa3ca9b9cfb773cae5ee95c339 # Parent 53d512fbf05747b7bca5c189b0d6ab5e7e63f90b Enhance handling of input parameter of std_association logic Signed-off-by: Heidi Eckhart diff -r 53d512fbf057 -r 1936036d4983 std_association.c --- a/std_association.c Wed Nov 28 21:57:21 2007 +0100 +++ b/std_association.c Wed Nov 28 22:38:41 2007 +0100 @@ -67,14 +67,17 @@ static bool match_class(const CMPIBroker char *comp_class; int i; - rop = CMNewObjectPath(broker, ns, test_class, NULL); - + if (test_class == NULL) + return true; + + if (comp_class_list == NULL) + return true; + for (i = 0; comp_class_list[i]; i++) { comp_class = comp_class_list[i]; - - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) + rop = CMNewObjectPath(broker, ns, comp_class, NULL); + + if (CMClassPathIsA(broker, rop, test_class, NULL)) return true; } @@ -137,18 +140,83 @@ out: static struct std_assoc * std_assoc_get_handler(const struct std_assoc_ctx *ctx, + struct std_assoc_info *info, const CMPIObjectPath *ref) { struct std_assoc *ptr = NULL; int i; + bool rc; + + CU_DEBUG("Calling Provider: '%s'", + info->provider_name); for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; if (match_source_class(ctx->brkr, ref, ptr)) - return ptr; - } - + break; + } + + if (!ptr) + goto out; + + if (info->assoc_class) { + CU_DEBUG("Check client's assocClass: '%s'", + info->assoc_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->assoc_class, + ptr->assoc_class); + + if (!rc) { + CU_DEBUG("AssocClass not valid."); + goto out; + } + CU_DEBUG("AssocClass valid."); + } + + if (info->result_class) { + CU_DEBUG("Check client's resultClass: '%s'", + info->result_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->result_class, + ptr->target_class); + + if (!rc) { + CU_DEBUG("ResultClass not valid."); + goto out; + } + CU_DEBUG("ResultClass valid."); + } + + if (info->role) { + CU_DEBUG("Check client's role: '%s'", + info->role); + + if (!STREQC(info->role, ptr->source_prop)) { + CU_DEBUG("Role not valid."); + goto out; + } + CU_DEBUG("Role valid."); + } + + if (info->result_role) { + CU_DEBUG("Check client's resultRole: '%s'", + info->result_role); + + if (!STREQC(info->result_role, ptr->target_prop)) { + CU_DEBUG("ResultRole not valid."); + goto out; + } + CU_DEBUG("ResultRole valid."); + } + + return ptr; + + out: return NULL; } @@ -158,57 +226,21 @@ static CMPIStatus do_assoc(struct std_as const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; struct std_assoc *handler; - bool rc; inst_list_init(&list); CU_DEBUG("Getting handler..."); - - handler = std_assoc_get_handler(ctx, ref); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", - handler->source_class, - handler->target_class, - handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", - info->result_class); - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->target_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - CU_DEBUG("Match_class succeeded."); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", - info->assoc_class); - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->assoc_class, - handler->assoc_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Association class given is not valid for" - "this association"); - goto out; - } - CU_DEBUG("Match_class succeeded, calling handler->handler..."); - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { @@ -256,32 +288,22 @@ static CMPIStatus do_ref(struct std_asso const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; - int i; struct std_assoc *handler; - bool rc; + int i; inst_list_init(&list); - handler = std_assoc_get_handler(ctx, ref); + CU_DEBUG("Getting handler..."); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->assoc_class); - if (!rc) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) goto out; From heidieck at linux.vnet.ibm.com Wed Nov 28 21:01:39 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 23:01:39 +0200 Subject: [Libvirt-cim] [PATCH] ECTP: Adoption of changes to std_assoc struct in std_association Message-ID: <786976aa40c60088afe1.1196287299@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196287282 -3600 # Node ID 786976aa40c60088afe17571372b4a5d82a0d29e # Parent 535f219fe23fec8a5de725e0875e4fcdadbd584c ECTP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. It also adds the registration of ComputerSystem and HostSystem to the interop namespace. This is necessary to check the client's resultClass value. Signed-off-by: Heidi Eckhart diff -r 535f219fe23f -r 786976aa40c6 Makefile.am --- a/Makefile.am Wed Nov 28 11:39:55 2007 +0100 +++ b/Makefile.am Wed Nov 28 23:01:22 2007 +0100 @@ -36,6 +36,8 @@ MOFS = \ schema/ElementSettingData.mof INTEROP_MOFS = \ + schema/ComputerSystem.mof \ + schema/HostSystem.mof \ schema/RegisteredProfile.mof \ schema/ElementConformsToProfile.mof diff -r 535f219fe23f -r 786976aa40c6 src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:39:55 2007 +0100 +++ b/src/Virt_ElementConformsToProfile.c Wed Nov 28 23:01:22 2007 +0100 @@ -224,27 +224,47 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } +char* conformant_standard[] = { + "Xen_RegisteredProfile", + "KVM_RegisteredProfile", + NULL +}; + +char* managed_element[] = { + "Xen_HostSystem", + "Xen_ComputerSystem", + "KVM_HostSystem", + "KVM_ComputerSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementConformsToProfile", + "KVM_ElementConformsToProfile", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", + .source_class = (char**)&conformant_standard, .source_prop = "ConformantStandard", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = prof_to_elem, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_ManagedElement", + .source_class = (char**)&managed_element, .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = (char**)&conformant_standard, .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = elem_to_prof, .make_ref = make_ref @@ -255,7 +275,6 @@ struct std_assoc *assoc_handlers[] = { &backward, NULL }; - STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* From kaitlin at linux.vnet.ibm.com Wed Nov 28 22:16:51 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 14:16:51 -0800 Subject: [Libvirt-cim] [PATCH 2 of 2] Update get_vsm_cap() call in ElementCapabilities In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1196288115 28800 # Node ID f26172c947953530556edb530dc8a371d2106c3e # Parent 34d66c74e3801796f89ca51df93ebff3075c6358 Update get_vsm_cap() call in ElementCapabilities. The get_vsm_cap() call in VSMC has been changed to include an extra paramater. The calling function in ElementCapabilities already gets the system / hostname, so all that needs to be done is to pass that value to get_vsm_cap(). Signed-off-by: Kaitlin Rupert diff -r 34d66c74e380 -r f26172c94795 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Wed Nov 28 14:15:10 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Wed Nov 28 14:15:15 2007 -0800 @@ -78,7 +78,7 @@ static CMPIStatus sys_to_cap(const CMPIO goto out; } - s = get_vsm_cap(_BROKER, ref, &inst); + s = get_vsm_cap(_BROKER, ref, sys_name, &inst); if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); out: From kaitlin at linux.vnet.ibm.com Wed Nov 28 22:16:50 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 14:16:50 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Fix issue with VSMC enum In-Reply-To: Message-ID: <34d66c74e3801796f89c.1196288210@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1196288110 28800 # Node ID 34d66c74e3801796f89ca51df93ebff3075c6358 # Parent c478a5b30689a80159588c8f914ac97263694372 Fix issue with VSMC enum. This fix makes get_vsm_cap() more generic - it accepts a string to use for the InstanceID. The return_vsm_cap() handles enum'ing the VSMC instances, so this has been updated to get the hostname, which will be used in the InstanceID string. Signed-off-by: Kaitlin Rupert diff -r c478a5b30689 -r 34d66c74e380 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Wed Nov 28 14:15:10 2007 -0800 @@ -90,19 +90,12 @@ static CMPIStatus set_inst_properties(co CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, + const char* sys_name, CMPIInstance **inst) { CMPIStatus s; CMPIObjectPath *op; char *classname = NULL; - const char *sys_name = NULL; - - if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Missing key: Name"); - goto out; - } classname = get_typed_class(CLASSNAME(ref), "VirtualSystemManagementCapabilities"); @@ -143,8 +136,12 @@ static CMPIStatus return_vsm_cap(const C { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - - s = get_vsm_cap(_BROKER, ref, &inst); + char hostname[256] = {0}; + + if (gethostname(hostname, sizeof(hostname) - 1) != 0) + strcpy(hostname, "unknown"); + + s = get_vsm_cap(_BROKER, ref, hostname, &inst); if (s.rc != CMPI_RC_OK) goto out; diff -r c478a5b30689 -r 34d66c74e380 src/Virt_VirtualSystemManagementCapabilities.h --- a/src/Virt_VirtualSystemManagementCapabilities.h Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.h Wed Nov 28 14:15:10 2007 -0800 @@ -20,6 +20,7 @@ */ CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, + const char* sys_name, CMPIInstance **inst); /* * Local Variables: From kaitlin at linux.vnet.ibm.com Wed Nov 28 22:16:49 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 14:16:49 -0800 Subject: [Libvirt-cim] [PATCH 0 of 2] Fix VSMC enumeration failure. Message-ID: wbemcli ein http://root:elm3b41 at localhost/root/virt:Xen_VirtualSystemManagementCapabilities This currently returns: "Missing key: Name". This is because get_vsm_cap() is expecting a Name attribute in the ref, which doesn't exist on an enumeration query. This patch set fixes the enum issue in VSMC. Part of this fix is to add a new parameter to get_vsm_cap(). One of the handlers in ElementCapabilities calls get_vsm_cap(), so that function call has been updated as well. From heidieck at linux.vnet.ibm.com Wed Nov 28 22:04:33 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 23:04:33 +0100 Subject: [Libvirt-cim] [PATCH] ECTP: Adoption of changes to std_assoc struct in std_association In-Reply-To: <786976aa40c60088afe1.1196287299@localhost.localdomain> References: <786976aa40c60088afe1.1196287299@localhost.localdomain> Message-ID: <474DE5F1.9030702@linux.vnet.ibm.com> I will cook up the patches for the other associations tomorrow. This one is for verification purpose. -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Wed Nov 28 21:13:28 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 23:13:28 +0200 Subject: [Libvirt-cim] [PATCH 0 of 3] #3 - Enhance std association logic for reference lists and input parameter handling Message-ID: Please don't ask me what happened to the patch set before and why patch 3 was not submitted to the list. So resending the complete patch set once again ... and hope. This patch set fixes: - enhance the std_assoc struct to support lists for source, target and association classnames - fixed a wrong error return for a NULL handler - reworked check for input parameter: assocClass, resultClass, role, resultRole From heidieck at linux.vnet.ibm.com Wed Nov 28 21:13:29 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 23:13:29 +0200 Subject: [Libvirt-cim] [PATCH 1 of 3] Enhance handling of association's references In-Reply-To: Message-ID: <85f916da818a0d078d21.1196288009@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196283440 -3600 # Node ID 85f916da818a0d078d21efbb09df724e9cbf31dc # Parent 074c037c19ce46559f36a3fd06b943f5fe3c6009 Enhance handling of association's references The source and target classnames of std_assoc are now lists, containing all supported classnames. This approach frees the provider from listing all possible combinations as instances of std_assoc. Signed-off-by: Heidi Eckhart diff -r 074c037c19ce -r 85f916da818a std_association.c --- a/std_association.c Tue Nov 27 16:29:13 2007 -0500 +++ b/std_association.c Wed Nov 28 21:57:20 2007 +0100 @@ -61,18 +61,44 @@ static bool match_class(const CMPIBroker static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, - const char *comp_class) + char **comp_class_list) { CMPIObjectPath *rop; + char *comp_class; + int i; rop = CMNewObjectPath(broker, ns, test_class, NULL); - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) - return true; - else - return false; + for (i = 0; comp_class_list[i]; i++) { + comp_class = comp_class_list[i]; + + if ((test_class == NULL) || + (comp_class == NULL) || + match_op(broker, rop, comp_class)) + return true; + } + + return false; +} + +static bool match_source_class(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc *ptr) +{ + char *source_class; + int i; + + for (i = 0; ptr->source_class[i]; i++) { + source_class = ptr->source_class[i]; + + if (CMClassPathIsA(broker, + ref, + source_class, + NULL)) + return true; + } + + return false; } static CMPIStatus filter_results(struct inst_list *list, @@ -113,13 +139,13 @@ std_assoc_get_handler(const struct std_a std_assoc_get_handler(const struct std_assoc_ctx *ctx, const CMPIObjectPath *ref) { - struct std_assoc *ptr; + struct std_assoc *ptr = NULL; int i; for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) + if (match_source_class(ctx->brkr, ref, ptr)) return ptr; } diff -r 074c037c19ce -r 85f916da818a std_association.h --- a/std_association.h Tue Nov 27 16:29:13 2007 -0500 +++ b/std_association.h Wed Nov 28 21:57:20 2007 +0100 @@ -37,13 +37,13 @@ typedef CMPIInstance *(*make_ref_t)(cons struct std_assoc *); struct std_assoc { - char *source_class; + char **source_class; char *source_prop; - char *target_class; + char **target_class; char *target_prop; - char *assoc_class; + char **assoc_class; assoc_handler_t handler; make_ref_t make_ref; From heidieck at linux.vnet.ibm.com Wed Nov 28 21:13:30 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 23:13:30 +0200 Subject: [Libvirt-cim] [PATCH 2 of 3] Removed error messages that cause wrong error returns In-Reply-To: Message-ID: <53d512fbf05747b7bca5.1196288010@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196283441 -3600 # Node ID 53d512fbf05747b7bca5c189b0d6ab5e7e63f90b # Parent 85f916da818a0d078d21efbb09df724e9cbf31dc Removed error messages that cause wrong error returns The case that no handler was found for a request caused an error as return. This is wrong as the not-found handler tells only, that the provider is not responsible for the given request. In scenarios with a general request causing the call of several association providers that return valid instances, the former behavior causes a wrong result, as the CIMOM would return the error and revoke all valid results. Signed-off-by: Heidi Eckhart diff -r 85f916da818a -r 53d512fbf057 std_association.c --- a/std_association.c Wed Nov 28 21:57:20 2007 +0100 +++ b/std_association.c Wed Nov 28 21:57:21 2007 +0100 @@ -170,9 +170,6 @@ static CMPIStatus do_assoc(struct std_as handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { CU_DEBUG("No handler found."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); goto out; } @@ -269,9 +266,7 @@ static CMPIStatus do_ref(struct std_asso handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); + CU_DEBUG("No handler found."); goto out; } From heidieck at linux.vnet.ibm.com Wed Nov 28 21:13:31 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Wed, 28 Nov 2007 23:13:31 +0200 Subject: [Libvirt-cim] [PATCH 3 of 3] Enhance handling of input parameter of std_association logic In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196287649 -3600 # Node ID ae5641cb6977307772a38c2585be008fc72b59a1 # Parent 53d512fbf05747b7bca5c189b0d6ab5e7e63f90b Enhance handling of input parameter of std_association logic Signed-off-by: Heidi Eckhart diff -r 53d512fbf057 -r ae5641cb6977 std_association.c --- a/std_association.c Wed Nov 28 21:57:21 2007 +0100 +++ b/std_association.c Wed Nov 28 23:07:29 2007 +0100 @@ -67,14 +67,17 @@ static bool match_class(const CMPIBroker char *comp_class; int i; - rop = CMNewObjectPath(broker, ns, test_class, NULL); - + if (test_class == NULL) + return true; + + if (comp_class_list == NULL) + return true; + for (i = 0; comp_class_list[i]; i++) { comp_class = comp_class_list[i]; - - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) + rop = CMNewObjectPath(broker, ns, comp_class, NULL); + + if (CMClassPathIsA(broker, rop, test_class, NULL)) return true; } @@ -137,18 +140,83 @@ out: static struct std_assoc * std_assoc_get_handler(const struct std_assoc_ctx *ctx, + struct std_assoc_info *info, const CMPIObjectPath *ref) { struct std_assoc *ptr = NULL; int i; + bool rc; + + CU_DEBUG("Calling Provider: '%s'", + info->provider_name); for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; if (match_source_class(ctx->brkr, ref, ptr)) - return ptr; - } - + break; + } + + if (!ptr) + goto out; + + if (info->assoc_class) { + CU_DEBUG("Check client's assocClass: '%s'", + info->assoc_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->assoc_class, + ptr->assoc_class); + + if (!rc) { + CU_DEBUG("AssocClass not valid."); + goto out; + } + CU_DEBUG("AssocClass valid."); + } + + if (info->result_class) { + CU_DEBUG("Check client's resultClass: '%s'", + info->result_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->result_class, + ptr->target_class); + + if (!rc) { + CU_DEBUG("ResultClass not valid."); + goto out; + } + CU_DEBUG("ResultClass valid."); + } + + if (info->role) { + CU_DEBUG("Check client's role: '%s'", + info->role); + + if (!STREQC(info->role, ptr->source_prop)) { + CU_DEBUG("Role not valid."); + goto out; + } + CU_DEBUG("Role valid."); + } + + if (info->result_role) { + CU_DEBUG("Check client's resultRole: '%s'", + info->result_role); + + if (!STREQC(info->result_role, ptr->target_prop)) { + CU_DEBUG("ResultRole not valid."); + goto out; + } + CU_DEBUG("ResultRole valid."); + } + + return ptr; + + out: return NULL; } @@ -158,57 +226,21 @@ static CMPIStatus do_assoc(struct std_as const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; struct std_assoc *handler; - bool rc; inst_list_init(&list); CU_DEBUG("Getting handler..."); - - handler = std_assoc_get_handler(ctx, ref); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", - handler->source_class, - handler->target_class, - handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", - info->result_class); - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->target_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - CU_DEBUG("Match_class succeeded."); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", - info->assoc_class); - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->assoc_class, - handler->assoc_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Association class given is not valid for" - "this association"); - goto out; - } - CU_DEBUG("Match_class succeeded, calling handler->handler..."); - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { @@ -256,32 +288,22 @@ static CMPIStatus do_ref(struct std_asso const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; - int i; struct std_assoc *handler; - bool rc; + int i; inst_list_init(&list); - handler = std_assoc_get_handler(ctx, ref); + CU_DEBUG("Getting handler..."); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->assoc_class); - if (!rc) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) goto out; From kaitlin at linux.vnet.ibm.com Thu Nov 29 02:45:22 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 18:45:22 -0800 Subject: [Libvirt-cim] [PATCH] Enhance handling of input parameter of std_association logic In-Reply-To: <474DE34B.8090104@linux.vnet.ibm.com> References: <474C66B7.6010605@linux.vnet.ibm.com> <474DE34B.8090104@linux.vnet.ibm.com> Message-ID: <474E27C2.3040303@linux.vnet.ibm.com> Heidi Eckhart wrote: > The problem was, that I swapped the classes - the next patch will show > it correct: > + rop = CMNewObjectPath(broker, ns, comp_class, NULL); > + > + if (CMClassPathIsA(broker, rop, test_class, NULL)) > return true; > > The CMPI Spec tells the following about CMClassPathIsA: > Function to determine whether a CIM class is of "type" or any of > "type" subclasses. > CMPIBoolean CMClassPathIsA (const CMPIBroker* mb, const > CMPIObjectPath* op, const char* type, CMPIStatus* rc) Thank for the clarification =) I've tripped myself up on the CMClassPathIsA() a few times. The updated changes look great. And the changes passed my quick unit tests. ;) > > So with the fixes your mentioned wbemain request works now. One thing > that also caused a problem was, that the classes > Xen/KVM_ComputerSystem and Xen/KVM_HostSystem haven't been registered > to the interop namespace (sure, why should they ... ;) ). This is now > also fixed with the patch for ECTP. But only the classes, not the > provider are registered, because the DMTF Profile Spec tells us, that > no instances of them are available in the interop namespace. It was my > fault to choose the one cross-namespace association we have for > implementing this functionality... ;). -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 02:48:45 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 18:48:45 -0800 Subject: [Libvirt-cim] [PATCH] ECTP: Adoption of changes to std_assoc struct in std_association In-Reply-To: <786976aa40c60088afe1.1196287299@localhost.localdomain> References: <786976aa40c60088afe1.1196287299@localhost.localdomain> Message-ID: <474E288D.5090505@linux.vnet.ibm.com> Heidi Eckhart wrote: > # HG changeset patch > # User Heidi Eckhart > # Date 1196287282 -3600 > # Node ID 786976aa40c60088afe17571372b4a5d82a0d29e > # Parent 535f219fe23fec8a5de725e0875e4fcdadbd584c > ECTP: Adoption of changes to std_assoc struct in std_association > This looks good and worked for me. =) I suspect this will have to be checked in as a part of a larger patchset since every class will be dependent on the libcmpiutil changes. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 02:55:35 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Wed, 28 Nov 2007 18:55:35 -0800 Subject: [Libvirt-cim] [PATCH 0 of 3] #3 - Enhance std association logic for reference lists and input parameter handling In-Reply-To: References: Message-ID: <474E2A27.2070304@linux.vnet.ibm.com> Heidi Eckhart wrote: > Please don't ask me what happened to the patch set before and why patch 3 was not submitted to the list. So resending the complete patch set once again ... and hope. > This patch set fixes: > - enhance the std_assoc struct to support lists for source, target and association classnames > - fixed a wrong error return for a NULL handler > - reworked check for input parameter: assocClass, resultClass, role, resultRole > The set looks good. I liked the added role, resultRole support. Also, I liked how you moved the checking of assocClass, resultClass, role, resultRole to std_assoc_get_handler() instead of do_assoc(). It seems like a more applicable place since std_assoc_get_handler() is supposed to determine whether the provider can handle the association, and if so, which function will be handling the call. Nice work =) +1 One odd thing I noticed about this patch set is that I could only get the ECTP association to build properly. It seems like the other associations need to be updated like ECTP before they will build properly. This is strange because I was able to build all of the associations with the first iteration of the patchset without problems. I didn't see anything obvious that would cause the change. It looks like all the providers will need to be updated at the same time the libcmpiutil pieces are checked in, which probably makes sense anyway. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Thu Nov 29 03:49:52 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 19:49:52 -0800 Subject: [Libvirt-cim] [PATCH 1 of 2] Fix issue with VSMC enum In-Reply-To: <34d66c74e3801796f89c.1196288210@elm3b41.beaverton.ibm.com> (Kaitlin Rupert's message of "Wed, 28 Nov 2007 14:16:50 -0800") References: <34d66c74e3801796f89c.1196288210@elm3b41.beaverton.ibm.com> Message-ID: <878x4hd82n.fsf@theine.beaverton.ibm.com> KR> - KR> - s = get_vsm_cap(_BROKER, ref, &inst); KR> + char hostname[256] = {0}; KR> + KR> + if (gethostname(hostname, sizeof(hostname) - 1) != 0) KR> + strcpy(hostname, "unknown"); KR> + KR> + s = get_vsm_cap(_BROKER, ref, hostname, &inst); This needs to be a call into the HostSystem provider. Right now, the name of the hostname *is* the hostname, but if we rely on other existing instrumentation for the host system, we might break here. The purpose of Virt_HostSystem was to be a placeholder so we wouldn't need to change several other providers if we changed where we get the host system information from. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 29 03:53:03 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 19:53:03 -0800 Subject: [Libvirt-cim] [PATCH 0 of 3] #2 - Enhance std association logic for reference lists and input parameter handling In-Reply-To: (Heidi Eckhart's message of "Wed, 28 Nov 2007 22:53:39 +0200") References: Message-ID: <874pf5d7xc.fsf@theine.beaverton.ibm.com> HE> This patch set fixes: I'm happy with this now, but I don't want to commit it until we have a patch set to fix all the associations in libvirt-cim. Otherwise our libcmpiutil tip won't work with libvirt-cim tip. If you have a patch set already, please send it on, or send whatever you have done so far. I'll be glad to finish up the conversions tomorrow. Thanks Heidi! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 29 03:53:51 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 19:53:51 -0800 Subject: [Libvirt-cim] [PATCH] ECTP: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474DE5F1.9030702@linux.vnet.ibm.com> (Heidi Eckhart's message of "Wed, 28 Nov 2007 23:04:33 +0100") References: <786976aa40c60088afe1.1196287299@localhost.localdomain> <474DE5F1.9030702@linux.vnet.ibm.com> Message-ID: <87zlwxbtbk.fsf@theine.beaverton.ibm.com> HE> I will cook up the patches for the other associations tomorrow. This HE> one is for verification purpose. Great, thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 29 03:55:17 2007 From: danms at us.ibm.com (Dan Smith) Date: Wed, 28 Nov 2007 19:55:17 -0800 Subject: [Libvirt-cim] [PATCH 0 of 3] #3 - Enhance std association logic for reference lists and input parameter handling In-Reply-To: <474E2A27.2070304@linux.vnet.ibm.com> (Kaitlin Rupert's message of "Wed, 28 Nov 2007 18:55:35 -0800") References: <474E2A27.2070304@linux.vnet.ibm.com> Message-ID: <87ve7lbt96.fsf@theine.beaverton.ibm.com> KR> One odd thing I noticed about this patch set is that I could only get KR> the ECTP association to build properly. It seems like the other KR> associations need to be updated like ECTP before they will build KR> properly. Yeah, they'll all need a change for sure. KR> This is strange because I was able to build all of the KR> associations with the first iteration of the patchset without KR> problems. Maybe you didn't do a clean first? The libvirt-cim build system won't notice changes in the libcmpiutil stuff in order to force a clean rebuild. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:53 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:53 +0200 Subject: [Libvirt-cim] [PATCH 00 of 12] #1 - Adoption of changes to std_assoc struct in std_association for all associations Message-ID: This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:54 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:54 +0200 Subject: [Libvirt-cim] [PATCH 01 of 12] ECTP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196333528 -3600 # Node ID af7ce48b18bed937d49df9d4073cac564c391971 # Parent c478a5b30689a80159588c8f914ac97263694372 ECTP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. It also adds the registration of ComputerSystem and HostSystem to the interop namespace. This is necessary to check the client's resultClass value. Signed-off-by: Heidi Eckhart diff -r c478a5b30689 -r af7ce48b18be Makefile.am --- a/Makefile.am Wed Nov 28 11:06:22 2007 -0800 +++ b/Makefile.am Thu Nov 29 11:52:08 2007 +0100 @@ -36,6 +36,8 @@ MOFS = \ schema/ElementSettingData.mof INTEROP_MOFS = \ + schema/ComputerSystem.mof \ + schema/HostSystem.mof \ schema/RegisteredProfile.mof \ schema/ElementConformsToProfile.mof diff -r c478a5b30689 -r af7ce48b18be src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Thu Nov 29 11:52:08 2007 +0100 @@ -222,27 +222,47 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } +char* conformant_standard[] = { + "Xen_RegisteredProfile", + "KVM_RegisteredProfile", + NULL +}; + +char* managed_element[] = { + "Xen_HostSystem", + "Xen_ComputerSystem", + "KVM_HostSystem", + "KVM_ComputerSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementConformsToProfile", + "KVM_ElementConformsToProfile", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", + .source_class = (char**)&conformant_standard, .source_prop = "ConformantStandard", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = prof_to_elem, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_ManagedElement", + .source_class = (char**)&managed_element, .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = (char**)&conformant_standard, .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = elem_to_prof, .make_ref = make_ref @@ -253,7 +273,6 @@ struct std_assoc *assoc_handlers[] = { &backward, NULL }; - STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:56 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:56 +0200 Subject: [Libvirt-cim] [PATCH 03 of 12] EC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <38068b513857c8cb64a3.1196342096@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196338264 -3600 # Node ID 38068b513857c8cb64a3f5c808f0bd42e272dfb9 # Parent d8dbe141c0b4a99c4ee0d380c8bcfe6abb6d8d66 EC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r d8dbe141c0b4 -r 38068b513857 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Thu Nov 29 12:02:50 2007 +0100 +++ b/src/Virt_ElementCapabilities.c Thu Nov 29 13:11:04 2007 +0100 @@ -237,21 +237,23 @@ static CMPIStatus pool_to_alloc(const CM out: return s; } + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->assoc_class); - if (base == NULL) + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *refinst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "ElementCapabilities", NAMESPACE(ref)); if (refinst != NULL) { @@ -265,109 +267,146 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&instop, CMPI_ref); } - free(base); + virConnectClose(conn); return refinst; } +char* assoc_classname[] = { + "Xen_ElementCapabilities", + "KVM_ElementCapabilities", + NULL +}; + +char* host_system[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* virtual_system_management_capabilities[] = { + "Xen_VirtualSystemManagementCapabilities", + "KVM_VirtualSystemManagementCapabilities", + NULL +}; + struct std_assoc system_to_vsm_cap = { - .source_class = "CIM_System", + .source_class = (char**)&host_system, .source_prop = "ManagedElement", - .target_class = "CIM_VirtualSystemManagementCapabilities", + .target_class = (char**)&virtual_system_management_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = sys_to_cap, .make_ref = make_ref }; struct std_assoc vsm_cap_to_system = { - .source_class = "CIM_VirtualSystemManagementCapabilities", + .source_class = (char**)&virtual_system_management_capabilities, .source_prop = "Capabilities", - .target_class = "CIM_System", + .target_class = (char**)&host_system, .target_prop = "ManagedElement", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = cap_to_sys, .make_ref = make_ref }; -struct std_assoc xen_cs_to_ele_cap = { - .source_class = "Xen_ComputerSystem", +char* computer_system[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* enabled_logical_element_capabilities[] = { + "Xen_EnabledLogicalElementCapabilities", + "KVM_EnabledLogicalElementCapabilities", + NULL +}; + +struct std_assoc ele_cap_to_cs = { + .source_class = (char**)&enabled_logical_element_capabilities, + .source_prop = "Capabilities", + + .target_class = (char**)&computer_system, + .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, + + .handler = cap_to_cs, + .make_ref = make_ref +}; + +struct std_assoc cs_to_ele_cap = { + .source_class = (char**)&computer_system, .source_prop = "ManagedElement", - .target_class = "CIM_EnabledLogicalElementCapabilities", + .target_class = (char**)&enabled_logical_element_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = cs_to_cap, .make_ref = make_ref }; -struct std_assoc kvm_cs_to_ele_cap = { - .source_class = "KVM_ComputerSystem", +char* allocation_capabilities[] = { + "Xen_AllocationCapabilities", + "KVM_AllocationCapabilities", + NULL +}; + +char* resource_pool[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +struct std_assoc alloc_cap_to_resource_pool = { + .source_class = (char**)&allocation_capabilities, + .source_prop = "Capabilities", + + .target_class = (char**)&resource_pool, + .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, + + .handler = alloc_to_pool, + .make_ref = make_ref +}; + +struct std_assoc resource_pool_to_alloc_cap = { + .source_class = (char**)&resource_pool, .source_prop = "ManagedElement", - .target_class = "CIM_EnabledLogicalElementCapabilities", + .target_class = (char**)&allocation_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", - - .handler = cs_to_cap, - .make_ref = make_ref -}; - -struct std_assoc ele_cap_to_computer_system = { - .source_class = "CIM_EnabledLogicalElementCapabilities", - .source_prop = "Capabilities", - - .target_class = "CIM_ComputerSystem", - .target_prop = "ManagedElement", - - .assoc_class = "CIM_ElementCapabilities", - - .handler = cap_to_cs, - .make_ref = make_ref -}; - -struct std_assoc alloc_cap_to_resource_pool = { - .source_class = "CIM_AllocationCapabilities", - .source_prop = "Capabilities", - - .target_class = "CIM_ResourcePool", - .target_prop = "ManagedElement", - - .handler = alloc_to_pool, - .make_ref = make_ref -}; - -struct std_assoc resource_pool_to_alloc_cap = { - .source_class = "CIM_ResourcePool", - .source_prop = "ManagedElement", - - .target_class = "CIM_AllocationCapabilities", - .target_prop = "Capabilities", + .assoc_class = (char**)&assoc_classname, .handler = pool_to_alloc, .make_ref = make_ref }; struct std_assoc *assoc_handlers[] = { - &xen_cs_to_ele_cap, - &kvm_cs_to_ele_cap, &system_to_vsm_cap, &vsm_cap_to_system, - &ele_cap_to_computer_system, + &ele_cap_to_cs, + &cs_to_ele_cap, &alloc_cap_to_resource_pool, &resource_pool_to_alloc_cap, NULL }; - STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:57 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:57 +0200 Subject: [Libvirt-cim] [PATCH 04 of 12] ESD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <36e16117e8b18e85a489.1196342097@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339009 -3600 # Node ID 36e16117e8b18e85a4898879091b919074dc44dc # Parent 38068b513857c8cb64a3f5c808f0bd42e272dfb9 ESD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 38068b513857 -r 36e16117e8b1 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Thu Nov 29 13:11:04 2007 +0100 +++ b/src/Virt_ElementSettingData.c Thu Nov 29 13:23:29 2007 +0100 @@ -129,17 +129,18 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *refinst = NULL; - char *base; + virConnectPtr conn = NULL; uint16_t prop_value = 1; - base = class_base_name(assoc->assoc_class); - if (base == NULL) - goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "ElementSettingData", NAMESPACE(ref)); if (refinst != NULL) { @@ -165,33 +166,55 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&prop_value, CMPI_uint16); } -out: - free(base); + virConnectClose(conn); return refinst; } +char* virtual_system_setting_data[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* resource_allocation_setting_data[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* managed_element[] = { + "CIM_ManagedElement", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementSettingData", + "KVM_ElementSettingData", + NULL +}; + static struct std_assoc _vssd_to_vssd = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&virtual_system_setting_data, .source_prop = "ManagedElement", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "SettingData", - .assoc_class = "CIM_ElementSettingData", + .assoc_class = (char**)&assoc_classname, .handler = vssd_to_vssd, .make_ref = make_ref }; static struct std_assoc _rasd_to_rasd = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&resource_allocation_setting_data, .source_prop = "ManagedElement", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "SettingData", - .assoc_class = "CIM_ElementSettingData", + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_rasd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:58 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:58 +0200 Subject: [Libvirt-cim] [PATCH 05 of 12] HD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <69f4e34c1187ac9013cf.1196342098@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339320 -3600 # Node ID 69f4e34c1187ac9013cf779f78c2831544b4a5a4 # Parent 36e16117e8b18e85a4898879091b919074dc44dc HD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 36e16117e8b1 -r 69f4e34c1187 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Thu Nov 29 13:23:29 2007 +0100 +++ b/src/Virt_HostedDependency.c Thu Nov 29 13:28:40 2007 +0100 @@ -99,55 +99,54 @@ static CMPIInstance *make_ref(const CMPI return refinst; } -static struct std_assoc xen_vs_to_host = { - .source_class = "Xen_ComputerSystem", +char* antecedent[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* dependent[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedDependency", + "KVM_HostedDependency", + NULL +}; + +static struct std_assoc _vs_to_host = { + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "Xen_HostSystem", - .source_prop = "Dependent", + .target_class = (char**)&dependent, + .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = vs_to_host, .make_ref = make_ref }; -static struct std_assoc kvm_vs_to_host = { - .source_class = "KVM_ComputerSystem", - .source_prop = "Antecedent", - - .target_class = "KVM_HostSystem", +static struct std_assoc _host_to_vs = { + .source_class = (char**)&dependent, .source_prop = "Dependent", - .handler = vs_to_host, - .make_ref = make_ref -}; + .target_class = (char**)&antecedent, + .target_prop = "Antecedent", -static struct std_assoc xen_host_to_vs = { - .source_class = "Xen_HostSystem", - .source_prop = "Dependent", - - .target_class = "Xen_ComputerSystem", - .target_prop = "Antecedent", + .assoc_class = (char**)&assoc_classname, .handler = host_to_vs, .make_ref = make_ref }; -static struct std_assoc kvm_host_to_vs = { - .source_class = "KVM_HostSystem", - .source_prop = "Dependent", - - .target_class = "KVM_ComputerSystem", - .target_prop = "Antecedent", - - .handler = host_to_vs, - .make_ref = make_ref -}; static struct std_assoc *handlers[] = { - &xen_vs_to_host, - &xen_host_to_vs, - &kvm_vs_to_host, - &kvm_host_to_vs, + &_vs_to_host, + &_host_to_vs, NULL }; From heidieck at linux.vnet.ibm.com Thu Nov 29 12:15:00 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:15:00 +0200 Subject: [Libvirt-cim] [PATCH 07 of 12] HS: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <0f6cf316d454a485c3cc.1196342100@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196340080 -3600 # Node ID 0f6cf316d454a485c3cc965305dd353664873d1f # Parent 8a75970ed83c888e50b7b83360078c8ab32316db HS: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 8a75970ed83c -r 0f6cf316d454 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Thu Nov 29 13:33:17 2007 +0100 +++ b/src/Virt_HostedService.c Thu Nov 29 13:41:20 2007 +0100 @@ -81,16 +81,17 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *refinst = NULL; - char *base; + virConnectPtr conn = NULL; - base = class_base_name(assoc->assoc_class); - if (base == NULL) - goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "HostedService", NAMESPACE(ref)); if (refinst != NULL) { @@ -101,67 +102,58 @@ static CMPIInstance *make_ref(const CMPI set_reference(assoc, refinst, ref, instop); } -out: + virConnectClose(conn); + return refinst; } -static struct std_assoc xen_host_to_service = { - .source_class = "Xen_HostSystem", +char* antecedent[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* dependent[] = { + "Xen_VirtualSystemManagementService", + "KVM_VirtualSystemManagementService", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedService", + "KVM_HostedService", + NULL +}; + +static struct std_assoc _host_to_service = { + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&dependent, .target_prop = "Dependent", - .assoc_class = "CIM_HostedService", + .assoc_class = (char**)&assoc_classname, .handler = host_to_service, .make_ref = make_ref }; -static struct std_assoc xen_service_to_host = { - .source_class = "CIM_Service", +static struct std_assoc _service_to_host = { + .source_class = (char**)&dependent, .source_prop = "Dependent", - - .target_class = "CIM_ManagedElement", + + .target_class = (char**)&antecedent, .target_prop = "Antecedent", - .assoc_class = "CIM_HostedService", - - .handler = service_to_host, - .make_ref = make_ref -}; - -static struct std_assoc kvm_host_to_service = { - .source_class = "KVM_HostSystem", - .source_prop = "Antecedent", - - .target_class = "CIM_Service", - .target_prop = "Dependent", - - .assoc_class = "CIM_HostedService", - - .handler = host_to_service, - .make_ref = make_ref -}; - -static struct std_assoc kvm_service_to_host = { - .source_class = "CIM_Service", - .source_prop = "Dependent", - - .target_class = "KVM_ComputerSystem", - .target_prop = "Antecedent", - - .assoc_class = "CIM_HostedService", - + .assoc_class = (char**)&assoc_classname, + .handler = service_to_host, .make_ref = make_ref }; static struct std_assoc *handlers[] = { - &xen_host_to_service, - &xen_service_to_host, - &kvm_host_to_service, - &kvm_service_to_host, + &_host_to_service, + &_service_to_host, NULL }; From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:59 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:59 +0200 Subject: [Libvirt-cim] [PATCH 06 of 12] HRP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <8a75970ed83c888e50b7.1196342099@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339597 -3600 # Node ID 8a75970ed83c888e50b7b83360078c8ab32316db # Parent 69f4e34c1187ac9013cf779f78c2831544b4a5a4 HRP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 69f4e34c1187 -r 8a75970ed83c src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Thu Nov 29 13:28:40 2007 +0100 +++ b/src/Virt_HostedResourcePool.c Thu Nov 29 13:33:17 2007 +0100 @@ -119,27 +119,51 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* group_component[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* part_component[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedResourcePool", + "KVM_HostedResourcePool", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_System", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = pool_to_sys, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_System", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourcePool", + .target_class = (char**)&part_component, .target_prop = "PartComponent", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = sys_to_pool, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 12:15:01 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:15:01 +0200 Subject: [Libvirt-cim] [PATCH 08 of 12] RAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <3b849faf8ee17556ff39.1196342101@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196340286 -3600 # Node ID 3b849faf8ee17556ff39993a43ca3759f8604859 # Parent 0f6cf316d454a485c3cc965305dd353664873d1f RAFP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 0f6cf316d454 -r 3b849faf8ee1 src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Thu Nov 29 13:41:20 2007 +0100 +++ b/src/Virt_ResourceAllocationFromPool.c Thu Nov 29 13:44:46 2007 +0100 @@ -243,23 +243,51 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* antecedent[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* dependent[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_ResourceAllocationFromPool", + "KVM_ResourceAllocationFromPool", + NULL +}; + static struct std_assoc _rasd_to_pool = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&dependent, .source_prop = "Dependent", - - .target_class = "CIM_ResourcePool", + + .target_class = (char**)&antecedent, .target_prop = "Antecedent", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_pool, .make_ref = make_ref }; static struct std_assoc _pool_to_rasd = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&dependent, .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = pool_to_rasd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 12:15:03 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:15:03 +0200 Subject: [Libvirt-cim] [PATCH 10 of 12] SDS: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <06cf0d4357cbfc21a051.1196342103@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196341011 -3600 # Node ID 06cf0d4357cbfc21a051f26659f5c64dc2cc0c16 # Parent 559a1c5a58401f7437037cb54219dda6914e3c81 SDS: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 559a1c5a5840 -r 06cf0d4357cb src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Thu Nov 29 13:50:36 2007 +0100 +++ b/src/Virt_SettingsDefineState.c Thu Nov 29 13:56:51 2007 +0100 @@ -301,33 +301,73 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* logical_device[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* resource_allocation_setting_data[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* computer_system[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* virtual_system_setting_data[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_SettingsDefineState", + "KVM_SettingsDefineState", + NULL +}; + static struct std_assoc _dev_to_rasd = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&logical_device, .source_prop = "ManagedElement", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&resource_allocation_setting_data, .target_prop = "SettingData", + + .assoc_class = (char**)&assoc_classname, .handler = dev_to_rasd, .make_ref = make_ref }; static struct std_assoc _rasd_to_dev = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&resource_allocation_setting_data, .source_prop = "SettingData", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&logical_device, .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_dev, .make_ref = make_ref }; static struct std_assoc _vs_to_vssd = { - .source_class = "CIM_ComputerSystem", + .source_class = (char**)&computer_system, .source_prop = "ManagedElement", - .target_class = "CIM_VirtualSystemSettingData", + .target_class = (char**)&virtual_system_setting_data, .target_prop = "SettingData", .handler = vs_to_vssd, @@ -335,10 +375,10 @@ static struct std_assoc _vs_to_vssd = { }; static struct std_assoc _vssd_to_vs = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&virtual_system_setting_data, .source_prop = "SettingData", - .target_class = "CIM_ComputerSystem", + .target_class = (char**)&computer_system, .target_prop = "ManagedElement", .handler = vssd_to_vs, From heidieck at linux.vnet.ibm.com Thu Nov 29 12:15:02 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:15:02 +0200 Subject: [Libvirt-cim] [PATCH 09 of 12] SDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <559a1c5a58401f743703.1196342102@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196340636 -3600 # Node ID 559a1c5a58401f7437037cb54219dda6914e3c81 # Parent 3b849faf8ee17556ff39993a43ca3759f8604859 SDC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 3b849faf8ee1 -r 559a1c5a5840 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 29 13:44:46 2007 +0100 +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 29 13:50:36 2007 +0100 @@ -811,16 +811,17 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->assoc_class); - if (base == NULL) + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *refinst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "SettingsDefineCapabilities", NAMESPACE(ref)); if (refinst != NULL) { @@ -834,32 +835,50 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&instop, CMPI_ref); } - free(base); + virConnectClose(conn); return refinst; } +char* group_component[] = { + "Xen_AllocationCapabilities", + "KVM_AllocationCapabilities", + NULL +}; + +char* part_component[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_SettingsDefineCapabilities", + "KVM_SettingsDefineCapabilities", + NULL +}; + struct std_assoc _alloc_cap_to_rasd = { - .source_class = "CIM_AllocationCapabilities", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&part_component, .target_prop = "PartComponent", - .assoc_class = "CIM_SettingsDefineCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = alloc_cap_to_rasd, .make_ref = make_ref }; struct std_assoc _rasd_to_alloc_cap = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_AllocationCapabilities", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", - .assoc_class = "CIM_SettingsDefineCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_alloc_cap, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 12:15:04 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:15:04 +0200 Subject: [Libvirt-cim] [PATCH 11 of 12] SD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <357d15061ef722c1e019.1196342104@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196341254 -3600 # Node ID 357d15061ef722c1e01936f2a3faeed638526938 # Parent 06cf0d4357cbfc21a051f26659f5c64dc2cc0c16 SD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 06cf0d4357cb -r 357d15061ef7 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Thu Nov 29 13:56:51 2007 +0100 +++ b/src/Virt_SystemDevice.c Thu Nov 29 14:00:54 2007 +0100 @@ -244,23 +244,51 @@ static CMPIStatus dev_to_sys(const CMPIO return s; } +char* group_component[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* part_component[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* assoc_classname[] = { + "Xen_SystemDevice", + "KVM_SystemDevice", + NULL +}; + static struct std_assoc forward = { - .source_class = "CIM_System", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&part_component, .target_prop = "PartComponent", + + .assoc_class = (char**)&assoc_classname, .handler = sys_to_dev, .make_ref = make_ref }; static struct std_assoc backward = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_System", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", + + .assoc_class = (char**)&assoc_classname, .handler = dev_to_sys, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 12:15:05 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:15:05 +0200 Subject: [Libvirt-cim] [PATCH 12 of 12] VSSDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <9e735b67588fd2cfa522.1196342105@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196341434 -3600 # Node ID 9e735b67588fd2cfa522a19fb4e48fc158196586 # Parent 357d15061ef722c1e01936f2a3faeed638526938 VSSDC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 357d15061ef7 -r 9e735b67588f src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Thu Nov 29 14:00:54 2007 +0100 +++ b/src/Virt_VSSDComponent.c Thu Nov 29 14:03:54 2007 +0100 @@ -173,23 +173,46 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* group_component[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* part_component[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_VirtualSystemSettingDataComponent", + "KVM_VirtualSystemSettingDataComponent", + NULL +}; + + static struct std_assoc forward = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&part_component, .target_prop = "PartComponent", + + .assoc_class = (char**)&assoc_classname, .handler = vssd_to_rasd, .make_ref = make_ref }; static struct std_assoc backward = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_VirtualSystemSettingData", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_vssd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 12:14:55 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:14:55 +0200 Subject: [Libvirt-cim] [PATCH 02 of 12] EAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196334170 -3600 # Node ID d8dbe141c0b4a99c4ee0d380c8bcfe6abb6d8d66 # Parent af7ce48b18bed937d49df9d4073cac564c391971 EAFP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r af7ce48b18be -r d8dbe141c0b4 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Thu Nov 29 11:52:08 2007 +0100 +++ b/src/Virt_ElementAllocatedFromPool.c Thu Nov 29 12:02:50 2007 +0100 @@ -264,23 +264,57 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* antecedent[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* dependent[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementAllocatedFromPool", + "KVM_ElementAllocatedFromPool", + NULL +}; + static struct std_assoc _vdev_to_pool = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&dependent, .source_prop = "Dependent", - .target_class = "CIM_ResourcePool", + .target_class = (char**)&antecedent, .target_prop = "Antecedent", + + .assoc_class = (char**)&assoc_classname, .handler = vdev_to_pool, .make_ref = make_ref }; static struct std_assoc _pool_to_vdev = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&dependent, .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = pool_to_vdev, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Thu Nov 29 13:30:14 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Thu, 29 Nov 2007 14:30:14 +0100 Subject: [Libvirt-cim] [PATCH 00 of 12] #1 - Adoption of changes to std_assoc struct in std_association for all associations In-Reply-To: References: Message-ID: <474EBEE6.9010506@linux.vnet.ibm.com> Heidi Eckhart wrote: > This is the follow up patch to the API changes made in > std_association. The struct std_assoc does now take lists > for source, target and assoc classnames. > Mhh .. forgot to tell: please review. The compiler did not complain about something and I've tested some of them, but not all as I was not able to get references for each one. thanks ... Heidi -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From grendel at linux.vnet.ibm.com Thu Nov 29 14:32:23 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 29 Nov 2007 10:32:23 -0400 Subject: [Libvirt-cim] [PATCH] Patch guidelines added to SubmittingPatches Message-ID: # HG changeset patch # User Jay Gagnon # Date 1196350280 18000 # Node ID a4193d586c20dd4aa9767f1299d9a1e91c0786a8 # Parent c478a5b30689a80159588c8f914ac97263694372 Patch guidelines added to SubmittingPatches. I did a bit of editing from the original suggestions, so any grammar-minded people should probably run through it once. I also incorporated the following from the team call: The two "stay on track"-style rules were merged. Patch numbering for resends was expanded to all patches, not just patchsets. Including an example test for edge cases was added. Patch dependency handling was added. Signed-off-by: Jay Gagnon diff -r c478a5b30689 -r a4193d586c20 doc/SubmittingPatches --- a/doc/SubmittingPatches Wed Nov 28 11:06:22 2007 -0800 +++ b/doc/SubmittingPatches Thu Nov 29 10:31:20 2007 -0500 @@ -33,3 +33,91 @@ using your real name (sorry, no pseudony using your real name (sorry, no pseudonyms or anonymous contributions.) + +Guidelines for Submitting Patches. + + Patches should be submitted using Mercurial's patchbomb extension, + and we recommend using the queues extension as well. On top of that, + we have some guidelines you should follow when submitting patches. + This makes reviewing patches easier, which in turns improves the + chances of your patch being accepted in a timely fashion. + +Single Patches: + + (a) When you add a patch to the queue you have an idea of where you're + going with it, and the commit message should reflect that. Be + specific. Avoid just saying something like, "Various fixes to + AllocationCapabilities." Add a list of what was actually fixed, + like, "Add EnumInstanceNames support," and, "Eliminate duplicate + instances." + + (b) The first line of your commit message will be the subject of the + patch email when you send it out, so write it like a subject. Keep + it short and to the point, then start a new line and feel free to be + as verbose as you need to be. The entire commit message will be + included in the patch. + + (c) Stay on task with a patch. If you notice other problems while you + are working on patch, and they are not most definitely specific to + your patch, they should be another patch. The same goes for + nitpicking. While it might be only a line or two here and there + that is off track, this is actually one of the easiest ways to make + a patch difficult to review. All the trivial changes hide what is + really going on. Make the unrelated changes a new patch or don't + make them at all. + + (d) If your patch addresses a strange issue or a rare edge case that + the reviewers are unlikely to be familiar with, make sure the commit + message include some example testcase with results, so the reviewers + can verify your patch more quickly. + + (e) Before you email, export. If you have a patch called "alloc_fixes", + which would be emailed with "hg email alloc_fixes", you should first + run "hg export alloc_fixes". This lets you review your patch. Does + it have any typos in the comments? Did you accidentally include an + irrelevant change? Is your commit message still accurate and useful? + This is the single biggest step in ensuring you have a good patch. + + (f) If your patch needs to be reworked and resent, prepend a "version + number" to the first line of the commit message. For example, "Add + EnumInstance to RASD," becomes "#2 Add EnumInstance to RASD." This + helps mail readers thread discussions correctly and helps + maintainers know they are applying the right version of your patch. + At the end of the commit message, explain what is different from one + version to the next. Nobody likes having to diff a diff. + + (g) If your patch depends on a patch that exists on the mailing list but + not in the tree, it is okay to send your patch to the list as long + as your commit message mentions the dependency. It is also a good + idea to import the patch into your tree before you make your patch. + For example, a new patch called "cu_statusf API change" is on the + list, and your patch needs the new API. Save the email (no need to + trim headers) as api_change.eml, then do "hg qimport api_change.eml" + and "hg qpush" so that the patch is applied to your tree. Now write + your patch on top of it. You should still indicate the dependency + in your commit message. + + +Patchsets: + + (a) When you send a group of patches, Mercurial's email extension will + create a "header" email. Make the subject and body of that email + meaningful, so we know how the patches relate. It's easy to say, + "Each patch has a commit message, it's obvious how they work + together," but the rest of the list usually won't agree with that. + If the commit messages for each patch are good, you shouldn't need + more than a sentence or two to tie them all together, but you do + need it. + + (b) If any of your patches are rejected and you rework them, resend the + entire set. This prevents things like, "So use patch 1 of 4 from + the set I sent yesterday, 2 and 3 of 4 from the patch I sent an hour + later, and patch 4 of 4 from today." + + (c) If you resend a patchset, apply part (f) of the Single Patches + guidelines to your "Patch [0 of 3]" header email, for all the same + reasons. + +Questions/Comments on the Guidelines should be directed to: +Jay Gagnon +Patch Compliance Officer \ No newline at end of file From danms at us.ibm.com Thu Nov 29 16:21:51 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 29 Nov 2007 08:21:51 -0800 Subject: [Libvirt-cim] [PATCH] Patch guidelines added to SubmittingPatches In-Reply-To: (Jay Gagnon's message of "Thu, 29 Nov 2007 10:32:23 -0400") References: Message-ID: <87mysxauow.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1196350280 18000 JG> # Node ID a4193d586c20dd4aa9767f1299d9a1e91c0786a8 JG> # Parent c478a5b30689a80159588c8f914ac97263694372 JG> Patch guidelines added to SubmittingPatches. Looks good to me. I'll let it fester on the list for comments for a bit. Did you want to add a page to the web content for this as well? Either that or a pointer on one of the existing pages to this file might be a good idea. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Thu Nov 29 16:40:17 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 29 Nov 2007 08:40:17 -0800 Subject: [Libvirt-cim] [PATCH 03 of 12] EC: Adoption of changes to std_assoc struct in std_association In-Reply-To: <38068b513857c8cb64a3.1196342096@localhost.localdomain> (Heidi Eckhart's message of "Thu, 29 Nov 2007 14:14:56 +0200") References: <38068b513857c8cb64a3.1196342096@localhost.localdomain> Message-ID: <87ir3latu6.fsf@theine.beaverton.ibm.com> HE> --- a/src/Virt_ElementCapabilities.c Thu Nov 29 12:02:50 2007 +0100 HE> +++ b/src/Virt_ElementCapabilities.c Thu Nov 29 13:11:04 2007 +0100 HE> @@ -237,21 +237,23 @@ static CMPIStatus pool_to_alloc(const CM HE> out: HE> return s; HE> } HE> + HE> static CMPIInstance *make_ref(const CMPIObjectPath *ref, HE> const CMPIInstance *inst, HE> struct std_assoc_info *info, HE> struct std_assoc *assoc) HE> { HE> - CMPIInstance *refinst; HE> - char *base; HE> - HE> - base = class_base_name(assoc->assoc_class); HE> - if (base == NULL) HE> + CMPIStatus s = {CMPI_RC_OK, NULL}; HE> + CMPIInstance *refinst = NULL; HE> + virConnectPtr conn = NULL; HE> + HE> + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); HE> + if (conn == NULL) HE> return NULL; HE> refinst = get_typed_instance(_BROKER, HE> - CLASSNAME(ref), HE> - base, HE> + pfx_from_conn(conn), HE> + "ElementCapabilities", HE> NAMESPACE(ref)); HE> if (refinst != NULL) { HE> @@ -265,109 +267,146 @@ static CMPIInstance *make_ref(const CMPI HE> (CMPIValue *)&instop, CMPI_ref); HE> } HE> - free(base); HE> + virConnectClose(conn); HE> return refinst; HE> } Hmm, are either of these hunks related to the API change? -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Thu Nov 29 17:11:36 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 09:11:36 -0800 Subject: [Libvirt-cim] [PATCH 07 of 12] HS: Adoption of changes to std_assoc struct in std_association In-Reply-To: <0f6cf316d454a485c3cc.1196342100@localhost.localdomain> References: <0f6cf316d454a485c3cc.1196342100@localhost.localdomain> Message-ID: <474EF2C8.1020306@linux.vnet.ibm.com> Heidi Eckhart wrote: > + CMPIStatus s = {CMPI_RC_OK, NULL}; > CMPIInstance *refinst = NULL; > - char *base; > + virConnectPtr conn = NULL; > > - base = class_base_name(assoc->assoc_class); > - if (base == NULL) > - goto out; > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + if (conn == NULL) > + return NULL; > > refinst = get_typed_instance(_BROKER, > - CLASSNAME(ref), > - base, > + pfx_from_conn(conn), > + "HostedService", > NAMESPACE(ref)); > > if (refinst != NULL) { > @@ -101,67 +102,58 @@ static CMPIInstance *make_ref(const CMPI > set_reference(assoc, refinst, ref, instop); > } > > -out: > + virConnectClose(conn); > + > return refinst; > I think this patch has some unrelated changes. Could this be sent as a separate patch? > +char* dependent[] = { > + "Xen_VirtualSystemManagementService", > + "KVM_VirtualSystemManagementService", > + NULL > +}; > + > This provider also supports ResourcePoolConfigurationService - could that be added as well?. Whew - this patch cleaned up a lot of redundant std_assoc blocks. Nicely done. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 17:37:42 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 09:37:42 -0800 Subject: [Libvirt-cim] [PATCH 08 of 12] RAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: <3b849faf8ee17556ff39.1196342101@localhost.localdomain> References: <3b849faf8ee17556ff39.1196342101@localhost.localdomain> Message-ID: <474EF8E6.1000503@linux.vnet.ibm.com> Heidi Eckhart wrote: > + > +char* dependent[] = { > + "Xen_ResourceAllocationSettingData", > + "KVM_ResourceAllocationSettingData", > + NULL > +}; > + > Using -arc Xen_ProcResourceAllocationSettingData in a query doesn't work, but using -arc Xen_ResourceAllocationSettingData does work. Should Xen_ProcResourceAllocationSettingData, etc also added to the list? The instances we're returning aren't of type Xen_ResourceAllocationSettingData, so it seems like we should accept result class values that correspond to the class type we return. However, the Virt_ResourceAllocationSettingData provider trips me up more often than it should, so I might be way off base here. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 17:50:57 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 09:50:57 -0800 Subject: [Libvirt-cim] [PATCH 3 of 3] Enhance handling of input parameter of std_association logic In-Reply-To: References: Message-ID: <474EFC01.5070501@linux.vnet.ibm.com> Heidi Eckhart wrote: Sorry for revisiting this patch. I failed to test references yesterday, so I didn't catch this problem then. > static struct std_assoc * > std_assoc_get_handler(const struct std_assoc_ctx *ctx, > + struct std_assoc_info *info, > const CMPIObjectPath *ref) > { > > + > + if (info->assoc_class) { > + CU_DEBUG("Check client's assocClass: '%s'", > + info->assoc_class); > + > + rc = match_class(ctx->brkr, > + NAMESPACE(ref), > + info->assoc_class, > + ptr->assoc_class); > + > + if (!rc) { > + CU_DEBUG("AssocClass not valid."); > + goto out; > + } > + CU_DEBUG("AssocClass valid."); > + } > + > + if (info->result_class) { > + CU_DEBUG("Check client's resultClass: '%s'", > + info->result_class); > + > + rc = match_class(ctx->brkr, > + NAMESPACE(ref), > + info->result_class, > + ptr->target_class); > + > + if (!rc) { > + CU_DEBUG("ResultClass not valid."); > + goto out; > + } > + CU_DEBUG("ResultClass valid."); > + } This works for associations. But for references, the result class is the association class name. So, when you call std_assoc_get_handler() from do_ref(), you end up checking the client's result class (which is the association name) against the result class list instead of the association list. Here's some sample debug: std_association.c(152): Calling Provider: 'associationVirt_HostedDependencyProvider' std_association.c(182): Check client's resultClass: 'Xen_HostedDependency' std_association.c(78): provider accepts Xen_ComputerSystem resultclass std_association.c(78): provider accepts KVM_ComputerSystem resultclass std_association.c(190): ResultClass not valid. std_association.c(302): No handler found. You could add flag argument to std_assoc_get_handler() that indicates whether the call is asking for references or an associators. Although, I'm not sure that's the most elegant way. Also, adding the debug messages that print which values the provider is checking the result class / assoc class / etc might be useful - that is, print out what classes the provider accepts. Someone else can chime in as to whether this would be useful. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 18:53:56 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 10:53:56 -0800 Subject: [Libvirt-cim] [PATCH 11 of 12] SD: Adoption of changes to std_assoc struct in std_association In-Reply-To: <357d15061ef722c1e019.1196342104@localhost.localdomain> References: <357d15061ef722c1e019.1196342104@localhost.localdomain> Message-ID: <474F0AC4.2050804@linux.vnet.ibm.com> Heidi Eckhart wrote: > +char* group_component[] = { > + "Xen_HostSystem", > + "KVM_HostSystem", > + NULL > +}; > + > I believe SystemDevice also associates virtual devices to their corresponding virtual machines. So I think Xen_ComputerSystem and KVM_ComputerSystem need to be added to that list. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 18:56:45 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 10:56:45 -0800 Subject: [Libvirt-cim] [PATCH 09 of 12] SDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: <559a1c5a58401f743703.1196342102@localhost.localdomain> References: <559a1c5a58401f743703.1196342102@localhost.localdomain> Message-ID: <474F0B6D.3020209@linux.vnet.ibm.com> Heidi Eckhart wrote: > diff -r 3b849faf8ee1 -r 559a1c5a5840 src/Virt_SettingsDefineCapabilities.c > --- a/src/Virt_SettingsDefineCapabilities.c Thu Nov 29 13:44:46 2007 +0100 > +++ b/src/Virt_SettingsDefineCapabilities.c Thu Nov 29 13:50:36 2007 +0100 > @@ -811,16 +811,17 @@ static CMPIInstance *make_ref(const CMPI > struct std_assoc_info *info, > struct std_assoc *assoc) > { > - CMPIInstance *refinst; > - char *base; > - > - base = class_base_name(assoc->assoc_class); > - if (base == NULL) > + CMPIStatus s = {CMPI_RC_OK, NULL}; > + CMPIInstance *refinst = NULL; > + virConnectPtr conn = NULL; > + > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + if (conn == NULL) > return NULL; > > refinst = get_typed_instance(_BROKER, > - CLASSNAME(ref), > - base, > + pfx_from_conn(conn), > + "SettingsDefineCapabilities", > NAMESPACE(ref)); > > if (refinst != NULL) { > @@ -834,32 +835,50 @@ static CMPIInstance *make_ref(const CMPI > (CMPIValue *)&instop, CMPI_ref); > } > > - free(base); > + virConnectClose(conn); > > return refinst; > } Would it be possible to break these changes out into a separate patch as well? Good job catching these - I think there's enough for a connect_by_classname() patchset. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 19:03:16 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 11:03:16 -0800 Subject: [Libvirt-cim] [PATCH 10 of 12] SDS: Adoption of changes to std_assoc struct in std_association In-Reply-To: <06cf0d4357cbfc21a051.1196342103@localhost.localdomain> References: <06cf0d4357cbfc21a051.1196342103@localhost.localdomain> Message-ID: <474F0CF4.3040401@linux.vnet.ibm.com> Heidi Eckhart wrote: > + > +char* resource_allocation_setting_data[] = { > + "Xen_ResourceAllocationSettingData", > + "KVM_ResourceAllocationSettingData", > + NULL > +}; > I think this has the same potiential issue as RAFP: should we also include the specific subclasses of Xen_ResourceAllocationSettingData (Xen_ProcResourceAllocationSettingData, etc?) in the list? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 19:03:56 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 11:03:56 -0800 Subject: [Libvirt-cim] [PATCH 12 of 12] VSSDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: <9e735b67588fd2cfa522.1196342105@localhost.localdomain> References: <9e735b67588fd2cfa522.1196342105@localhost.localdomain> Message-ID: <474F0D1C.2080900@linux.vnet.ibm.com> Heidi Eckhart wrote: > +char* part_component[] = { > + "Xen_ResourceAllocationSettingData", > + "KVM_ResourceAllocationSettingData", > + NULL > +}; > + I think this has the same potiential issue as RAFP: should we also include the specific subclasses of Xen_ResourceAllocationSettingData (Xen_ProcResourceAllocationSettingData, etc?) in the list? -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 19:05:55 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 11:05:55 -0800 Subject: [Libvirt-cim] [PATCH 00 of 12] #1 - Adoption of changes to std_assoc struct in std_association for all associations In-Reply-To: <474EBEE6.9010506@linux.vnet.ibm.com> References: <474EBEE6.9010506@linux.vnet.ibm.com> Message-ID: <474F0D93.3030102@linux.vnet.ibm.com> Heidi Eckhart wrote: > Heidi Eckhart wrote: >> This is the follow up patch to the API changes made in >> std_association. The struct std_assoc does now take lists >> for source, target and assoc classnames. >> > Mhh .. forgot to tell: please review. The compiler did not complain > about something and I've tested some of them, but not all as I was not > able to get references for each one. > thanks ... Heidi > I was able to test most things, but I ran into a few problems too. =) I'm seeing issues from SettingsDefineCapabilities and SystemDevice. I've also tested these on a clean tree (no patches), and I see the same problems. So these issues could be something wrong with my environment or something not related to your patches. I've added these to my list of things to investigate. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 19:09:48 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 11:09:48 -0800 Subject: [Libvirt-cim] [PATCH 04 of 12] ESD: Adoption of changes to std_assoc struct in std_association In-Reply-To: <36e16117e8b18e85a489.1196342097@localhost.localdomain> References: <36e16117e8b18e85a489.1196342097@localhost.localdomain> Message-ID: <474F0E7C.5030000@linux.vnet.ibm.com> Heidi Eckhart wrote: > @@ -129,17 +129,18 @@ static CMPIInstance *make_ref(const CMPI > struct std_assoc_info *info, > struct std_assoc *assoc) > { > + CMPIStatus s = {CMPI_RC_OK, NULL}; > CMPIInstance *refinst = NULL; > - char *base; > + virConnectPtr conn = NULL; > uint16_t prop_value = 1; > > - base = class_base_name(assoc->assoc_class); > - if (base == NULL) > - goto out; > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + if (conn == NULL) > + return NULL; > > refinst = get_typed_instance(_BROKER, > - CLASSNAME(ref), > - base, > + pfx_from_conn(conn), > + "ElementSettingData", > NAMESPACE(ref)); > > if (refinst != NULL) { > @@ -165,33 +166,55 @@ static CMPIInstance *make_ref(const CMPI > (CMPIValue *)&prop_value, CMPI_uint16); > } > > -out: > - free(base); > + virConnectClose(conn); > > return refinst; > } > Could this too be in a separate patch? =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Thu Nov 29 19:09:48 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 11:09:48 -0800 Subject: [Libvirt-cim] [PATCH 04 of 12] ESD: Adoption of changes to std_assoc struct in std_association In-Reply-To: <36e16117e8b18e85a489.1196342097@localhost.localdomain> References: <36e16117e8b18e85a489.1196342097@localhost.localdomain> Message-ID: <474F0E7C.5030000@linux.vnet.ibm.com> Heidi Eckhart wrote: > @@ -129,17 +129,18 @@ static CMPIInstance *make_ref(const CMPI > struct std_assoc_info *info, > struct std_assoc *assoc) > { > + CMPIStatus s = {CMPI_RC_OK, NULL}; > CMPIInstance *refinst = NULL; > - char *base; > + virConnectPtr conn = NULL; > uint16_t prop_value = 1; > > - base = class_base_name(assoc->assoc_class); > - if (base == NULL) > - goto out; > + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); > + if (conn == NULL) > + return NULL; > > refinst = get_typed_instance(_BROKER, > - CLASSNAME(ref), > - base, > + pfx_from_conn(conn), > + "ElementSettingData", > NAMESPACE(ref)); > > if (refinst != NULL) { > @@ -165,33 +166,55 @@ static CMPIInstance *make_ref(const CMPI > (CMPIValue *)&prop_value, CMPI_uint16); > } > > -out: > - free(base); > + virConnectClose(conn); > > return refinst; > } > Could this too be in a separate patch? =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From grendel at linux.vnet.ibm.com Thu Nov 29 20:50:57 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Thu, 29 Nov 2007 15:50:57 -0500 Subject: [Libvirt-cim] [PATCH] Patch guidelines added to SubmittingPatches In-Reply-To: <87mysxauow.fsf@theine.beaverton.ibm.com> References: <87mysxauow.fsf@theine.beaverton.ibm.com> Message-ID: <474F2631.40605@linux.vnet.ibm.com> Dan Smith wrote: > JG> # HG changeset patch > JG> # User Jay Gagnon > JG> # Date 1196350280 18000 > JG> # Node ID a4193d586c20dd4aa9767f1299d9a1e91c0786a8 > JG> # Parent c478a5b30689a80159588c8f914ac97263694372 > JG> Patch guidelines added to SubmittingPatches. > > Looks good to me. I'll let it fester on the list for comments for a > bit. > > Did you want to add a page to the web content for this as well? > Either that or a pointer on one of the existing pages to this file > might be a good idea. > > > I wouldn't mind adding a page to the site, especially since then I could use some nice formatting to make it a little easier to read. I'm unfamiliar with this xsl thing though, so a primer on that would be appreciated. -- -Jay From danms at us.ibm.com Thu Nov 29 21:05:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Thu, 29 Nov 2007 13:05:48 -0800 Subject: [Libvirt-cim] [PATCH] Patch guidelines added to SubmittingPatches In-Reply-To: <474F2631.40605@linux.vnet.ibm.com> (Jay Gagnon's message of "Thu, 29 Nov 2007 15:50:57 -0500") References: <87mysxauow.fsf@theine.beaverton.ibm.com> <474F2631.40605@linux.vnet.ibm.com> Message-ID: <87fxyoahjn.fsf@theine.beaverton.ibm.com> JG> I wouldn't mind adding a page to the site, especially since then I JG> could use some nice formatting to make it a little easier to read. JG> I'm unfamiliar with this xsl thing though, so a primer on that JG> would be appreciated. If you look at the top of the site.xsl, you see all the external pages that will be generated. Adding something like this would be your first step. patches.html Then, in the libvirt-cim.html, add a new

and the content between that and the next

(or EOF) will go into patches.html. Just run "make" in doc/ to regenerate it each time you tweak it. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Thu Nov 29 21:42:28 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 13:42:28 -0800 Subject: [Libvirt-cim] [PATCH 0 of 3] #2 Fix VSMC enumeration failure. Message-ID: wbemcli ein http://root:elm3b41 at localhost/root/virt:Xen_VirtualSystemManagementCapabilities This currently returns: "Missing key: Name". This is because get_vsm_cap() is expecting a Name attribute in the ref, which doesn't exist on an enumeration query. This patch set fixes the enum issue in VSMC. Part of this fix is to add a new parameter to get_vsm_cap(). One of the handlers in ElementCapabilities calls get_vsm_cap(), so that function call has been updated as well. Updates: Instead of using gethostname() call, get the instance of the host system and use it's value for the Name attribute. From kaitlin at linux.vnet.ibm.com Thu Nov 29 21:42:31 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 13:42:31 -0800 Subject: [Libvirt-cim] [PATCH 3 of 3] Update get_vsm_cap() call in ElementCapabilities In-Reply-To: Message-ID: <482e5682c55119293991.1196372551@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1196371985 28800 # Node ID 482e5682c55119293991c361bd861b0edca0ab07 # Parent e06948021a3a7eea119332b2fe4d773c0d748ffa Update get_vsm_cap() call in ElementCapabilities. The get_vsm_cap() call in VSMC has been changed to include an extra paramater. The calling function in ElementCapabilities already gets the system / hostname, so all that needs to be done is to pass that value to get_vsm_cap(). Signed-off-by: Kaitlin Rupert diff -r e06948021a3a -r 482e5682c551 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Thu Nov 29 13:32:40 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Thu Nov 29 13:33:05 2007 -0800 @@ -78,7 +78,7 @@ static CMPIStatus sys_to_cap(const CMPIO goto out; } - s = get_vsm_cap(_BROKER, ref, &inst); + s = get_vsm_cap(_BROKER, ref, sys_name, &inst); if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); out: From kaitlin at linux.vnet.ibm.com Thu Nov 29 21:42:29 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 13:42:29 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Fix issue with VSMC enum In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1196370791 28800 # Node ID f849a60bc19bfabb37ef2f9184c88d5200cc3ee7 # Parent c478a5b30689a80159588c8f914ac97263694372 Fix issue with VSMC enum. This fix makes get_vsm_cap() more generic - it accepts a string to use for the InstanceID. The return_vsm_cap() handles enum'ing the VSMC instances, so this has been updated to get the hostname, which will be used in the InstanceID string. Updated: Instead of using gethostname() call, get the instance of the host system and use it's value for the Name attribute. This update will allow for potiential host instances that don't use the hostname as the value for the Name attribute. Signed-off-by: Kaitlin Rupert diff -r c478a5b30689 -r f849a60bc19b src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Thu Nov 29 13:13:11 2007 -0800 @@ -33,6 +33,7 @@ #include "device_parsing.h" #include "Virt_VirtualSystemManagementCapabilities.h" +#include "Virt_HostSystem.h" const static CMPIBroker *_BROKER; @@ -90,19 +91,12 @@ static CMPIStatus set_inst_properties(co CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, + const char* sys_name, CMPIInstance **inst) { CMPIStatus s; CMPIObjectPath *op; char *classname = NULL; - const char *sys_name = NULL; - - if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Missing key: Name"); - goto out; - } classname = get_typed_class(CLASSNAME(ref), "VirtualSystemManagementCapabilities"); @@ -143,8 +137,16 @@ static CMPIStatus return_vsm_cap(const C { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - - s = get_vsm_cap(_BROKER, ref, &inst); + const char *hostname = NULL; + + s = get_host_cs(_BROKER, ref, &inst); + if (s.rc != CMPI_RC_OK) + goto out; + + if (cu_get_str_prop(inst, "Name", &hostname) != CMPI_RC_OK) + goto out; + + s = get_vsm_cap(_BROKER, ref, hostname, &inst); if (s.rc != CMPI_RC_OK) goto out; diff -r c478a5b30689 -r f849a60bc19b src/Virt_VirtualSystemManagementCapabilities.h --- a/src/Virt_VirtualSystemManagementCapabilities.h Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.h Thu Nov 29 13:13:11 2007 -0800 @@ -20,6 +20,7 @@ */ CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, + const char* sys_name, CMPIInstance **inst); /* * Local Variables: From kaitlin at linux.vnet.ibm.com Thu Nov 29 21:42:30 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 13:42:30 -0800 Subject: [Libvirt-cim] [PATCH 2 of 3] Update VMSC build dependencies In-Reply-To: Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1196371960 28800 # Node ID e06948021a3a7eea119332b2fe4d773c0d748ffa # Parent f849a60bc19bfabb37ef2f9184c88d5200cc3ee7 Update VMSC build dependencies. VMSC is now dependant on libVirt_HostSystem.la since it calls get_host_cs(). Add la_DEPENDENCIES and la_LIBADD entries accordingly. Signed-off-by: Kaitlin Rupert diff -r f849a60bc19b -r e06948021a3a src/Makefile.am --- a/src/Makefile.am Thu Nov 29 13:13:11 2007 -0800 +++ b/src/Makefile.am Thu Nov 29 13:32:40 2007 -0800 @@ -63,7 +63,9 @@ libVirt_VirtualSystemManagementService_l libVirt_VirtualSystemManagementService_la_SOURCES = Virt_VirtualSystemManagementService.c libVirt_VirtualSystemManagementService_la_LIBADD = -lVirt_ComputerSystem -lVirt_ComputerSystemIndication -lVirt_RASD -lVirt_HostSystem +libVirt_VirtualSystemManagementCapabilities_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_VirtualSystemManagementCapabilities_la_SOURCES = Virt_VirtualSystemManagementCapabilities.c +libVirt_VirtualSystemManagementCapabilities_la_LIBADD = -lVirt_HostSystem libVirt_SystemDevice_la_DEPENDENCIES = libVirt_ComputerSystem.la libVirt_Device.la libVirt_SystemDevice_la_SOURCES = Virt_SystemDevice.c From kaitlin at linux.vnet.ibm.com Fri Nov 30 00:35:59 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Thu, 29 Nov 2007 16:35:59 -0800 Subject: [Libvirt-cim] [PATCH 11 of 12] SD: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474F0AC4.2050804@linux.vnet.ibm.com> References: <357d15061ef722c1e019.1196342104@localhost.localdomain> <474F0AC4.2050804@linux.vnet.ibm.com> Message-ID: <474F5AEF.2010802@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> +char* group_component[] = { >> + "Xen_HostSystem", >> + "KVM_HostSystem", >> + NULL >> +}; >> + >> > I believe SystemDevice also associates virtual devices to their > corresponding virtual machines. So I think Xen_ComputerSystem and > KVM_ComputerSystem need to be added to that list. =) > Actually, it looks like I might be somewhat incorrect here. It looks like SystemDevice associates virtual devices to their corresponding virtual machines - I don't think it currently associates any devices to the host. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From heidieck at linux.vnet.ibm.com Fri Nov 30 08:27:09 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 10:27:09 +0200 Subject: [Libvirt-cim] [PATCH 0 of 3] #4 - Enhance std association logic for reference lists and input parameter handling Message-ID: This patch set fixes: - enhance the std_assoc struct to support lists for source, target and association classnames - fixed a wrong error return for a NULL handler - reworked check for input parameter: assocClass, resultClass, role, resultRole Diff to patch set #3: - fixed patch 3 of 3: std_assoc_get_handler did not set handler to NULL in case of "no valid handler found" and so returned wrong handler From heidieck at linux.vnet.ibm.com Fri Nov 30 08:27:10 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 10:27:10 +0200 Subject: [Libvirt-cim] [PATCH 1 of 3] Enhance handling of association's references In-Reply-To: Message-ID: <393cc9ffc3e218d53761.1196414830@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196333488 -3600 # Node ID 393cc9ffc3e218d537618d314ca4eb6120fc6043 # Parent 12eaba9327d0f5f9c401c990956e5f95b9bb7b1b Enhance handling of association's references The source and target classnames of std_assoc are now lists, containing all supported classnames. This approach frees the provider from listing all possible combinations as instances of std_assoc. Signed-off-by: Heidi Eckhart diff -r 12eaba9327d0 -r 393cc9ffc3e2 std_association.c --- a/std_association.c Wed Nov 28 07:29:17 2007 -0800 +++ b/std_association.c Thu Nov 29 11:51:28 2007 +0100 @@ -61,18 +61,44 @@ static bool match_class(const CMPIBroker static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, - const char *comp_class) + char **comp_class_list) { CMPIObjectPath *rop; + char *comp_class; + int i; rop = CMNewObjectPath(broker, ns, test_class, NULL); - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) - return true; - else - return false; + for (i = 0; comp_class_list[i]; i++) { + comp_class = comp_class_list[i]; + + if ((test_class == NULL) || + (comp_class == NULL) || + match_op(broker, rop, comp_class)) + return true; + } + + return false; +} + +static bool match_source_class(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc *ptr) +{ + char *source_class; + int i; + + for (i = 0; ptr->source_class[i]; i++) { + source_class = ptr->source_class[i]; + + if (CMClassPathIsA(broker, + ref, + source_class, + NULL)) + return true; + } + + return false; } static CMPIStatus filter_results(struct inst_list *list, @@ -113,13 +139,13 @@ std_assoc_get_handler(const struct std_a std_assoc_get_handler(const struct std_assoc_ctx *ctx, const CMPIObjectPath *ref) { - struct std_assoc *ptr; + struct std_assoc *ptr = NULL; int i; for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) + if (match_source_class(ctx->brkr, ref, ptr)) return ptr; } diff -r 12eaba9327d0 -r 393cc9ffc3e2 std_association.h --- a/std_association.h Wed Nov 28 07:29:17 2007 -0800 +++ b/std_association.h Thu Nov 29 11:51:28 2007 +0100 @@ -37,13 +37,13 @@ typedef CMPIInstance *(*make_ref_t)(cons struct std_assoc *); struct std_assoc { - char *source_class; + char **source_class; char *source_prop; - char *target_class; + char **target_class; char *target_prop; - char *assoc_class; + char **assoc_class; assoc_handler_t handler; make_ref_t make_ref; From heidieck at linux.vnet.ibm.com Fri Nov 30 08:27:11 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 10:27:11 +0200 Subject: [Libvirt-cim] [PATCH 2 of 3] Removed error messages that cause wrong error returns In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196333496 -3600 # Node ID a68a67f532bca09201092ba1e8e6c9c688c0a242 # Parent 393cc9ffc3e218d537618d314ca4eb6120fc6043 Removed error messages that cause wrong error returns The case that no handler was found for a request caused an error as return. This is wrong as the not-found handler tells only, that the provider is not responsible for the given request. In scenarios with a general request causing the call of several association providers that return valid instances, the former behavior causes a wrong result, as the CIMOM would return the error and revoke all valid results. Signed-off-by: Heidi Eckhart diff -r 393cc9ffc3e2 -r a68a67f532bc std_association.c --- a/std_association.c Thu Nov 29 11:51:28 2007 +0100 +++ b/std_association.c Thu Nov 29 11:51:36 2007 +0100 @@ -170,9 +170,6 @@ static CMPIStatus do_assoc(struct std_as handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { CU_DEBUG("No handler found."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); goto out; } @@ -269,9 +266,7 @@ static CMPIStatus do_ref(struct std_asso handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); + CU_DEBUG("No handler found."); goto out; } From heidieck at linux.vnet.ibm.com Fri Nov 30 08:27:12 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 10:27:12 +0200 Subject: [Libvirt-cim] [PATCH 3 of 3] Enhance handling of input parameter of std_association logic In-Reply-To: Message-ID: <960ba4d4c87613d69d97.1196414832@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196412789 -3600 # Node ID 960ba4d4c87613d69d973431ccb4255214fba07a # Parent a68a67f532bca09201092ba1e8e6c9c688c0a242 Enhance handling of input parameter of std_association logic Signed-off-by: Heidi Eckhart diff -r a68a67f532bc -r 960ba4d4c876 std_association.c --- a/std_association.c Thu Nov 29 11:51:36 2007 +0100 +++ b/std_association.c Fri Nov 30 09:53:09 2007 +0100 @@ -67,14 +67,17 @@ static bool match_class(const CMPIBroker char *comp_class; int i; - rop = CMNewObjectPath(broker, ns, test_class, NULL); - + if (test_class == NULL) + return true; + + if (comp_class_list == NULL) + return true; + for (i = 0; comp_class_list[i]; i++) { comp_class = comp_class_list[i]; - - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) + rop = CMNewObjectPath(broker, ns, comp_class, NULL); + + if (CMClassPathIsA(broker, rop, test_class, NULL)) return true; } @@ -137,18 +140,85 @@ out: static struct std_assoc * std_assoc_get_handler(const struct std_assoc_ctx *ctx, + struct std_assoc_info *info, const CMPIObjectPath *ref) { struct std_assoc *ptr = NULL; int i; + bool rc; + + CU_DEBUG("Calling Provider: '%s'", + info->provider_name); for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; if (match_source_class(ctx->brkr, ref, ptr)) - return ptr; - } - + break; + + ptr = NULL; + } + + if (!ptr) + goto out; + + if (info->assoc_class) { + CU_DEBUG("Check client's assocClass: '%s'", + info->assoc_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->assoc_class, + ptr->assoc_class); + + if (!rc) { + CU_DEBUG("AssocClass not valid."); + goto out; + } + CU_DEBUG("AssocClass valid."); + } + + if (info->result_class) { + CU_DEBUG("Check client's resultClass: '%s'", + info->result_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->result_class, + ptr->target_class); + + if (!rc) { + CU_DEBUG("ResultClass not valid."); + goto out; + } + CU_DEBUG("ResultClass valid."); + } + + if (info->role) { + CU_DEBUG("Check client's role: '%s'", + info->role); + + if (!STREQC(info->role, ptr->source_prop)) { + CU_DEBUG("Role not valid."); + goto out; + } + CU_DEBUG("Role valid."); + } + + if (info->result_role) { + CU_DEBUG("Check client's resultRole: '%s'", + info->result_role); + + if (!STREQC(info->result_role, ptr->target_prop)) { + CU_DEBUG("ResultRole not valid."); + goto out; + } + CU_DEBUG("ResultRole valid."); + } + + return ptr; + + out: return NULL; } @@ -158,57 +228,21 @@ static CMPIStatus do_assoc(struct std_as const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; struct std_assoc *handler; - bool rc; inst_list_init(&list); CU_DEBUG("Getting handler..."); - - handler = std_assoc_get_handler(ctx, ref); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", - handler->source_class, - handler->target_class, - handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", - info->result_class); - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->target_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - CU_DEBUG("Match_class succeeded."); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", - info->assoc_class); - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->assoc_class, - handler->assoc_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Association class given is not valid for" - "this association"); - goto out; - } - CU_DEBUG("Match_class succeeded, calling handler->handler..."); - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { @@ -256,32 +290,22 @@ static CMPIStatus do_ref(struct std_asso const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; - int i; struct std_assoc *handler; - bool rc; + int i; inst_list_init(&list); - handler = std_assoc_get_handler(ctx, ref); + CU_DEBUG("Getting handler..."); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->assoc_class); - if (!rc) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) goto out; From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:10 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:10 +0200 Subject: [Libvirt-cim] [PATCH 11 of 12] SD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <4c6aa1b13c0b8297ff86.1196416990@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196416069 -3600 # Node ID 4c6aa1b13c0b8297ff8637c97b3d8c1bf7b8dac8 # Parent c77b0bf8966e23f20c3dd1391dffeaee0d16d170 SD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r c77b0bf8966e -r 4c6aa1b13c0b src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Fri Nov 30 10:47:48 2007 +0100 +++ b/src/Virt_SystemDevice.c Fri Nov 30 10:47:49 2007 +0100 @@ -244,23 +244,51 @@ static CMPIStatus dev_to_sys(const CMPIO return s; } +char* group_component[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* part_component[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* assoc_classname[] = { + "Xen_SystemDevice", + "KVM_SystemDevice", + NULL +}; + static struct std_assoc forward = { - .source_class = "CIM_System", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&part_component, .target_prop = "PartComponent", + + .assoc_class = (char**)&assoc_classname, .handler = sys_to_dev, .make_ref = make_ref }; static struct std_assoc backward = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_System", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", + + .assoc_class = (char**)&assoc_classname, .handler = dev_to_sys, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:01 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:01 +0200 Subject: [Libvirt-cim] [PATCH 02 of 12] EAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196334170 -3600 # Node ID d8dbe141c0b4a99c4ee0d380c8bcfe6abb6d8d66 # Parent af7ce48b18bed937d49df9d4073cac564c391971 EAFP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r af7ce48b18be -r d8dbe141c0b4 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Thu Nov 29 11:52:08 2007 +0100 +++ b/src/Virt_ElementAllocatedFromPool.c Thu Nov 29 12:02:50 2007 +0100 @@ -264,23 +264,57 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* antecedent[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* dependent[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementAllocatedFromPool", + "KVM_ElementAllocatedFromPool", + NULL +}; + static struct std_assoc _vdev_to_pool = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&dependent, .source_prop = "Dependent", - .target_class = "CIM_ResourcePool", + .target_class = (char**)&antecedent, .target_prop = "Antecedent", + + .assoc_class = (char**)&assoc_classname, .handler = vdev_to_pool, .make_ref = make_ref }; static struct std_assoc _pool_to_vdev = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&dependent, .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = pool_to_vdev, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:07 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:07 +0200 Subject: [Libvirt-cim] [PATCH 08 of 12] RAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196416066 -3600 # Node ID e6c901ef8a7f82d8bec41a646d0faf87d1d5ee81 # Parent 7ed5aecb4249c6d18b412262ab0362c220b4f95e RAFP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 7ed5aecb4249 -r e6c901ef8a7f src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Fri Nov 30 10:47:26 2007 +0100 +++ b/src/Virt_ResourceAllocationFromPool.c Fri Nov 30 10:47:46 2007 +0100 @@ -243,23 +243,51 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* antecedent[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* dependent[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_ResourceAllocationFromPool", + "KVM_ResourceAllocationFromPool", + NULL +}; + static struct std_assoc _rasd_to_pool = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&dependent, .source_prop = "Dependent", - - .target_class = "CIM_ResourcePool", + + .target_class = (char**)&antecedent, .target_prop = "Antecedent", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_pool, .make_ref = make_ref }; static struct std_assoc _pool_to_rasd = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&dependent, .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = pool_to_rasd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:00 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:00 +0200 Subject: [Libvirt-cim] [PATCH 01 of 12] ECTP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196333528 -3600 # Node ID af7ce48b18bed937d49df9d4073cac564c391971 # Parent c478a5b30689a80159588c8f914ac97263694372 ECTP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. It also adds the registration of ComputerSystem and HostSystem to the interop namespace. This is necessary to check the client's resultClass value. Signed-off-by: Heidi Eckhart diff -r c478a5b30689 -r af7ce48b18be Makefile.am --- a/Makefile.am Wed Nov 28 11:06:22 2007 -0800 +++ b/Makefile.am Thu Nov 29 11:52:08 2007 +0100 @@ -36,6 +36,8 @@ MOFS = \ schema/ElementSettingData.mof INTEROP_MOFS = \ + schema/ComputerSystem.mof \ + schema/HostSystem.mof \ schema/RegisteredProfile.mof \ schema/ElementConformsToProfile.mof diff -r c478a5b30689 -r af7ce48b18be src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Thu Nov 29 11:52:08 2007 +0100 @@ -222,27 +222,47 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } +char* conformant_standard[] = { + "Xen_RegisteredProfile", + "KVM_RegisteredProfile", + NULL +}; + +char* managed_element[] = { + "Xen_HostSystem", + "Xen_ComputerSystem", + "KVM_HostSystem", + "KVM_ComputerSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementConformsToProfile", + "KVM_ElementConformsToProfile", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", + .source_class = (char**)&conformant_standard, .source_prop = "ConformantStandard", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = prof_to_elem, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_ManagedElement", + .source_class = (char**)&managed_element, .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = (char**)&conformant_standard, .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = elem_to_prof, .make_ref = make_ref @@ -253,7 +273,6 @@ struct std_assoc *assoc_handlers[] = { &backward, NULL }; - STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:02 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:02 +0200 Subject: [Libvirt-cim] [PATCH 03 of 12] EC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <38068b513857c8cb64a3.1196416982@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196338264 -3600 # Node ID 38068b513857c8cb64a3f5c808f0bd42e272dfb9 # Parent d8dbe141c0b4a99c4ee0d380c8bcfe6abb6d8d66 EC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r d8dbe141c0b4 -r 38068b513857 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Thu Nov 29 12:02:50 2007 +0100 +++ b/src/Virt_ElementCapabilities.c Thu Nov 29 13:11:04 2007 +0100 @@ -237,21 +237,23 @@ static CMPIStatus pool_to_alloc(const CM out: return s; } + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->assoc_class); - if (base == NULL) + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *refinst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "ElementCapabilities", NAMESPACE(ref)); if (refinst != NULL) { @@ -265,109 +267,146 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&instop, CMPI_ref); } - free(base); + virConnectClose(conn); return refinst; } +char* assoc_classname[] = { + "Xen_ElementCapabilities", + "KVM_ElementCapabilities", + NULL +}; + +char* host_system[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* virtual_system_management_capabilities[] = { + "Xen_VirtualSystemManagementCapabilities", + "KVM_VirtualSystemManagementCapabilities", + NULL +}; + struct std_assoc system_to_vsm_cap = { - .source_class = "CIM_System", + .source_class = (char**)&host_system, .source_prop = "ManagedElement", - .target_class = "CIM_VirtualSystemManagementCapabilities", + .target_class = (char**)&virtual_system_management_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = sys_to_cap, .make_ref = make_ref }; struct std_assoc vsm_cap_to_system = { - .source_class = "CIM_VirtualSystemManagementCapabilities", + .source_class = (char**)&virtual_system_management_capabilities, .source_prop = "Capabilities", - .target_class = "CIM_System", + .target_class = (char**)&host_system, .target_prop = "ManagedElement", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = cap_to_sys, .make_ref = make_ref }; -struct std_assoc xen_cs_to_ele_cap = { - .source_class = "Xen_ComputerSystem", +char* computer_system[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* enabled_logical_element_capabilities[] = { + "Xen_EnabledLogicalElementCapabilities", + "KVM_EnabledLogicalElementCapabilities", + NULL +}; + +struct std_assoc ele_cap_to_cs = { + .source_class = (char**)&enabled_logical_element_capabilities, + .source_prop = "Capabilities", + + .target_class = (char**)&computer_system, + .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, + + .handler = cap_to_cs, + .make_ref = make_ref +}; + +struct std_assoc cs_to_ele_cap = { + .source_class = (char**)&computer_system, .source_prop = "ManagedElement", - .target_class = "CIM_EnabledLogicalElementCapabilities", + .target_class = (char**)&enabled_logical_element_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = cs_to_cap, .make_ref = make_ref }; -struct std_assoc kvm_cs_to_ele_cap = { - .source_class = "KVM_ComputerSystem", +char* allocation_capabilities[] = { + "Xen_AllocationCapabilities", + "KVM_AllocationCapabilities", + NULL +}; + +char* resource_pool[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +struct std_assoc alloc_cap_to_resource_pool = { + .source_class = (char**)&allocation_capabilities, + .source_prop = "Capabilities", + + .target_class = (char**)&resource_pool, + .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, + + .handler = alloc_to_pool, + .make_ref = make_ref +}; + +struct std_assoc resource_pool_to_alloc_cap = { + .source_class = (char**)&resource_pool, .source_prop = "ManagedElement", - .target_class = "CIM_EnabledLogicalElementCapabilities", + .target_class = (char**)&allocation_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", - - .handler = cs_to_cap, - .make_ref = make_ref -}; - -struct std_assoc ele_cap_to_computer_system = { - .source_class = "CIM_EnabledLogicalElementCapabilities", - .source_prop = "Capabilities", - - .target_class = "CIM_ComputerSystem", - .target_prop = "ManagedElement", - - .assoc_class = "CIM_ElementCapabilities", - - .handler = cap_to_cs, - .make_ref = make_ref -}; - -struct std_assoc alloc_cap_to_resource_pool = { - .source_class = "CIM_AllocationCapabilities", - .source_prop = "Capabilities", - - .target_class = "CIM_ResourcePool", - .target_prop = "ManagedElement", - - .handler = alloc_to_pool, - .make_ref = make_ref -}; - -struct std_assoc resource_pool_to_alloc_cap = { - .source_class = "CIM_ResourcePool", - .source_prop = "ManagedElement", - - .target_class = "CIM_AllocationCapabilities", - .target_prop = "Capabilities", + .assoc_class = (char**)&assoc_classname, .handler = pool_to_alloc, .make_ref = make_ref }; struct std_assoc *assoc_handlers[] = { - &xen_cs_to_ele_cap, - &kvm_cs_to_ele_cap, &system_to_vsm_cap, &vsm_cap_to_system, - &ele_cap_to_computer_system, + &ele_cap_to_cs, + &cs_to_ele_cap, &alloc_cap_to_resource_pool, &resource_pool_to_alloc_cap, NULL }; - STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:04 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:04 +0200 Subject: [Libvirt-cim] [PATCH 05 of 12] HD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <69f4e34c1187ac9013cf.1196416984@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339320 -3600 # Node ID 69f4e34c1187ac9013cf779f78c2831544b4a5a4 # Parent 36e16117e8b18e85a4898879091b919074dc44dc HD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 36e16117e8b1 -r 69f4e34c1187 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Thu Nov 29 13:23:29 2007 +0100 +++ b/src/Virt_HostedDependency.c Thu Nov 29 13:28:40 2007 +0100 @@ -99,55 +99,54 @@ static CMPIInstance *make_ref(const CMPI return refinst; } -static struct std_assoc xen_vs_to_host = { - .source_class = "Xen_ComputerSystem", +char* antecedent[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* dependent[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedDependency", + "KVM_HostedDependency", + NULL +}; + +static struct std_assoc _vs_to_host = { + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "Xen_HostSystem", - .source_prop = "Dependent", + .target_class = (char**)&dependent, + .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = vs_to_host, .make_ref = make_ref }; -static struct std_assoc kvm_vs_to_host = { - .source_class = "KVM_ComputerSystem", - .source_prop = "Antecedent", - - .target_class = "KVM_HostSystem", +static struct std_assoc _host_to_vs = { + .source_class = (char**)&dependent, .source_prop = "Dependent", - .handler = vs_to_host, - .make_ref = make_ref -}; + .target_class = (char**)&antecedent, + .target_prop = "Antecedent", -static struct std_assoc xen_host_to_vs = { - .source_class = "Xen_HostSystem", - .source_prop = "Dependent", - - .target_class = "Xen_ComputerSystem", - .target_prop = "Antecedent", + .assoc_class = (char**)&assoc_classname, .handler = host_to_vs, .make_ref = make_ref }; -static struct std_assoc kvm_host_to_vs = { - .source_class = "KVM_HostSystem", - .source_prop = "Dependent", - - .target_class = "KVM_ComputerSystem", - .target_prop = "Antecedent", - - .handler = host_to_vs, - .make_ref = make_ref -}; static struct std_assoc *handlers[] = { - &xen_vs_to_host, - &xen_host_to_vs, - &kvm_vs_to_host, - &kvm_host_to_vs, + &_vs_to_host, + &_host_to_vs, NULL }; From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:06 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:06 +0200 Subject: [Libvirt-cim] [PATCH 07 of 12] HS: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <7ed5aecb4249c6d18b41.1196416986@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196416046 -3600 # Node ID 7ed5aecb4249c6d18b412262ab0362c220b4f95e # Parent 8a75970ed83c888e50b7b83360078c8ab32316db HS: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 8a75970ed83c -r 7ed5aecb4249 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Thu Nov 29 13:33:17 2007 +0100 +++ b/src/Virt_HostedService.c Fri Nov 30 10:47:26 2007 +0100 @@ -81,16 +81,17 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *refinst = NULL; - char *base; + virConnectPtr conn = NULL; - base = class_base_name(assoc->assoc_class); - if (base == NULL) - goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "HostedService", NAMESPACE(ref)); if (refinst != NULL) { @@ -101,67 +102,60 @@ static CMPIInstance *make_ref(const CMPI set_reference(assoc, refinst, ref, instop); } -out: + virConnectClose(conn); + return refinst; } -static struct std_assoc xen_host_to_service = { - .source_class = "Xen_HostSystem", +char* antecedent[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* dependent[] = { + "Xen_ResourcePoolConfigurationService", + "Xen_VirtualSystemManagementService", + "KVM_ResourcePoolConfigurationService", + "KVM_VirtualSystemManagementService", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedService", + "KVM_HostedService", + NULL +}; + +static struct std_assoc _host_to_service = { + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&dependent, .target_prop = "Dependent", - .assoc_class = "CIM_HostedService", + .assoc_class = (char**)&assoc_classname, .handler = host_to_service, .make_ref = make_ref }; -static struct std_assoc xen_service_to_host = { - .source_class = "CIM_Service", +static struct std_assoc _service_to_host = { + .source_class = (char**)&dependent, .source_prop = "Dependent", - - .target_class = "CIM_ManagedElement", + + .target_class = (char**)&antecedent, .target_prop = "Antecedent", - .assoc_class = "CIM_HostedService", - - .handler = service_to_host, - .make_ref = make_ref -}; - -static struct std_assoc kvm_host_to_service = { - .source_class = "KVM_HostSystem", - .source_prop = "Antecedent", - - .target_class = "CIM_Service", - .target_prop = "Dependent", - - .assoc_class = "CIM_HostedService", - - .handler = host_to_service, - .make_ref = make_ref -}; - -static struct std_assoc kvm_service_to_host = { - .source_class = "CIM_Service", - .source_prop = "Dependent", - - .target_class = "KVM_ComputerSystem", - .target_prop = "Antecedent", - - .assoc_class = "CIM_HostedService", - + .assoc_class = (char**)&assoc_classname, + .handler = service_to_host, .make_ref = make_ref }; static struct std_assoc *handlers[] = { - &xen_host_to_service, - &xen_service_to_host, - &kvm_host_to_service, - &kvm_service_to_host, + &_host_to_service, + &_service_to_host, NULL }; From heidieck at linux.vnet.ibm.com Fri Nov 30 09:02:59 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:02:59 +0200 Subject: [Libvirt-cim] [PATCH 00 of 12] #2 - Adoption of changes to std_assoc struct in std_association for all associations Message-ID: This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Diff tp patch set #1: - fixed SD: former patch specified HostSystem as group_component instead of ComputerSystem - fixed HS: class ResourcePoolConfigurationService was missing for dependent - fixed SDC: fixed check against CMPIRc in alloc_cap_to_rasd; this still needs to be fixed in another patch, as ResourceType is no key property but is handled as one From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:09 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:09 +0200 Subject: [Libvirt-cim] [PATCH 10 of 12] SDS: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196416068 -3600 # Node ID c77b0bf8966e23f20c3dd1391dffeaee0d16d170 # Parent 2c0219a348890f647293a75b2c62fb2a7074f8f9 SDS: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 2c0219a34889 -r c77b0bf8966e src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Fri Nov 30 10:47:48 2007 +0100 +++ b/src/Virt_SettingsDefineState.c Fri Nov 30 10:47:48 2007 +0100 @@ -301,33 +301,73 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* logical_device[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* resource_allocation_setting_data[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* computer_system[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* virtual_system_setting_data[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_SettingsDefineState", + "KVM_SettingsDefineState", + NULL +}; + static struct std_assoc _dev_to_rasd = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&logical_device, .source_prop = "ManagedElement", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&resource_allocation_setting_data, .target_prop = "SettingData", + + .assoc_class = (char**)&assoc_classname, .handler = dev_to_rasd, .make_ref = make_ref }; static struct std_assoc _rasd_to_dev = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&resource_allocation_setting_data, .source_prop = "SettingData", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&logical_device, .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_dev, .make_ref = make_ref }; static struct std_assoc _vs_to_vssd = { - .source_class = "CIM_ComputerSystem", + .source_class = (char**)&computer_system, .source_prop = "ManagedElement", - .target_class = "CIM_VirtualSystemSettingData", + .target_class = (char**)&virtual_system_setting_data, .target_prop = "SettingData", .handler = vs_to_vssd, @@ -335,10 +375,10 @@ static struct std_assoc _vs_to_vssd = { }; static struct std_assoc _vssd_to_vs = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&virtual_system_setting_data, .source_prop = "SettingData", - .target_class = "CIM_ComputerSystem", + .target_class = (char**)&computer_system, .target_prop = "ManagedElement", .handler = vssd_to_vs, From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:08 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:08 +0200 Subject: [Libvirt-cim] [PATCH 09 of 12] SDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <2c0219a348890f647293.1196416988@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196416068 -3600 # Node ID 2c0219a348890f647293a75b2c62fb2a7074f8f9 # Parent e6c901ef8a7f82d8bec41a646d0faf87d1d5ee81 SDC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r e6c901ef8a7f -r 2c0219a34889 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 10:47:46 2007 +0100 +++ b/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 10:47:48 2007 +0100 @@ -782,7 +782,7 @@ static CMPIStatus alloc_cap_to_rasd(cons CU_DEBUG("Getting ResourceType."); ret = cu_get_u16_path(ref, "ResourceType", &type); - if (ret != 1) { + if (ret != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get ResourceType."); goto out; @@ -811,16 +811,17 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->assoc_class); - if (base == NULL) + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *refinst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "SettingsDefineCapabilities", NAMESPACE(ref)); if (refinst != NULL) { @@ -834,32 +835,50 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&instop, CMPI_ref); } - free(base); + virConnectClose(conn); return refinst; } +char* group_component[] = { + "Xen_AllocationCapabilities", + "KVM_AllocationCapabilities", + NULL +}; + +char* part_component[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_SettingsDefineCapabilities", + "KVM_SettingsDefineCapabilities", + NULL +}; + struct std_assoc _alloc_cap_to_rasd = { - .source_class = "CIM_AllocationCapabilities", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&part_component, .target_prop = "PartComponent", - .assoc_class = "CIM_SettingsDefineCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = alloc_cap_to_rasd, .make_ref = make_ref }; struct std_assoc _rasd_to_alloc_cap = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_AllocationCapabilities", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", - .assoc_class = "CIM_SettingsDefineCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_alloc_cap, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:11 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:11 +0200 Subject: [Libvirt-cim] [PATCH 12 of 12] VSSDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <3c73119b6c8db2a20217.1196416991@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196416923 -3600 # Node ID 3c73119b6c8db2a2021749c01f7e72ed7f364d0b # Parent 4c6aa1b13c0b8297ff8637c97b3d8c1bf7b8dac8 VSSDC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 4c6aa1b13c0b -r 3c73119b6c8d src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Fri Nov 30 10:47:49 2007 +0100 +++ b/src/Virt_VSSDComponent.c Fri Nov 30 11:02:03 2007 +0100 @@ -173,23 +173,46 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* group_component[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* part_component[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_VirtualSystemSettingDataComponent", + "KVM_VirtualSystemSettingDataComponent", + NULL +}; + + static struct std_assoc forward = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&part_component, .target_prop = "PartComponent", + + .assoc_class = (char**)&assoc_classname, .handler = vssd_to_rasd, .make_ref = make_ref }; static struct std_assoc backward = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_VirtualSystemSettingData", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_vssd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:05 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:05 +0200 Subject: [Libvirt-cim] [PATCH 06 of 12] HRP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <8a75970ed83c888e50b7.1196416985@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339597 -3600 # Node ID 8a75970ed83c888e50b7b83360078c8ab32316db # Parent 69f4e34c1187ac9013cf779f78c2831544b4a5a4 HRP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 69f4e34c1187 -r 8a75970ed83c src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Thu Nov 29 13:28:40 2007 +0100 +++ b/src/Virt_HostedResourcePool.c Thu Nov 29 13:33:17 2007 +0100 @@ -119,27 +119,51 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* group_component[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* part_component[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedResourcePool", + "KVM_HostedResourcePool", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_System", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = pool_to_sys, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_System", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourcePool", + .target_class = (char**)&part_component, .target_prop = "PartComponent", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = sys_to_pool, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:03:03 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:03:03 +0200 Subject: [Libvirt-cim] [PATCH 04 of 12] ESD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <36e16117e8b18e85a489.1196416983@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339009 -3600 # Node ID 36e16117e8b18e85a4898879091b919074dc44dc # Parent 38068b513857c8cb64a3f5c808f0bd42e272dfb9 ESD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 38068b513857 -r 36e16117e8b1 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Thu Nov 29 13:11:04 2007 +0100 +++ b/src/Virt_ElementSettingData.c Thu Nov 29 13:23:29 2007 +0100 @@ -129,17 +129,18 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *refinst = NULL; - char *base; + virConnectPtr conn = NULL; uint16_t prop_value = 1; - base = class_base_name(assoc->assoc_class); - if (base == NULL) - goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "ElementSettingData", NAMESPACE(ref)); if (refinst != NULL) { @@ -165,33 +166,55 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&prop_value, CMPI_uint16); } -out: - free(base); + virConnectClose(conn); return refinst; } +char* virtual_system_setting_data[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* resource_allocation_setting_data[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* managed_element[] = { + "CIM_ManagedElement", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementSettingData", + "KVM_ElementSettingData", + NULL +}; + static struct std_assoc _vssd_to_vssd = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&virtual_system_setting_data, .source_prop = "ManagedElement", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "SettingData", - .assoc_class = "CIM_ElementSettingData", + .assoc_class = (char**)&assoc_classname, .handler = vssd_to_vssd, .make_ref = make_ref }; static struct std_assoc _rasd_to_rasd = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&resource_allocation_setting_data, .source_prop = "ManagedElement", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "SettingData", - .assoc_class = "CIM_ElementSettingData", + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_rasd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 10:18:59 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:18:59 +0100 Subject: [Libvirt-cim] [PATCH 09 of 12] SDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474F0B6D.3020209@linux.vnet.ibm.com> References: <559a1c5a58401f743703.1196342102@localhost.localdomain> <474F0B6D.3020209@linux.vnet.ibm.com> Message-ID: <474FE393.6040401@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Would it be possible to break these changes out into a separate patch > as well? Good job catching these - I think there's enough for a > connect_by_classname() patchset. =) I would like to do so, but the problem is, that the code does not compile without this fix. So I decided to fix this issue where necessary to get all assoc providers compiled and added fixing the other make_ref() functions to my ToDo list. Is this ok for this time ? -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 10:25:01 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:25:01 +0100 Subject: [Libvirt-cim] [PATCH 03 of 12] EC: Adoption of changes to std_assoc struct in std_association In-Reply-To: <87ir3latu6.fsf@theine.beaverton.ibm.com> References: <38068b513857c8cb64a3.1196342096@localhost.localdomain> <87ir3latu6.fsf@theine.beaverton.ibm.com> Message-ID: <474FE4FD.8050507@linux.vnet.ibm.com> Dan Smith wrote: > Hmm, are either of these hunks related to the API change? In general yes and no: yes - because the code does not get compiled without changing the make_ref() function. no - as this update also needs to be done to some other associations, who's make_ref() hasn't been affected by the changes to the API. So I decided to fix where necessary and added a ToDo for the other associations. Hope this is ok for this time ? -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 10:26:28 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:26:28 +0100 Subject: [Libvirt-cim] [PATCH 11 of 12] SD: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474F0AC4.2050804@linux.vnet.ibm.com> References: <357d15061ef722c1e019.1196342104@localhost.localdomain> <474F0AC4.2050804@linux.vnet.ibm.com> Message-ID: <474FE554.3080102@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> +char* group_component[] = { >> + "Xen_HostSystem", >> + "KVM_HostSystem", >> + NULL >> +}; >> + >> > I believe SystemDevice also associates virtual devices to their > corresponding virtual machines. So I think Xen_ComputerSystem and > KVM_ComputerSystem need to be added to that list. =) > Yup - absolutely. Thanks - a very good catch :). -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 10:36:10 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:36:10 +0100 Subject: [Libvirt-cim] [PATCH 12 of 12] VSSDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474F0D1C.2080900@linux.vnet.ibm.com> References: <9e735b67588fd2cfa522.1196342105@localhost.localdomain> <474F0D1C.2080900@linux.vnet.ibm.com> Message-ID: <474FE79A.5070106@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> +char* part_component[] = { >> + "Xen_ResourceAllocationSettingData", >> + "KVM_ResourceAllocationSettingData", >> + NULL >> +}; >> + > I think this has the same potiential issue as RAFP: should we also > include the specific subclasses of Xen_ResourceAllocationSettingData > (Xen_ProcResourceAllocationSettingData, etc?) in the list? > good catch ... fixed -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 10:38:44 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:38:44 +0100 Subject: [Libvirt-cim] [PATCH 08 of 12] RAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474EF8E6.1000503@linux.vnet.ibm.com> References: <3b849faf8ee17556ff39.1196342101@localhost.localdomain> <474EF8E6.1000503@linux.vnet.ibm.com> Message-ID: <474FE834.8090006@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> + >> +char* dependent[] = { >> + "Xen_ResourceAllocationSettingData", >> + "KVM_ResourceAllocationSettingData", >> + NULL >> +}; >> + >> > Using -arc Xen_ProcResourceAllocationSettingData in a query doesn't > work, but using -arc Xen_ResourceAllocationSettingData does work. > Should Xen_ProcResourceAllocationSettingData, etc also added to the > list? The instances we're returning aren't of type > Xen_ResourceAllocationSettingData, so it seems like we should accept > result class values that correspond to the class type we return. good catch :) ... fixed -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 10:40:44 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:40:44 +0100 Subject: [Libvirt-cim] [PATCH 10 of 12] SDS: Adoption of changes to std_assoc struct in std_association In-Reply-To: <474F0CF4.3040401@linux.vnet.ibm.com> References: <06cf0d4357cbfc21a051.1196342103@localhost.localdomain> <474F0CF4.3040401@linux.vnet.ibm.com> Message-ID: <474FE8AC.1060302@linux.vnet.ibm.com> Kaitlin Rupert wrote: > Heidi Eckhart wrote: >> + >> +char* resource_allocation_setting_data[] = { >> + "Xen_ResourceAllocationSettingData", >> + "KVM_ResourceAllocationSettingData", + NULL >> +}; >> > I think this has the same potiential issue as RAFP: should we also > include the specific subclasses of Xen_ResourceAllocationSettingData > (Xen_ProcResourceAllocationSettingData, etc?) in the list? > good catch ... fixed -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:33 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:33 +0200 Subject: [Libvirt-cim] [PATCH 04 of 12] ESD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <36e16117e8b18e85a489.1196419413@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339009 -3600 # Node ID 36e16117e8b18e85a4898879091b919074dc44dc # Parent 38068b513857c8cb64a3f5c808f0bd42e272dfb9 ESD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 38068b513857 -r 36e16117e8b1 src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Thu Nov 29 13:11:04 2007 +0100 +++ b/src/Virt_ElementSettingData.c Thu Nov 29 13:23:29 2007 +0100 @@ -129,17 +129,18 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *refinst = NULL; - char *base; + virConnectPtr conn = NULL; uint16_t prop_value = 1; - base = class_base_name(assoc->assoc_class); - if (base == NULL) - goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "ElementSettingData", NAMESPACE(ref)); if (refinst != NULL) { @@ -165,33 +166,55 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&prop_value, CMPI_uint16); } -out: - free(base); + virConnectClose(conn); return refinst; } +char* virtual_system_setting_data[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* resource_allocation_setting_data[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* managed_element[] = { + "CIM_ManagedElement", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementSettingData", + "KVM_ElementSettingData", + NULL +}; + static struct std_assoc _vssd_to_vssd = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&virtual_system_setting_data, .source_prop = "ManagedElement", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "SettingData", - .assoc_class = "CIM_ElementSettingData", + .assoc_class = (char**)&assoc_classname, .handler = vssd_to_vssd, .make_ref = make_ref }; static struct std_assoc _rasd_to_rasd = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&resource_allocation_setting_data, .source_prop = "ManagedElement", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "SettingData", - .assoc_class = "CIM_ElementSettingData", + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_rasd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:32 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:32 +0200 Subject: [Libvirt-cim] [PATCH 03 of 12] EC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <38068b513857c8cb64a3.1196419412@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196338264 -3600 # Node ID 38068b513857c8cb64a3f5c808f0bd42e272dfb9 # Parent d8dbe141c0b4a99c4ee0d380c8bcfe6abb6d8d66 EC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r d8dbe141c0b4 -r 38068b513857 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Thu Nov 29 12:02:50 2007 +0100 +++ b/src/Virt_ElementCapabilities.c Thu Nov 29 13:11:04 2007 +0100 @@ -237,21 +237,23 @@ static CMPIStatus pool_to_alloc(const CM out: return s; } + static CMPIInstance *make_ref(const CMPIObjectPath *ref, const CMPIInstance *inst, struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->assoc_class); - if (base == NULL) + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *refinst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "ElementCapabilities", NAMESPACE(ref)); if (refinst != NULL) { @@ -265,109 +267,146 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&instop, CMPI_ref); } - free(base); + virConnectClose(conn); return refinst; } +char* assoc_classname[] = { + "Xen_ElementCapabilities", + "KVM_ElementCapabilities", + NULL +}; + +char* host_system[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* virtual_system_management_capabilities[] = { + "Xen_VirtualSystemManagementCapabilities", + "KVM_VirtualSystemManagementCapabilities", + NULL +}; + struct std_assoc system_to_vsm_cap = { - .source_class = "CIM_System", + .source_class = (char**)&host_system, .source_prop = "ManagedElement", - .target_class = "CIM_VirtualSystemManagementCapabilities", + .target_class = (char**)&virtual_system_management_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = sys_to_cap, .make_ref = make_ref }; struct std_assoc vsm_cap_to_system = { - .source_class = "CIM_VirtualSystemManagementCapabilities", + .source_class = (char**)&virtual_system_management_capabilities, .source_prop = "Capabilities", - .target_class = "CIM_System", + .target_class = (char**)&host_system, .target_prop = "ManagedElement", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = cap_to_sys, .make_ref = make_ref }; -struct std_assoc xen_cs_to_ele_cap = { - .source_class = "Xen_ComputerSystem", +char* computer_system[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* enabled_logical_element_capabilities[] = { + "Xen_EnabledLogicalElementCapabilities", + "KVM_EnabledLogicalElementCapabilities", + NULL +}; + +struct std_assoc ele_cap_to_cs = { + .source_class = (char**)&enabled_logical_element_capabilities, + .source_prop = "Capabilities", + + .target_class = (char**)&computer_system, + .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, + + .handler = cap_to_cs, + .make_ref = make_ref +}; + +struct std_assoc cs_to_ele_cap = { + .source_class = (char**)&computer_system, .source_prop = "ManagedElement", - .target_class = "CIM_EnabledLogicalElementCapabilities", + .target_class = (char**)&enabled_logical_element_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = cs_to_cap, .make_ref = make_ref }; -struct std_assoc kvm_cs_to_ele_cap = { - .source_class = "KVM_ComputerSystem", +char* allocation_capabilities[] = { + "Xen_AllocationCapabilities", + "KVM_AllocationCapabilities", + NULL +}; + +char* resource_pool[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +struct std_assoc alloc_cap_to_resource_pool = { + .source_class = (char**)&allocation_capabilities, + .source_prop = "Capabilities", + + .target_class = (char**)&resource_pool, + .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, + + .handler = alloc_to_pool, + .make_ref = make_ref +}; + +struct std_assoc resource_pool_to_alloc_cap = { + .source_class = (char**)&resource_pool, .source_prop = "ManagedElement", - .target_class = "CIM_EnabledLogicalElementCapabilities", + .target_class = (char**)&allocation_capabilities, .target_prop = "Capabilities", - .assoc_class = "CIM_ElementCapabilities", - - .handler = cs_to_cap, - .make_ref = make_ref -}; - -struct std_assoc ele_cap_to_computer_system = { - .source_class = "CIM_EnabledLogicalElementCapabilities", - .source_prop = "Capabilities", - - .target_class = "CIM_ComputerSystem", - .target_prop = "ManagedElement", - - .assoc_class = "CIM_ElementCapabilities", - - .handler = cap_to_cs, - .make_ref = make_ref -}; - -struct std_assoc alloc_cap_to_resource_pool = { - .source_class = "CIM_AllocationCapabilities", - .source_prop = "Capabilities", - - .target_class = "CIM_ResourcePool", - .target_prop = "ManagedElement", - - .handler = alloc_to_pool, - .make_ref = make_ref -}; - -struct std_assoc resource_pool_to_alloc_cap = { - .source_class = "CIM_ResourcePool", - .source_prop = "ManagedElement", - - .target_class = "CIM_AllocationCapabilities", - .target_prop = "Capabilities", + .assoc_class = (char**)&assoc_classname, .handler = pool_to_alloc, .make_ref = make_ref }; struct std_assoc *assoc_handlers[] = { - &xen_cs_to_ele_cap, - &kvm_cs_to_ele_cap, &system_to_vsm_cap, &vsm_cap_to_system, - &ele_cap_to_computer_system, + &ele_cap_to_cs, + &cs_to_ele_cap, &alloc_cap_to_resource_pool, &resource_pool_to_alloc_cap, NULL }; - STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers); From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:29 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:29 +0200 Subject: [Libvirt-cim] [PATCH 00 of 12] #3 - Adoption of changes to std_assoc struct in std_association for all associations Message-ID: Sorry saw Kaitlin's comments too late :(. This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Diff tp patch set #1: - fixed SD: former patch specified HostSystem as group_component instead of ComputerSystem - fixed HS: class ResourcePoolConfigurationService was missing for dependent - fixed SDC: fixed check against CMPIRc in alloc_cap_to_rasd; this still needs to be fixed in another patch, as ResourceType is no key property but is handled as one Diff to patch set #2: - fixed RAFP: need to specify subclasses of ResourceAllocationSettingData - fixed: SDS: need to specify subclasses of ResourceAllocationSettingData - fixed VSSDC: need to specify subclasses of ResourceAllocationSettingData From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:31 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:31 +0200 Subject: [Libvirt-cim] [PATCH 02 of 12] EAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196334170 -3600 # Node ID d8dbe141c0b4a99c4ee0d380c8bcfe6abb6d8d66 # Parent af7ce48b18bed937d49df9d4073cac564c391971 EAFP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r af7ce48b18be -r d8dbe141c0b4 src/Virt_ElementAllocatedFromPool.c --- a/src/Virt_ElementAllocatedFromPool.c Thu Nov 29 11:52:08 2007 +0100 +++ b/src/Virt_ElementAllocatedFromPool.c Thu Nov 29 12:02:50 2007 +0100 @@ -264,23 +264,57 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* antecedent[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* dependent[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementAllocatedFromPool", + "KVM_ElementAllocatedFromPool", + NULL +}; + static struct std_assoc _vdev_to_pool = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&dependent, .source_prop = "Dependent", - .target_class = "CIM_ResourcePool", + .target_class = (char**)&antecedent, .target_prop = "Antecedent", + + .assoc_class = (char**)&assoc_classname, .handler = vdev_to_pool, .make_ref = make_ref }; static struct std_assoc _pool_to_vdev = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&dependent, .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = pool_to_vdev, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:30 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:30 +0200 Subject: [Libvirt-cim] [PATCH 01 of 12] ECTP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196333528 -3600 # Node ID af7ce48b18bed937d49df9d4073cac564c391971 # Parent c478a5b30689a80159588c8f914ac97263694372 ECTP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. It also adds the registration of ComputerSystem and HostSystem to the interop namespace. This is necessary to check the client's resultClass value. Signed-off-by: Heidi Eckhart diff -r c478a5b30689 -r af7ce48b18be Makefile.am --- a/Makefile.am Wed Nov 28 11:06:22 2007 -0800 +++ b/Makefile.am Thu Nov 29 11:52:08 2007 +0100 @@ -36,6 +36,8 @@ MOFS = \ schema/ElementSettingData.mof INTEROP_MOFS = \ + schema/ComputerSystem.mof \ + schema/HostSystem.mof \ schema/RegisteredProfile.mof \ schema/ElementConformsToProfile.mof diff -r c478a5b30689 -r af7ce48b18be src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Wed Nov 28 11:06:22 2007 -0800 +++ b/src/Virt_ElementConformsToProfile.c Thu Nov 29 11:52:08 2007 +0100 @@ -222,27 +222,47 @@ static CMPIInstance *make_ref(const CMPI return assoc_inst; } +char* conformant_standard[] = { + "Xen_RegisteredProfile", + "KVM_RegisteredProfile", + NULL +}; + +char* managed_element[] = { + "Xen_HostSystem", + "Xen_ComputerSystem", + "KVM_HostSystem", + "KVM_ComputerSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_ElementConformsToProfile", + "KVM_ElementConformsToProfile", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_RegisteredProfile", + .source_class = (char**)&conformant_standard, .source_prop = "ConformantStandard", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&managed_element, .target_prop = "ManagedElement", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = prof_to_elem, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_ManagedElement", + .source_class = (char**)&managed_element, .source_prop = "ManagedElement", - .target_class = "CIM_RegisteredProfile", + .target_class = (char**)&conformant_standard, .target_prop = "ConformantStandard", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = elem_to_prof, .make_ref = make_ref @@ -253,7 +273,6 @@ struct std_assoc *assoc_handlers[] = { &backward, NULL }; - STDA_AssocMIStub(, Virt_ElementConformsToProfileProvider, _BROKER, libvirt_cim_init(), assoc_handlers); /* From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:34 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:34 +0200 Subject: [Libvirt-cim] [PATCH 05 of 12] HD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <69f4e34c1187ac9013cf.1196419414@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339320 -3600 # Node ID 69f4e34c1187ac9013cf779f78c2831544b4a5a4 # Parent 36e16117e8b18e85a4898879091b919074dc44dc HD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 36e16117e8b1 -r 69f4e34c1187 src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Thu Nov 29 13:23:29 2007 +0100 +++ b/src/Virt_HostedDependency.c Thu Nov 29 13:28:40 2007 +0100 @@ -99,55 +99,54 @@ static CMPIInstance *make_ref(const CMPI return refinst; } -static struct std_assoc xen_vs_to_host = { - .source_class = "Xen_ComputerSystem", +char* antecedent[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* dependent[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedDependency", + "KVM_HostedDependency", + NULL +}; + +static struct std_assoc _vs_to_host = { + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "Xen_HostSystem", - .source_prop = "Dependent", + .target_class = (char**)&dependent, + .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = vs_to_host, .make_ref = make_ref }; -static struct std_assoc kvm_vs_to_host = { - .source_class = "KVM_ComputerSystem", - .source_prop = "Antecedent", - - .target_class = "KVM_HostSystem", +static struct std_assoc _host_to_vs = { + .source_class = (char**)&dependent, .source_prop = "Dependent", - .handler = vs_to_host, - .make_ref = make_ref -}; + .target_class = (char**)&antecedent, + .target_prop = "Antecedent", -static struct std_assoc xen_host_to_vs = { - .source_class = "Xen_HostSystem", - .source_prop = "Dependent", - - .target_class = "Xen_ComputerSystem", - .target_prop = "Antecedent", + .assoc_class = (char**)&assoc_classname, .handler = host_to_vs, .make_ref = make_ref }; -static struct std_assoc kvm_host_to_vs = { - .source_class = "KVM_HostSystem", - .source_prop = "Dependent", - - .target_class = "KVM_ComputerSystem", - .target_prop = "Antecedent", - - .handler = host_to_vs, - .make_ref = make_ref -}; static struct std_assoc *handlers[] = { - &xen_vs_to_host, - &xen_host_to_vs, - &kvm_vs_to_host, - &kvm_host_to_vs, + &_vs_to_host, + &_host_to_vs, NULL }; From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:36 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:36 +0200 Subject: [Libvirt-cim] [PATCH 07 of 12] HS: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <7ed5aecb4249c6d18b41.1196419416@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196416046 -3600 # Node ID 7ed5aecb4249c6d18b412262ab0362c220b4f95e # Parent 8a75970ed83c888e50b7b83360078c8ab32316db HS: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 8a75970ed83c -r 7ed5aecb4249 src/Virt_HostedService.c --- a/src/Virt_HostedService.c Thu Nov 29 13:33:17 2007 +0100 +++ b/src/Virt_HostedService.c Fri Nov 30 10:47:26 2007 +0100 @@ -81,16 +81,17 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { + CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *refinst = NULL; - char *base; + virConnectPtr conn = NULL; - base = class_base_name(assoc->assoc_class); - if (base == NULL) - goto out; + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) + return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "HostedService", NAMESPACE(ref)); if (refinst != NULL) { @@ -101,67 +102,60 @@ static CMPIInstance *make_ref(const CMPI set_reference(assoc, refinst, ref, instop); } -out: + virConnectClose(conn); + return refinst; } -static struct std_assoc xen_host_to_service = { - .source_class = "Xen_HostSystem", +char* antecedent[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* dependent[] = { + "Xen_ResourcePoolConfigurationService", + "Xen_VirtualSystemManagementService", + "KVM_ResourcePoolConfigurationService", + "KVM_VirtualSystemManagementService", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedService", + "KVM_HostedService", + NULL +}; + +static struct std_assoc _host_to_service = { + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_ManagedElement", + .target_class = (char**)&dependent, .target_prop = "Dependent", - .assoc_class = "CIM_HostedService", + .assoc_class = (char**)&assoc_classname, .handler = host_to_service, .make_ref = make_ref }; -static struct std_assoc xen_service_to_host = { - .source_class = "CIM_Service", +static struct std_assoc _service_to_host = { + .source_class = (char**)&dependent, .source_prop = "Dependent", - - .target_class = "CIM_ManagedElement", + + .target_class = (char**)&antecedent, .target_prop = "Antecedent", - .assoc_class = "CIM_HostedService", - - .handler = service_to_host, - .make_ref = make_ref -}; - -static struct std_assoc kvm_host_to_service = { - .source_class = "KVM_HostSystem", - .source_prop = "Antecedent", - - .target_class = "CIM_Service", - .target_prop = "Dependent", - - .assoc_class = "CIM_HostedService", - - .handler = host_to_service, - .make_ref = make_ref -}; - -static struct std_assoc kvm_service_to_host = { - .source_class = "CIM_Service", - .source_prop = "Dependent", - - .target_class = "KVM_ComputerSystem", - .target_prop = "Antecedent", - - .assoc_class = "CIM_HostedService", - + .assoc_class = (char**)&assoc_classname, + .handler = service_to_host, .make_ref = make_ref }; static struct std_assoc *handlers[] = { - &xen_host_to_service, - &xen_service_to_host, - &kvm_host_to_service, - &kvm_service_to_host, + &_host_to_service, + &_service_to_host, NULL }; From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:40 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:40 +0200 Subject: [Libvirt-cim] [PATCH 11 of 12] SD: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196419221 -3600 # Node ID b04cad2f19903e872d08c0af80a1d5e9905f7534 # Parent 504aece866fe3012cc9aaf64f8f1225dc76ab5e0 SD: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 504aece866fe -r b04cad2f1990 src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Fri Nov 30 11:40:13 2007 +0100 +++ b/src/Virt_SystemDevice.c Fri Nov 30 11:40:21 2007 +0100 @@ -244,23 +244,51 @@ static CMPIStatus dev_to_sys(const CMPIO return s; } +char* group_component[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* part_component[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* assoc_classname[] = { + "Xen_SystemDevice", + "KVM_SystemDevice", + NULL +}; + static struct std_assoc forward = { - .source_class = "CIM_System", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&part_component, .target_prop = "PartComponent", + + .assoc_class = (char**)&assoc_classname, .handler = sys_to_dev, .make_ref = make_ref }; static struct std_assoc backward = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_System", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", + + .assoc_class = (char**)&assoc_classname, .handler = dev_to_sys, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:37 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:37 +0200 Subject: [Libvirt-cim] [PATCH 08 of 12] RAFP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196419032 -3600 # Node ID bd0565db204f6352a131f8bae8d51bea4e37646c # Parent 7ed5aecb4249c6d18b412262ab0362c220b4f95e RAFP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 7ed5aecb4249 -r bd0565db204f src/Virt_ResourceAllocationFromPool.c --- a/src/Virt_ResourceAllocationFromPool.c Fri Nov 30 10:47:26 2007 +0100 +++ b/src/Virt_ResourceAllocationFromPool.c Fri Nov 30 11:37:12 2007 +0100 @@ -243,23 +243,57 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* antecedent[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* dependent[] = { + "Xen_DiskResourceAllocationSettingData", + "Xen_MemResourceAllocationSettingData", + "Xen_NetResourceAllocationSettingData", + "Xen_ProcResourceAllocationSettingData", + "KVM_DiskResourceAllocationSettingData", + "KVM_MemResourceAllocationSettingData", + "KVM_NetResourceAllocationSettingData", + "KVM_ProcResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_ResourceAllocationFromPool", + "KVM_ResourceAllocationFromPool", + NULL +}; + static struct std_assoc _rasd_to_pool = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&dependent, .source_prop = "Dependent", - - .target_class = "CIM_ResourcePool", + + .target_class = (char**)&antecedent, .target_prop = "Antecedent", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_pool, .make_ref = make_ref }; static struct std_assoc _pool_to_rasd = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&antecedent, .source_prop = "Antecedent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&dependent, .target_prop = "Dependent", + + .assoc_class = (char**)&assoc_classname, .handler = pool_to_rasd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:38 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:38 +0200 Subject: [Libvirt-cim] [PATCH 09 of 12] SDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <16c4893ba44ccb86f83e.1196419418@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196419147 -3600 # Node ID 16c4893ba44ccb86f83eaf0eef5ab54120775bce # Parent bd0565db204f6352a131f8bae8d51bea4e37646c SDC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r bd0565db204f -r 16c4893ba44c src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 11:37:12 2007 +0100 +++ b/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 11:39:07 2007 +0100 @@ -782,7 +782,7 @@ static CMPIStatus alloc_cap_to_rasd(cons CU_DEBUG("Getting ResourceType."); ret = cu_get_u16_path(ref, "ResourceType", &type); - if (ret != 1) { + if (ret != CMPI_RC_OK) { CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, "Could not get ResourceType."); goto out; @@ -811,16 +811,17 @@ static CMPIInstance *make_ref(const CMPI struct std_assoc_info *info, struct std_assoc *assoc) { - CMPIInstance *refinst; - char *base; - - base = class_base_name(assoc->assoc_class); - if (base == NULL) + CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIInstance *refinst = NULL; + virConnectPtr conn = NULL; + + conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s); + if (conn == NULL) return NULL; refinst = get_typed_instance(_BROKER, - CLASSNAME(ref), - base, + pfx_from_conn(conn), + "SettingsDefineCapabilities", NAMESPACE(ref)); if (refinst != NULL) { @@ -834,32 +835,50 @@ static CMPIInstance *make_ref(const CMPI (CMPIValue *)&instop, CMPI_ref); } - free(base); + virConnectClose(conn); return refinst; } +char* group_component[] = { + "Xen_AllocationCapabilities", + "KVM_AllocationCapabilities", + NULL +}; + +char* part_component[] = { + "Xen_ResourceAllocationSettingData", + "KVM_ResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_SettingsDefineCapabilities", + "KVM_SettingsDefineCapabilities", + NULL +}; + struct std_assoc _alloc_cap_to_rasd = { - .source_class = "CIM_AllocationCapabilities", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&part_component, .target_prop = "PartComponent", - .assoc_class = "CIM_SettingsDefineCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = alloc_cap_to_rasd, .make_ref = make_ref }; struct std_assoc _rasd_to_alloc_cap = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_AllocationCapabilities", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", - .assoc_class = "CIM_SettingsDefineCapabilities", + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_alloc_cap, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:35 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:35 +0200 Subject: [Libvirt-cim] [PATCH 06 of 12] HRP: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <8a75970ed83c888e50b7.1196419415@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196339597 -3600 # Node ID 8a75970ed83c888e50b7b83360078c8ab32316db # Parent 69f4e34c1187ac9013cf779f78c2831544b4a5a4 HRP: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 69f4e34c1187 -r 8a75970ed83c src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Thu Nov 29 13:28:40 2007 +0100 +++ b/src/Virt_HostedResourcePool.c Thu Nov 29 13:33:17 2007 +0100 @@ -119,27 +119,51 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* group_component[] = { + "Xen_HostSystem", + "KVM_HostSystem", + NULL +}; + +char* part_component[] = { + "Xen_ProcessorPool", + "Xen_MemoryPool", + "Xen_NetworkPool", + "Xen_DiskPool", + "KVM_ProcessorPool", + "KVM_MemoryPool", + "KVM_NetworkPool", + "KVM_DiskPool", + NULL +}; + +char* assoc_classname[] = { + "Xen_HostedResourcePool", + "KVM_HostedResourcePool", + NULL +}; + struct std_assoc forward = { - .source_class = "CIM_ResourcePool", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_System", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = pool_to_sys, .make_ref = make_ref }; struct std_assoc backward = { - .source_class = "CIM_System", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourcePool", + .target_class = (char**)&part_component, .target_prop = "PartComponent", - .assoc_class = NULL, + .assoc_class = (char**)&assoc_classname, .handler = sys_to_pool, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:39 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:39 +0200 Subject: [Libvirt-cim] [PATCH 10 of 12] SDS: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <504aece866fe3012cc9a.1196419419@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196419213 -3600 # Node ID 504aece866fe3012cc9aaf64f8f1225dc76ab5e0 # Parent 16c4893ba44ccb86f83eaf0eef5ab54120775bce SDS: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r 16c4893ba44c -r 504aece866fe src/Virt_SettingsDefineState.c --- a/src/Virt_SettingsDefineState.c Fri Nov 30 11:39:07 2007 +0100 +++ b/src/Virt_SettingsDefineState.c Fri Nov 30 11:40:13 2007 +0100 @@ -301,33 +301,79 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* logical_device[] = { + "Xen_Processor", + "Xen_Memory", + "Xen_Network", + "Xen_Disk", + "KVM_Processor", + "KVM_Memory", + "KVM_Network", + "KVM_Disk", + NULL +}; + +char* resource_allocation_setting_data[] = { + "Xen_DiskResourceAllocationSettingData", + "Xen_MemResourceAllocationSettingData", + "Xen_NetResourceAllocationSettingData", + "Xen_ProcResourceAllocationSettingData", + "KVM_DiskResourceAllocationSettingData", + "KVM_MemResourceAllocationSettingData", + "KVM_NetResourceAllocationSettingData", + "KVM_ProcResourceAllocationSettingData", + NULL +}; + +char* computer_system[] = { + "Xen_ComputerSystem", + "KVM_ComputerSystem", + NULL +}; + +char* virtual_system_setting_data[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_SettingsDefineState", + "KVM_SettingsDefineState", + NULL +}; + static struct std_assoc _dev_to_rasd = { - .source_class = "CIM_LogicalDevice", + .source_class = (char**)&logical_device, .source_prop = "ManagedElement", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&resource_allocation_setting_data, .target_prop = "SettingData", + + .assoc_class = (char**)&assoc_classname, .handler = dev_to_rasd, .make_ref = make_ref }; static struct std_assoc _rasd_to_dev = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&resource_allocation_setting_data, .source_prop = "SettingData", - .target_class = "CIM_LogicalDevice", + .target_class = (char**)&logical_device, .target_prop = "ManagedElement", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_dev, .make_ref = make_ref }; static struct std_assoc _vs_to_vssd = { - .source_class = "CIM_ComputerSystem", + .source_class = (char**)&computer_system, .source_prop = "ManagedElement", - .target_class = "CIM_VirtualSystemSettingData", + .target_class = (char**)&virtual_system_setting_data, .target_prop = "SettingData", .handler = vs_to_vssd, @@ -335,10 +381,10 @@ static struct std_assoc _vs_to_vssd = { }; static struct std_assoc _vssd_to_vs = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&virtual_system_setting_data, .source_prop = "SettingData", - .target_class = "CIM_ComputerSystem", + .target_class = (char**)&computer_system, .target_prop = "ManagedElement", .handler = vssd_to_vs, From heidieck at linux.vnet.ibm.com Fri Nov 30 09:43:41 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:43:41 +0200 Subject: [Libvirt-cim] [PATCH 12 of 12] VSSDC: Adoption of changes to std_assoc struct in std_association In-Reply-To: Message-ID: <7e7c29393d458e982d89.1196419421@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196419221 -3600 # Node ID 7e7c29393d458e982d894dcfbd379feb40f27d32 # Parent b04cad2f19903e872d08c0af80a1d5e9905f7534 VSSDC: Adoption of changes to std_assoc struct in std_association This is the follow up patch to the API changes made in std_association. The struct std_assoc does now take lists for source, target and assoc classnames. Signed-off-by: Heidi Eckhart diff -r b04cad2f1990 -r 7e7c29393d45 src/Virt_VSSDComponent.c --- a/src/Virt_VSSDComponent.c Fri Nov 30 11:40:21 2007 +0100 +++ b/src/Virt_VSSDComponent.c Fri Nov 30 11:40:21 2007 +0100 @@ -173,23 +173,52 @@ static CMPIInstance *make_ref(const CMPI return refinst; } +char* group_component[] = { + "Xen_VirtualSystemSettingData", + "KVM_VirtualSystemSettingData", + NULL +}; + +char* part_component[] = { + "Xen_DiskResourceAllocationSettingData", + "Xen_MemResourceAllocationSettingData", + "Xen_NetResourceAllocationSettingData", + "Xen_ProcResourceAllocationSettingData", + "KVM_DiskResourceAllocationSettingData", + "KVM_MemResourceAllocationSettingData", + "KVM_NetResourceAllocationSettingData", + "KVM_ProcResourceAllocationSettingData", + NULL +}; + +char* assoc_classname[] = { + "Xen_VirtualSystemSettingDataComponent", + "KVM_VirtualSystemSettingDataComponent", + NULL +}; + + static struct std_assoc forward = { - .source_class = "CIM_VirtualSystemSettingData", + .source_class = (char**)&group_component, .source_prop = "GroupComponent", - .target_class = "CIM_ResourceAllocationSettingData", + .target_class = (char**)&part_component, .target_prop = "PartComponent", + + .assoc_class = (char**)&assoc_classname, .handler = vssd_to_rasd, .make_ref = make_ref }; static struct std_assoc backward = { - .source_class = "CIM_ResourceAllocationSettingData", + .source_class = (char**)&part_component, .source_prop = "PartComponent", - .target_class = "CIM_VirtualSystemSettingData", + .target_class = (char**)&group_component, .target_prop = "GroupComponent", + + .assoc_class = (char**)&assoc_classname, .handler = rasd_to_vssd, .make_ref = make_ref From heidieck at linux.vnet.ibm.com Fri Nov 30 10:54:55 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 11:54:55 +0100 Subject: [Libvirt-cim] [PATCH 3 of 3] Enhance handling of input parameter of std_association logic In-Reply-To: <474EFC01.5070501@linux.vnet.ibm.com> References: <474EFC01.5070501@linux.vnet.ibm.com> Message-ID: <474FEBFF.6020905@linux.vnet.ibm.com> Kaitlin Rupert wrote: > This works for associations. But for references, the result class is > the association class name. So, when you call std_assoc_get_handler() > from do_ref(), you end up checking the client's result class (which is > the association name) against the result class list instead of the > association list. Here's some sample debug: > > std_association.c(152): Calling Provider: > 'associationVirt_HostedDependencyProvider' > std_association.c(182): Check client's resultClass: > 'Xen_HostedDependency' > std_association.c(78): provider accepts Xen_ComputerSystem resultclass > std_association.c(78): provider accepts KVM_ComputerSystem resultclass > std_association.c(190): ResultClass not valid. > std_association.c(302): No handler found. > > You could add flag argument to std_assoc_get_handler() that indicates > whether the call is asking for references or an associators. > Although, I'm not sure that's the most elegant way. > > Also, adding the debug messages that print which values the provider > is checking the result class / assoc class / etc might be useful - > that is, print out what classes the provider accepts. Someone else > can chime in as to whether this would be useful. That's also a very good catch :). You are great in indicating bugs in the association logic :) ! Fortunately this can be fixed very easy - the assocClass and resultClass values have only been swapped while setting std_assoc_info values in stda_ReferenceNames() and stda_References(). In the case of reference calls the client's resultClass value needs to become the value for assocClass internally. @@ -373,8 +397,8 @@ CMPIStatus stda_ReferenceNames(CMPIAssoc const char *role) { struct std_assoc_info info = { - NULL, - resultClass, + resultClass , + NULL, role, NULL, NULL, @@ -394,8 +418,8 @@ CMPIStatus stda_References(CMPIAssociati const char **properties) { struct std_assoc_info info = { - NULL, resultClass, + NULL, role, NULL, properties, -- Regards Heidi Eckhart Software Engineer Linux Technology Center - Open Hypervisor heidieck at 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 From heidieck at linux.vnet.ibm.com Fri Nov 30 10:03:57 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 12:03:57 +0200 Subject: [Libvirt-cim] [PATCH 0 of 4] #5 - Enhance std association logic for reference lists and input parameter handling Message-ID: This patch set fixes: - enhance the std_assoc struct to support lists for source, target and association classnames - fixed a wrong error return for a NULL handler - reworked check for input parameter: assocClass, resultClass, role, resultRole Diff to patch set #3: - fixed patch 3 of 3: std_assoc_get_handler did not set handler to NULL in case of "no valid handler found" and so returned wrong handler Diff to patch set #4: - added 4th patch to fix the swapped assocClass and resultClass values for reference(Names) calls From heidieck at linux.vnet.ibm.com Fri Nov 30 10:03:59 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 12:03:59 +0200 Subject: [Libvirt-cim] [PATCH 2 of 4] Removed error messages that cause wrong error returns In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196333496 -3600 # Node ID a68a67f532bca09201092ba1e8e6c9c688c0a242 # Parent 393cc9ffc3e218d537618d314ca4eb6120fc6043 Removed error messages that cause wrong error returns The case that no handler was found for a request caused an error as return. This is wrong as the not-found handler tells only, that the provider is not responsible for the given request. In scenarios with a general request causing the call of several association providers that return valid instances, the former behavior causes a wrong result, as the CIMOM would return the error and revoke all valid results. Signed-off-by: Heidi Eckhart diff -r 393cc9ffc3e2 -r a68a67f532bc std_association.c --- a/std_association.c Thu Nov 29 11:51:28 2007 +0100 +++ b/std_association.c Thu Nov 29 11:51:36 2007 +0100 @@ -170,9 +170,6 @@ static CMPIStatus do_assoc(struct std_as handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { CU_DEBUG("No handler found."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); goto out; } @@ -269,9 +266,7 @@ static CMPIStatus do_ref(struct std_asso handler = std_assoc_get_handler(ctx, ref); if (handler == NULL) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Unable to handle this association"); + CU_DEBUG("No handler found."); goto out; } From heidieck at linux.vnet.ibm.com Fri Nov 30 10:04:00 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 12:04:00 +0200 Subject: [Libvirt-cim] [PATCH 3 of 4] Enhance handling of input parameter of std_association logic In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196420204 -3600 # Node ID af0383b49185941652cae1b78f6584a8d2664155 # Parent a68a67f532bca09201092ba1e8e6c9c688c0a242 Enhance handling of input parameter of std_association logic Signed-off-by: Heidi Eckhart diff -r a68a67f532bc -r af0383b49185 std_association.c --- a/std_association.c Thu Nov 29 11:51:36 2007 +0100 +++ b/std_association.c Fri Nov 30 11:56:44 2007 +0100 @@ -67,14 +67,17 @@ static bool match_class(const CMPIBroker char *comp_class; int i; - rop = CMNewObjectPath(broker, ns, test_class, NULL); - + if (test_class == NULL) + return true; + + if (comp_class_list == NULL) + return true; + for (i = 0; comp_class_list[i]; i++) { comp_class = comp_class_list[i]; - - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) + rop = CMNewObjectPath(broker, ns, comp_class, NULL); + + if (CMClassPathIsA(broker, rop, test_class, NULL)) return true; } @@ -137,18 +140,85 @@ out: static struct std_assoc * std_assoc_get_handler(const struct std_assoc_ctx *ctx, + struct std_assoc_info *info, const CMPIObjectPath *ref) { struct std_assoc *ptr = NULL; int i; + bool rc; + + CU_DEBUG("Calling Provider: '%s'", + info->provider_name); for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; if (match_source_class(ctx->brkr, ref, ptr)) - return ptr; - } - + break; + + ptr = NULL; + } + + if (!ptr) + goto out; + + if (info->assoc_class) { + CU_DEBUG("Check client's assocClass: '%s'", + info->assoc_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->assoc_class, + ptr->assoc_class); + + if (!rc) { + CU_DEBUG("AssocClass not valid."); + goto out; + } + CU_DEBUG("AssocClass valid."); + } + + if (info->result_class) { + CU_DEBUG("Check client's resultClass: '%s'", + info->result_class); + + rc = match_class(ctx->brkr, + NAMESPACE(ref), + info->result_class, + ptr->target_class); + + if (!rc) { + CU_DEBUG("ResultClass not valid."); + goto out; + } + CU_DEBUG("ResultClass valid."); + } + + if (info->role) { + CU_DEBUG("Check client's role: '%s'", + info->role); + + if (!STREQC(info->role, ptr->source_prop)) { + CU_DEBUG("Role not valid."); + goto out; + } + CU_DEBUG("Role valid."); + } + + if (info->result_role) { + CU_DEBUG("Check client's resultRole: '%s'", + info->result_role); + + if (!STREQC(info->result_role, ptr->target_prop)) { + CU_DEBUG("ResultRole not valid."); + goto out; + } + CU_DEBUG("ResultRole valid."); + } + + return ptr; + + out: return NULL; } @@ -158,57 +228,21 @@ static CMPIStatus do_assoc(struct std_as const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; struct std_assoc *handler; - bool rc; inst_list_init(&list); CU_DEBUG("Getting handler..."); - - handler = std_assoc_get_handler(ctx, ref); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - CU_DEBUG("OK.\n\tsource: '%s'\n\ttarget: '%s'\n\tassoc_class: '%s'", - handler->source_class, - handler->target_class, - handler->assoc_class); - CU_DEBUG("Calling match_class: \n\tinfo->result_class: '%s'", - info->result_class); - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->target_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - CU_DEBUG("Match_class succeeded."); - - CU_DEBUG("Calling match_class: \n\tinfo->assoc_class: '%s'", - info->assoc_class); - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->assoc_class, - handler->assoc_class); - if (!rc) { - CU_DEBUG("Match_class failed."); - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Association class given is not valid for" - "this association"); - goto out; - } - CU_DEBUG("Match_class succeeded, calling handler->handler..."); - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if (s.rc != CMPI_RC_OK) { @@ -256,32 +290,22 @@ static CMPIStatus do_ref(struct std_asso const CMPIObjectPath *ref, bool names_only) { + CMPIStatus s = {CMPI_RC_OK, NULL}; struct inst_list list; - CMPIStatus s; - int i; struct std_assoc *handler; - bool rc; + int i; inst_list_init(&list); - handler = std_assoc_get_handler(ctx, ref); + CU_DEBUG("Getting handler..."); + handler = std_assoc_get_handler(ctx, info, ref); if (handler == NULL) { CU_DEBUG("No handler found."); goto out; } - - rc = match_class(ctx->brkr, - NAMESPACE(ref), - info->result_class, - handler->assoc_class); - if (!rc) { - cu_statusf(ctx->brkr, &s, - CMPI_RC_ERR_FAILED, - "Result class is not valid for this association"); - goto out; - } - - + CU_DEBUG("Getting handler succeeded."); + + CU_DEBUG("Calling handler->handler..."); s = handler->handler(ref, info, &list); if ((s.rc != CMPI_RC_OK) || (list.list == NULL)) goto out; From heidieck at linux.vnet.ibm.com Fri Nov 30 10:04:01 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 12:04:01 +0200 Subject: [Libvirt-cim] [PATCH 4 of 4] Fixes swapped resultClass and assocClass for reference calls In-Reply-To: Message-ID: # HG changeset patch # User Heidi Eckhart # Date 1196420558 -3600 # Node ID e28651c07e99cbda1e96ea46c7bc5c06c7b09bb4 # Parent af0383b49185941652cae1b78f6584a8d2664155 Fixes swapped resultClass and assocClass for reference calls In the case of reference or referenceNames calls the client given resultClass needs to be internally handled as assocClass. Signed-off-by: Heidi Eckhart diff -r af0383b49185 -r e28651c07e99 std_association.c --- a/std_association.c Fri Nov 30 11:56:44 2007 +0100 +++ b/std_association.c Fri Nov 30 12:02:38 2007 +0100 @@ -397,8 +397,8 @@ CMPIStatus stda_ReferenceNames(CMPIAssoc const char *role) { struct std_assoc_info info = { - NULL, resultClass, + NULL, role, NULL, NULL, @@ -418,8 +418,8 @@ CMPIStatus stda_References(CMPIAssociati const char **properties) { struct std_assoc_info info = { - NULL, resultClass, + NULL, role, NULL, properties, From heidieck at linux.vnet.ibm.com Fri Nov 30 10:03:58 2007 From: heidieck at linux.vnet.ibm.com (Heidi Eckhart) Date: Fri, 30 Nov 2007 12:03:58 +0200 Subject: [Libvirt-cim] [PATCH 1 of 4] Enhance handling of association's references In-Reply-To: Message-ID: <393cc9ffc3e218d53761.1196420638@localhost.localdomain> # HG changeset patch # User Heidi Eckhart # Date 1196333488 -3600 # Node ID 393cc9ffc3e218d537618d314ca4eb6120fc6043 # Parent 12eaba9327d0f5f9c401c990956e5f95b9bb7b1b Enhance handling of association's references The source and target classnames of std_assoc are now lists, containing all supported classnames. This approach frees the provider from listing all possible combinations as instances of std_assoc. Signed-off-by: Heidi Eckhart diff -r 12eaba9327d0 -r 393cc9ffc3e2 std_association.c --- a/std_association.c Wed Nov 28 07:29:17 2007 -0800 +++ b/std_association.c Thu Nov 29 11:51:28 2007 +0100 @@ -61,18 +61,44 @@ static bool match_class(const CMPIBroker static bool match_class(const CMPIBroker *broker, const char *ns, const char *test_class, - const char *comp_class) + char **comp_class_list) { CMPIObjectPath *rop; + char *comp_class; + int i; rop = CMNewObjectPath(broker, ns, test_class, NULL); - if ((test_class == NULL) || - (comp_class == NULL) || - match_op(broker, rop, comp_class)) - return true; - else - return false; + for (i = 0; comp_class_list[i]; i++) { + comp_class = comp_class_list[i]; + + if ((test_class == NULL) || + (comp_class == NULL) || + match_op(broker, rop, comp_class)) + return true; + } + + return false; +} + +static bool match_source_class(const CMPIBroker *broker, + const CMPIObjectPath *ref, + struct std_assoc *ptr) +{ + char *source_class; + int i; + + for (i = 0; ptr->source_class[i]; i++) { + source_class = ptr->source_class[i]; + + if (CMClassPathIsA(broker, + ref, + source_class, + NULL)) + return true; + } + + return false; } static CMPIStatus filter_results(struct inst_list *list, @@ -113,13 +139,13 @@ std_assoc_get_handler(const struct std_a std_assoc_get_handler(const struct std_assoc_ctx *ctx, const CMPIObjectPath *ref) { - struct std_assoc *ptr; + struct std_assoc *ptr = NULL; int i; for (i = 0; ctx->handlers[i]; i++) { ptr = ctx->handlers[i]; - if (CMClassPathIsA(ctx->brkr, ref, ptr->source_class, NULL)) + if (match_source_class(ctx->brkr, ref, ptr)) return ptr; } diff -r 12eaba9327d0 -r 393cc9ffc3e2 std_association.h --- a/std_association.h Wed Nov 28 07:29:17 2007 -0800 +++ b/std_association.h Thu Nov 29 11:51:28 2007 +0100 @@ -37,13 +37,13 @@ typedef CMPIInstance *(*make_ref_t)(cons struct std_assoc *); struct std_assoc { - char *source_class; + char **source_class; char *source_prop; - char *target_class; + char **target_class; char *target_prop; - char *assoc_class; + char **assoc_class; assoc_handler_t handler; make_ref_t make_ref; From danms at us.ibm.com Fri Nov 30 15:08:28 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 07:08:28 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Fix issue with VSMC enum In-Reply-To: (Kaitlin Rupert's message of "Thu, 29 Nov 2007 13:42:29 -0800") References: Message-ID: <87y7cf93f7.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1196370791 28800 KR> # Node ID f849a60bc19bfabb37ef2f9184c88d5200cc3ee7 KR> # Parent c478a5b30689a80159588c8f914ac97263694372 KR> Fix issue with VSMC enum. Thanks, applied. KR> + s = get_host_cs(_BROKER, ref, &inst); KR> + if (s.rc != CMPI_RC_OK) KR> + goto out; KR> + KR> + if (cu_get_str_prop(inst, "Name", &hostname) != CMPI_RC_OK) KR> + goto out; It's even cleaner this way, right? :) With the recent API change, you don't even have to free something, which I think is pretty nifty. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 30 16:11:12 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 08:11:12 -0800 Subject: [Libvirt-cim] [PATCH 1 of 3] Fix issue with VSMC enum In-Reply-To: <87y7cf93f7.fsf@theine.beaverton.ibm.com> References: <87y7cf93f7.fsf@theine.beaverton.ibm.com> Message-ID: <47503620.20503@linux.vnet.ibm.com> Dan Smith wrote: > KR> + s = get_host_cs(_BROKER, ref, &inst); > KR> + if (s.rc != CMPI_RC_OK) > KR> + goto out; > KR> + > KR> + if (cu_get_str_prop(inst, "Name", &hostname) != CMPI_RC_OK) > KR> + goto out; > > It's even cleaner this way, right? :) > > With the recent API change, you don't even have to free something, > which I think is pretty nifty. > Definitely much cleaner, and also the right thing to do. =) -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Fri Nov 30 16:58:36 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 08:58:36 -0800 Subject: [Libvirt-cim] [PATCH 0 of 4] #5 - Enhance std association logic for reference lists and input parameter handling In-Reply-To: References: Message-ID: <4750413C.9040802@linux.vnet.ibm.com> Heidi Eckhart wrote: > This patch set fixes: > - enhance the std_assoc struct to support lists for source, target and association classnames > - fixed a wrong error return for a NULL handler > - reworked check for input parameter: assocClass, resultClass, role, resultRole > > Diff to patch set #3: > - fixed patch 3 of 3: std_assoc_get_handler did not set handler to NULL in case of "no valid handler found" and so returned wrong handler > > Diff to patch set #4: > - added 4th patch to fix the swapped assocClass and resultClass values for reference(Names) calls > Excellent work Heidi! +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From kaitlin at linux.vnet.ibm.com Fri Nov 30 17:06:40 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 09:06:40 -0800 Subject: [Libvirt-cim] [PATCH 00 of 12] #3 - Adoption of changes to std_assoc struct in std_association for all associations In-Reply-To: References: Message-ID: <47504320.5080505@linux.vnet.ibm.com> Heidi Eckhart wrote: > - fixed SDC: fixed check against CMPIRc in alloc_cap_to_rasd; this still needs to be fixed in another patch, as ResourceType is no key property but is handled as one > Is this what's causing SDC to return a "Unsupported device type." error? I had this on my list to investigate, but I'll hold off if you're looking into it. =) > Diff to patch set #2: > - fixed RAFP: need to specify subclasses of ResourceAllocationSettingData > - fixed: SDS: need to specify subclasses of ResourceAllocationSettingData > - fixed VSSDC: need to specify subclasses of ResourceAllocationSettingData > This patchset looks great as well. =) +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 30 18:01:40 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 10:01:40 -0800 Subject: [Libvirt-cim] [PATCH 0 of 4] #5 - Enhance std association logic for reference lists and input parameter handling In-Reply-To: (Heidi Eckhart's message of "Fri, 30 Nov 2007 12:03:57 +0200") References: Message-ID: <87lk8f8vej.fsf@theine.beaverton.ibm.com> HE> This patch set fixes: Applied. Thanks Heidi! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 30 18:02:09 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 10:02:09 -0800 Subject: [Libvirt-cim] [PATCH 00 of 12] #3 - Adoption of changes to std_assoc struct in std_association for all associations In-Reply-To: (Heidi Eckhart's message of "Fri, 30 Nov 2007 11:43:29 +0200") References: Message-ID: <87hcj38vdq.fsf@theine.beaverton.ibm.com> HE> This is the follow up patch to the API changes made in HE> std_association. The struct std_assoc does now take lists HE> for source, target and assoc classnames. Applied. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 30 17:08:59 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 10:08:59 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Bump libcmpiutil version to 0.2 In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196445915 28800 # Node ID e5cfffd0535e6a993e4420f8a070a2977d8781ac # Parent a5c9203b29b1e17e2467af9bfd5bcd61a03ab4a7 Bump libcmpiutil version to 0.2 Signed-off-by: Dan Smith diff -r a5c9203b29b1 -r e5cfffd0535e configure.ac --- a/configure.ac Fri Nov 30 10:04:25 2007 -0800 +++ b/configure.ac Fri Nov 30 10:05:15 2007 -0800 @@ -1,5 +1,5 @@ # Copyright IBM Corp. 2007 -AC_INIT(CMPI Utility Library, 0.1, danms at us.ibm.com, libcmpiutil) +AC_INIT(CMPI Utility Library, 0.2, danms at us.ibm.com, libcmpiutil) AC_CONFIG_SRCDIR([libcmpiutil.h]) From danms at us.ibm.com Fri Nov 30 17:08:57 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 10:08:57 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] libcmpiutil-0.1 freeze Message-ID: This set tags tip as release_0_1 and bumps the package version number to 0.2. If people are happy with calling tip 0.1, then I'll move forward with getting this into Fedora development. (NB: The tag patch doesn't convert properly, AFAIK, so I'll tag this in my main tree before actually pushing) From danms at us.ibm.com Fri Nov 30 17:08:58 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 10:08:58 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Tag libcmpiutil-0.1 In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196445865 28800 # Node ID a5c9203b29b1e17e2467af9bfd5bcd61a03ab4a7 # Parent fb71169a82b8fb74c4d3628410bb7c2247094c4e Tag libcmpiutil-0.1 Signed-off-by: Dan Smith diff -r fb71169a82b8 -r a5c9203b29b1 .hgtags --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgtags Fri Nov 30 10:04:25 2007 -0800 @@ -0,0 +1,1 @@ +e3411f09e126d12ff141eb7bda6e6b0ab61cb98a release_0_1 From kaitlin at linux.vnet.ibm.com Fri Nov 30 18:52:33 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 10:52:33 -0800 Subject: [Libvirt-cim] [PATCH] ESD does not support specific result clases properly Message-ID: <6515e4a1c90bba936fa1.1196448753@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1196448217 28800 # Node ID 6515e4a1c90bba936fa1a15ddf2f501491e16fb5 # Parent a10df58ddd0ed7f8e905ce21a28a5e585fd304ff ESD does not support specific result clases properly. Specifying a result class of Xen_VirtualSystemSettingData does not work (see query below), however a result class of CIM_ManagedElement does work. This is because I tried to make this provider accept both generic and specific result classes. Heidi's libcmpiutil API update makes it so that the providers don't need to be concerned with handling more generic cases (CIM_ManagedElement, CIM_VirtualSystemSettingData, etc). Also, I missed this during Heidi's patch review - instead of using Xen_ResourceAllocationSettingData / KVM_ResourceAllocationSettingData in the resource_allocation_setting_data list, we should use specific RASD class names so that specifying a specific RASD class as a result class is supported. See below for failing query. Failing queries: wbemcli ain -ac Xen_ElementSettingData -arc Xen_VirtualSystemSettingData 'http://root:elm3b41 at localhost/root/virt:Xen_VirtualSystemSettingData.InstanceID="Xen:Domain-0"' wbemcli ain -ac Xen_ElementSettingData -arc Xen_ProcResourceAllocationSettingData 'http://root:elm3b41 at localhost/root/virt:Xen_ProcResourceAllocationSettingData.InstanceID="Domain-0/3"' Signed-off-by: Kaitlin Rupert diff -r a10df58ddd0e -r 6515e4a1c90b src/Virt_ElementSettingData.c --- a/src/Virt_ElementSettingData.c Fri Nov 30 11:40:21 2007 +0100 +++ b/src/Virt_ElementSettingData.c Fri Nov 30 10:43:37 2007 -0800 @@ -178,13 +178,14 @@ char* virtual_system_setting_data[] = { }; char* resource_allocation_setting_data[] = { - "Xen_ResourceAllocationSettingData", - "KVM_ResourceAllocationSettingData", - NULL -}; - -char* managed_element[] = { - "CIM_ManagedElement", + "Xen_DiskResourceAllocationSettingData", + "Xen_MemResourceAllocationSettingData", + "Xen_NetResourceAllocationSettingData", + "Xen_ProcResourceAllocationSettingData", + "KVM_DiskResourceAllocationSettingData", + "KVM_MemResourceAllocationSettingData", + "KVM_NetResourceAllocationSettingData", + "KVM_ProcResourceAllocationSettingData", NULL }; @@ -198,7 +199,7 @@ static struct std_assoc _vssd_to_vssd = .source_class = (char**)&virtual_system_setting_data, .source_prop = "ManagedElement", - .target_class = (char**)&managed_element, + .target_class = (char**)&virtual_system_setting_data, .target_prop = "SettingData", .assoc_class = (char**)&assoc_classname, @@ -211,7 +212,7 @@ static struct std_assoc _rasd_to_rasd = .source_class = (char**)&resource_allocation_setting_data, .source_prop = "ManagedElement", - .target_class = (char**)&managed_element, + .target_class = (char**)&resource_allocation_setting_data, .target_prop = "SettingData", .assoc_class = (char**)&assoc_classname, From kaitlin at linux.vnet.ibm.com Fri Nov 30 19:08:01 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 11:08:01 -0800 Subject: [Libvirt-cim] [PATCH 0 of 2] libcmpiutil-0.1 freeze In-Reply-To: References: Message-ID: <47505F91.6020301@linux.vnet.ibm.com> Dan Smith wrote: > This set tags tip as release_0_1 and bumps the package version number to 0.2. > > If people are happy with calling tip 0.1, then I'll move forward with getting > this into Fedora development. > No complaints from me. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 30 19:08:30 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 11:08:30 -0800 Subject: [Libvirt-cim] [PATCH] ESD does not support specific result clases properly References: <6515e4a1c90bba936fa1.1196448753@elm3b41.beaverton.ibm.com> Message-ID: <8763zj8sb5.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1196448217 28800 KR> # Node ID 6515e4a1c90bba936fa1a15ddf2f501491e16fb5 KR> # Parent a10df58ddd0ed7f8e905ce21a28a5e585fd304ff KR> ESD does not support specific result clases properly. Looks pretty straightforward to me. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 30 19:33:53 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 11:33:53 -0800 Subject: [Libvirt-cim] [PATCH] SDC doesn't support specific RASD classes Message-ID: # HG changeset patch # User Kaitlin Rupert # Date 1196451201 28800 # Node ID d5af3e219c22e8b32de64c69a29aea970ab6a9a4 # Parent 6515e4a1c90bba936fa1a15ddf2f501491e16fb5 SDC doesn't support specific RASD classes. Instead of using Xen_ResourceAllocationSettingData / KVM_ResourceAllocationSettingData in the resource_allocation_setting_data list, we should use specific RASD class names so that specifying a specific RASD class as a result class is supported. I also missed this one while reviewing Heidi's patches. Signed-off-by: Kaitlin Rupert diff -r 6515e4a1c90b -r d5af3e219c22 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 10:43:37 2007 -0800 +++ b/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 11:33:21 2007 -0800 @@ -847,8 +847,14 @@ char* group_component[] = { }; char* part_component[] = { - "Xen_ResourceAllocationSettingData", - "KVM_ResourceAllocationSettingData", + "Xen_DiskResourceAllocationSettingData", + "Xen_MemResourceAllocationSettingData", + "Xen_NetResourceAllocationSettingData", + "Xen_ProcResourceAllocationSettingData", + "KVM_DiskResourceAllocationSettingData", + "KVM_MemResourceAllocationSettingData", + "KVM_NetResourceAllocationSettingData", + "KVM_ProcResourceAllocationSettingData", NULL }; From grendel at linux.vnet.ibm.com Fri Nov 30 18:51:26 2007 From: grendel at linux.vnet.ibm.com (Jay Gagnon) Date: Fri, 30 Nov 2007 14:51:26 -0400 Subject: [Libvirt-cim] [PATCH] Status and debug cleanup Message-ID: # HG changeset patch # User Jay Gagnon # Date 1196452080 18000 # Node ID fcb3c7a237ed6640c38265ce82db0a664fb57013 # Parent 7e9965cdb91e44722c345bc497774057ff72f652 Status and debug cleanup. After encountering various somewhat trivial but oft-occurring user output issues, I've just lumped them all in. This is, unfortunately, somewhat at odds with brand new the "stay on track" guideline (which I wrote), but making these all separate would have created a lot of that "patching a patch" thing where many lines get changed in more than one patch, which is much more obnoxious. So... CMSetStatusWithChars -> cu_statusf conversion Clean up formatting of cu_statusf calls Remove trailing '.' from cu_statusf and CU_DEBUG calls. Signed-off-by: Jay Gagnon diff -r 7e9965cdb91e -r fcb3c7a237ed libxkutil/misc_util.c --- a/libxkutil/misc_util.c Fri Nov 30 13:56:48 2007 -0500 +++ b/libxkutil/misc_util.c Fri Nov 30 14:48:00 2007 -0500 @@ -61,9 +61,9 @@ virConnectPtr connect_by_classname(const uri = cn_to_uri(classname); if (!uri) { - CMSetStatusWithChars(broker, s, - CMPI_RC_ERR_FAILED, - "Unable to generate URI from classname"); + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "Unable to generate URI from classname"); return NULL; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_AllocationCapabilities.c --- a/src/Virt_AllocationCapabilities.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_AllocationCapabilities.c Fri Nov 30 14:48:00 2007 -0500 @@ -51,15 +51,17 @@ CMPIStatus get_alloc_cap(const CMPIBroke NAMESPACE(ref)); if (rasd_type_from_classname(CLASSNAME(ref), &type) != CMPI_RC_OK) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get ResourceType."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get ResourceType"); goto out; } ret = asprintf(&inst_id, "%hi/%s", type, "0"); if (ret == -1) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_ComputerSystem.c --- a/src/Virt_ComputerSystem.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_ComputerSystem.c Fri Nov 30 14:48:00 2007 -0500 @@ -445,9 +445,9 @@ static CMPIStatus GetInstance(CMPIInstan if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) { CMPIStatus s; - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No domain name specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No domain name specified"); return s; } @@ -491,15 +491,15 @@ static CMPIStatus state_change_enable(vi break; default: printf("Cannot go to enabled state from %i\n", info->state); - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid state transition"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Invalid state transition"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -516,15 +516,15 @@ static CMPIStatus state_change_disable(v break; default: printf("Cannot go to disabled state from %i\n", info->state); - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Invalid state transition"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Invalid state transition"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -540,15 +540,15 @@ static CMPIStatus state_change_pause(vir ret = virDomainSuspend(dom); break; default: - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not running"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not running"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -564,15 +564,15 @@ static CMPIStatus state_change_reboot(vi ret = virDomainReboot(dom, 0); break; default: - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not running"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not running"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -588,15 +588,15 @@ static CMPIStatus state_change_reset(vir ret = domain_reset(dom); break; default: - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not running"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not running"); }; if (ret != 0) - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain Operation Failed"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain Operation Failed"); return s; } @@ -616,16 +616,16 @@ static CMPIStatus __state_change(const c dom = virDomainLookupByName(conn, name); if (dom == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Domain not found"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Domain not found"); goto out; } if (virDomainGetInfo(dom, &info) != 0) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to get current state"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get current state"); goto out; } @@ -668,9 +668,9 @@ static CMPIStatus state_change(CMPIMetho } if (cu_get_str_path(reference, "Name", &name) != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Name key not specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Name key not specified"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_Device.c --- a/src/Virt_Device.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_Device.c Fri Nov 30 14:48:00 2007 -0500 @@ -371,9 +371,9 @@ static CMPIStatus enum_devices(const CMP return s; if (!dom_list_devices(conn, reference, &list)) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to list domains"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to list domains"); return s; } @@ -492,9 +492,9 @@ static CMPIStatus get_device(const CMPIO CMReturnInstance(results, inst); CMSetStatus(&s, CMPI_RC_OK); } else { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Unable to get device instance"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unable to get device instance"); } virConnectClose(conn); @@ -530,9 +530,9 @@ static CMPIStatus GetInstance(CMPIInstan if (cu_get_str_path(reference, "DeviceID", &devid) != CMPI_RC_OK) { CMPIStatus s; - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No DeviceID specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No DeviceID specified"); return s; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_ElementCapabilities.c Fri Nov 30 14:48:00 2007 -0500 @@ -73,8 +73,9 @@ static CMPIStatus sys_to_cap(const CMPIO } if (!STREQ(sys_name, host_name)) { - cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "System '%s' is not a host system.", sys_name); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "System '%s' is not a host system", sys_name); goto out; } @@ -100,14 +101,14 @@ static CMPIStatus cap_to_sys(const CMPIO if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + "Could not get InstanceID"); goto out; } if (!parse_fq_devid(inst_id, &host, &device)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get system name."); + "Could not get system name"); goto out; } @@ -139,9 +140,9 @@ static CMPIStatus cs_to_cap(const CMPIOb const char *sys_name = NULL; if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing key: Name"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Missing key: Name"); goto out; } @@ -167,14 +168,14 @@ static CMPIStatus cap_to_cs(const CMPIOb if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + "Could not get InstanceID"); goto error1; } if (!parse_fq_devid(inst_id, &host, &device)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get system name."); + "Could not get system name"); goto error1; } @@ -213,8 +214,9 @@ static CMPIStatus pool_to_alloc(const CM CMPIStatus s = {CMPI_RC_OK}; if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get InstanceID"); goto out; } @@ -226,8 +228,9 @@ static CMPIStatus pool_to_alloc(const CM ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != 1) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get ResourceType."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get ResourceType"); goto out; } CMSetProperty(inst, "ResourceType", &type, CMPI_uint16); diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_ElementConformsToProfile.c --- a/src/Virt_ElementConformsToProfile.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_ElementConformsToProfile.c Fri Nov 30 14:48:00 2007 -0500 @@ -62,9 +62,9 @@ static CMPIStatus elem_instances(const C classname = get_typed_class(pfx_from_conn(conn), profile->provider_name); if (classname == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Can't assemble classname." ); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't assemble classname" ); goto out; } @@ -74,18 +74,18 @@ static CMPIStatus elem_instances(const C en = CBEnumInstances(_BROKER, info->context , op, NULL, &s); if (en == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Upcall enumInstances to target class failed."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Upcall enumInstances to target class failed"); goto out; } while (CMHasNext(en, &s)) { data = CMGetNext(en, &s); if (CMIsNullObject(data.value.inst)) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to retrieve enumeration entry."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to retrieve enumeration entry"); goto out; } @@ -115,9 +115,9 @@ static CMPIStatus prof_to_elem(const CMP return s; if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No InstanceID specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); goto out; } @@ -157,8 +157,9 @@ static CMPIStatus elem_to_prof(const CMP classname = class_base_name(CLASSNAME(ref)); if (classname == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't get class name."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't get class name"); goto out; } @@ -173,9 +174,9 @@ static CMPIStatus elem_to_prof(const CMP conn, candidate); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Can't create profile instance."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't create profile instance"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_EnabledLogicalElementCapabilities.c --- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 14:48:00 2007 -0500 @@ -65,8 +65,9 @@ static CMPIStatus set_inst_properties(co devid = get_fq_devid((char *)sys_name, "0"); if (devid == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get full ID."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get full ID"); goto error1; } @@ -114,25 +115,25 @@ CMPIStatus get_ele_cap(const CMPIBroker classname = get_typed_class(CLASSNAME(ref), "EnabledLogicalElementCapabilities"); if (classname == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Invalid class"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Invalid class"); goto out; } op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for ELECapabilities"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Cannot get object path for ELECapabilities"); goto out; } *inst = CMNewInstance(broker, op, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(*inst))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Failed to instantiate HostSystem"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_HostSystem.c --- a/src/Virt_HostSystem.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_HostSystem.c Fri Nov 30 14:48:00 2007 -0500 @@ -76,9 +76,9 @@ CMPIStatus get_host_cs(const CMPIBroker NAMESPACE(reference)); if (inst == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Can't create HostSystem instance."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Can't create HostSystem instance"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_HostedDependency.c --- a/src/Virt_HostedDependency.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_HostedDependency.c Fri Nov 30 14:48:00 2007 -0500 @@ -66,9 +66,9 @@ static CMPIStatus host_to_vs(const CMPIO if (ret) { CMSetStatus(&s, CMPI_RC_OK); } else { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to get domain list"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to get domain list"); } CMSetStatus(&s, CMPI_RC_OK); diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_HostedResourcePool.c --- a/src/Virt_HostedResourcePool.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_HostedResourcePool.c Fri Nov 30 14:48:00 2007 -0500 @@ -71,8 +71,7 @@ static CMPIStatus sys_to_pool(const CMPI if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, - "No such HostSystem instance (%s)", - prop); + "No such HostSystem instance (%s)", prop); return s; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_RegisteredProfile.c --- a/src/Virt_RegisteredProfile.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_RegisteredProfile.c Fri Nov 30 14:48:00 2007 -0500 @@ -55,9 +55,9 @@ CMPIInstance *reg_prof_instance(const CM namespace); if (instance == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Can't create RegisteredProfile instance."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Can't create RegisteredProfile instance"); goto out; } @@ -105,8 +105,9 @@ static CMPIStatus enum_profs(const CMPIO conn, profiles[i]); if (instance == NULL) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Can't create profile instance."); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Can't create profile instance"); goto out; } @@ -137,9 +138,9 @@ static CMPIStatus get_prof(const CMPIObj return s; if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "No InstanceID specified"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "No InstanceID specified"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_SettingsDefineCapabilities.c Fri Nov 30 14:48:00 2007 -0500 @@ -55,7 +55,7 @@ static bool rasd_prop_copy_value(struct { bool rc = true; - CU_DEBUG("Copying '%s'.", src.field); + CU_DEBUG("Copying '%s'", src.field); if (src.type & CMPI_string) { dest->value = (CMPIValue *)strdup((char *)src.value); } else if (src.type & CMPI_INTEGER) { @@ -120,7 +120,7 @@ static struct sdc_rasd_prop *mem_max(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -144,7 +144,7 @@ static struct sdc_rasd_prop *mem_min(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -168,7 +168,7 @@ static struct sdc_rasd_prop *mem_def(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -192,7 +192,7 @@ static struct sdc_rasd_prop *mem_inc(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -216,7 +216,7 @@ static struct sdc_rasd_prop *proc_min(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -236,7 +236,7 @@ static struct sdc_rasd_prop *proc_max(co if (conn == NULL) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not connect to hypervisor."); + "Could not connect to hypervisor"); goto out; } @@ -254,7 +254,7 @@ static struct sdc_rasd_prop *proc_max(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } out: @@ -279,7 +279,7 @@ static struct sdc_rasd_prop *proc_def(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -303,7 +303,7 @@ static struct sdc_rasd_prop *proc_inc(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -326,7 +326,7 @@ static struct sdc_rasd_prop *net_min(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -350,7 +350,7 @@ static uint16_t net_max_xen(const CMPIOb if (s->rc != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get connection."); + "Could not get connection"); goto out; } @@ -359,7 +359,7 @@ static uint16_t net_max_xen(const CMPIOb if (rc != 0) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get xen version."); + "Could not get xen version"); goto out; } @@ -385,7 +385,7 @@ static struct sdc_rasd_prop *net_max(con if (prefix == NULL) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get prefix from reference."); + "Could not get prefix from reference"); goto out; } @@ -418,7 +418,7 @@ static struct sdc_rasd_prop *net_max(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } out: free(prefix); @@ -442,7 +442,7 @@ static struct sdc_rasd_prop *net_def(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -465,7 +465,7 @@ static struct sdc_rasd_prop *net_inc(con if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -489,7 +489,7 @@ static struct sdc_rasd_prop *disk_min(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -510,7 +510,7 @@ static struct sdc_rasd_prop *disk_max(co if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); + "Could not get InstanceID"); goto out; } @@ -518,7 +518,7 @@ static struct sdc_rasd_prop *disk_max(co if (s->rc != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get connection."); + "Could not get connection"); goto out; } @@ -528,7 +528,7 @@ static struct sdc_rasd_prop *disk_max(co if (pool_inst == NULL) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get pool instance."); + "Could not get pool instance"); goto out; } @@ -536,7 +536,7 @@ static struct sdc_rasd_prop *disk_max(co if (prop_ret != CMPI_RC_OK) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not get capacity from instance."); + "Could not get capacity from instance"); goto out; } CU_DEBUG("Got capacity from pool_inst: %lld", free_64); @@ -553,7 +553,7 @@ static struct sdc_rasd_prop *disk_max(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } out: @@ -578,7 +578,7 @@ static struct sdc_rasd_prop *disk_def(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -602,7 +602,7 @@ static struct sdc_rasd_prop *disk_inc(co if (!ret) { cu_statusf(_BROKER, s, CMPI_RC_ERR_FAILED, - "Could not copy RASD."); + "Could not copy RASD"); } return rasd; @@ -695,8 +695,9 @@ static CMPIInstance *sdc_rasd_inst(const range = SDC_RANGE_POINT; break; default: - CMSetStatusWithChars(broker, s, CMPI_RC_ERR_FAILED, - "Unsupported sdc_rasd type."); + cu_statusf(broker, s, + CMPI_RC_ERR_FAILED, + "Unsupported sdc_rasd type"); goto out; } @@ -717,15 +718,15 @@ static CMPIInstance *sdc_rasd_inst(const CMSetProperty(inst, "ResourceType", &resource_type, CMPI_uint16); for (i = 0; prop_list[i].field != NULL; i++) { - CU_DEBUG("Setting property '%s'.", prop_list[i].field); + CU_DEBUG("Setting property '%s'", prop_list[i].field); CMSetProperty(inst, prop_list[i].field, prop_list[i].value, prop_list[i].type); } - CU_DEBUG("freeing prop_list."); + CU_DEBUG("freeing prop_list"); free_rasd_prop_list(prop_list); out: - CU_DEBUG("Returning inst."); + CU_DEBUG("Returning inst"); return inst; } @@ -749,22 +750,23 @@ static CMPIStatus sdc_rasds_for_type(con for (i = SDC_RASD_MIN; i <= SDC_RASD_INC; i++) { inst = sdc_rasd_inst(_BROKER, &s, ref, rasd, i); if (s.rc != CMPI_RC_OK) { - CU_DEBUG("Problem getting inst."); + CU_DEBUG("Problem getting inst"); goto out; } - CU_DEBUG("Got inst."); + CU_DEBUG("Got inst"); if (inst != NULL) { inst_list_add(list, inst); - CU_DEBUG("Added inst."); + CU_DEBUG("Added inst"); } else { - CU_DEBUG("Inst is null, not added."); + CU_DEBUG("Inst is null, not added"); } } } else { - CU_DEBUG("Unsupported type."); - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Unsupported device type."); + CU_DEBUG("Unsupported type"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Unsupported device type"); } out: @@ -779,16 +781,17 @@ static CMPIStatus alloc_cap_to_rasd(cons int ret; uint16_t type; - CU_DEBUG("Getting ResourceType."); + CU_DEBUG("Getting ResourceType"); ret = cu_get_u16_path(ref, "ResourceType", &type); if (ret != CMPI_RC_OK) { - CMSetStatusWithChars(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Could not get ResourceType."); - goto out; - } - - CU_DEBUG("ResourceType: %hi.", type); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Could not get ResourceType"); + goto out; + } + + CU_DEBUG("ResourceType: %hi", type); s = sdc_rasds_for_type(ref, list, type); diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_VSSD.c --- a/src/Virt_VSSD.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_VSSD.c Fri Nov 30 14:48:00 2007 -0500 @@ -143,9 +143,9 @@ static CMPIStatus enum_vssd(const CMPIOb count = get_domain_list(conn, &list); if (count < 0) { - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Failed to enumerate domains"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "Failed to enumerate domains"); goto out; } else if (count == 0) { CMSetStatus(&s, CMPI_RC_OK); @@ -229,7 +229,7 @@ static CMPIStatus GetInstance(CMPIInstan if (!parse_instanceid(reference, NULL, &locid)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Invalid InstanceID specified"); + "Invalid InstanceID specified"); return s; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 14:48:00 2007 -0500 @@ -61,8 +61,9 @@ static CMPIStatus set_inst_properties(co devid = get_fq_devid((char *)sys_name, "0"); if (devid == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get full ID."); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Could not get full ID"); goto out; } CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars); @@ -101,25 +102,25 @@ CMPIStatus get_vsm_cap(const CMPIBroker classname = get_typed_class(CLASSNAME(ref), "VirtualSystemManagementCapabilities"); if (classname == NULL) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Invalid class"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Invalid class"); goto out; } op = CMNewObjectPath(broker, NAMESPACE(ref), classname, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(op)) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Cannot get object path for VSMCapabilities"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Cannot get object path for VSMCapabilities"); goto out; } *inst = CMNewInstance(broker, op, &s); if ((s.rc != CMPI_RC_OK) || (CMIsNullObject(*inst))) { - CMSetStatusWithChars(broker, &s, - CMPI_RC_ERR_FAILED, - "Failed to instantiate HostSystem"); + cu_statusf(broker, &s, + CMPI_RC_ERR_FAILED, + "Failed to instantiate HostSystem"); goto out; } diff -r 7e9965cdb91e -r fcb3c7a237ed src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Fri Nov 30 13:56:48 2007 -0500 +++ b/src/Virt_VirtualSystemManagementService.c Fri Nov 30 14:48:00 2007 -0500 @@ -107,9 +107,9 @@ static CMPIStatus define_system_parse_ar sys); if (ret) { CU_DEBUG("Unable to parse SystemSettings instance"); - CMSetStatusWithChars(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "SystemSettings parse error"); + cu_statusf(_BROKER, &s, + CMPI_RC_ERR_FAILED, + "SystemSettings parse error"); goto out; } @@ -294,9 +294,9 @@ static CMPIInstance *connect_and_create( dom = virDomainDefineXML(conn, xml); if (dom == NULL) { CU_DEBUG("Failed to define domain from XML"); - CMSetStatusWithChars(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Failed to create domain"); + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to create domain"); return NULL; } @@ -304,9 +304,9 @@ static CMPIInstance *connect_and_create( inst = instance_from_name(_BROKER, conn, (char *)name, ref); if (inst == NULL) { CU_DEBUG("Failed to get new instance"); - CMSetStatusWithChars(_BROKER, s, - CMPI_RC_ERR_FAILED, - "Failed to lookup resulting system"); + cu_statusf(_BROKER, s, + CMPI_RC_ERR_FAILED, + "Failed to lookup resulting system"); } virConnectClose(conn); @@ -639,8 +639,7 @@ static CMPIStatus _resource_dynamic(stru if (func(dom, dev) == 0) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Unable to change (%i) device", - action); + "Unable to change (%i) device", action); } else { CMSetStatus(&s, CMPI_RC_OK); } @@ -673,8 +672,7 @@ static CMPIStatus resource_del(struct do else { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Cannot delete resources of type %" PRIu16, - type); + "Cannot delete resources of type %" PRIu16, type); goto out; } @@ -719,8 +717,7 @@ static CMPIStatus resource_add(struct do if ((type == CIM_RASD_TYPE_MEM) || (_list == NULL)) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Cannot add resources of type %" PRIu16, - type); + "Cannot add resources of type %" PRIu16, type); goto out; } @@ -730,8 +727,7 @@ static CMPIStatus resource_add(struct do */ cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "[TEMP] Cannot add resources of type %" PRIu16, - type); + "[TEMP] Cannot add resources of type %" PRIu16, type); goto out; } @@ -784,8 +780,7 @@ static CMPIStatus resource_mod(struct do else { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Cannot modify resources of type %" PRIu16, - type); + "Cannot modify resources of type %" PRIu16, type); goto out; } From veillard at redhat.com Fri Nov 30 20:48:37 2007 From: veillard at redhat.com (Daniel Veillard) Date: Fri, 30 Nov 2007 15:48:37 -0500 Subject: [Libvirt-cim] [PATCH 0 of 2] libcmpiutil-0.1 freeze In-Reply-To: References: Message-ID: <20071130204837.GC6754@redhat.com> On Fri, Nov 30, 2007 at 10:08:57AM -0700, Dan Smith wrote: > This set tags tip as release_0_1 and bumps the package version number to 0.2. > > If people are happy with calling tip 0.1, then I'll move forward with getting > this into Fedora development. > > (NB: The tag patch doesn't convert properly, AFAIK, so I'll tag this in my > main tree before actually pushing) sure, let's push it ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ From danms at us.ibm.com Fri Nov 30 20:56:07 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 13:56:07 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Make VirtualSystemManagementCapabilities not use a devid-style InstanceID In-Reply-To: Message-ID: <801398c33b0a6486b096.1196459767@theine> # HG changeset patch # User Dan Smith # Date 1196459465 28800 # Node ID 801398c33b0a6486b096dc415c3d4aba47d9dc04 # Parent 58b71ad05a128ceca9777e9bdc0e439bf51ad322 Make VirtualSystemManagementCapabilities not use a devid-style InstanceID This changes to a static InstanceID (since this is a singleton) and remove all the sys_name plumbing. Signed-off-by: Dan Smith diff -r 58b71ad05a12 -r 801398c33b0a src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 10:43:37 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 13:51:05 2007 -0800 @@ -30,7 +30,6 @@ #include "std_instance.h" #include "misc_util.h" -#include "device_parsing.h" #include "Virt_VirtualSystemManagementCapabilities.h" #include "Virt_HostSystem.h" @@ -48,24 +47,17 @@ enum {ADD_RESOURCES = 1, static CMPIStatus set_inst_properties(const CMPIBroker *broker, CMPIInstance *inst, - const char *classname, - const char *sys_name) + const char *classname) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIArray *array; uint16_t element; - char *devid; - + CMSetProperty(inst, "CreationClassName", (CMPIValue *)classname, CMPI_chars); - devid = get_fq_devid((char *)sys_name, "0"); - if (devid == NULL) { - CMSetStatusWithChars(broker, &s, CMPI_RC_ERR_FAILED, - "Could not get full ID."); - goto out; - } - CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars); + CMSetProperty(inst, "InstanceID", + (CMPIValue *)"ManagementCapabilities", CMPI_chars); array = CMNewArray(broker, 4, CMPI_uint16, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array)) @@ -91,7 +83,6 @@ static CMPIStatus set_inst_properties(co CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, - const char* sys_name, CMPIInstance **inst) { CMPIStatus s; @@ -123,7 +114,7 @@ CMPIStatus get_vsm_cap(const CMPIBroker goto out; } - s = set_inst_properties(broker, *inst, classname, sys_name); + s = set_inst_properties(broker, *inst, classname); out: free(classname); @@ -137,16 +128,8 @@ static CMPIStatus return_vsm_cap(const C { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - const char *hostname = NULL; - s = get_host_cs(_BROKER, ref, &inst); - if (s.rc != CMPI_RC_OK) - goto out; - - if (cu_get_str_prop(inst, "Name", &hostname) != CMPI_RC_OK) - goto out; - - s = get_vsm_cap(_BROKER, ref, hostname, &inst); + s = get_vsm_cap(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; diff -r 58b71ad05a12 -r 801398c33b0a src/Virt_VirtualSystemManagementCapabilities.h --- a/src/Virt_VirtualSystemManagementCapabilities.h Fri Nov 30 10:43:37 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.h Fri Nov 30 13:51:05 2007 -0800 @@ -20,7 +20,6 @@ */ CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, - const char* sys_name, CMPIInstance **inst); /* * Local Variables: From danms at us.ibm.com Fri Nov 30 20:56:08 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 13:56:08 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Make ElementCapabilities not assume a devid-style InstanceID In-Reply-To: Message-ID: <73ebe077a44586f83b28.1196459768@theine> # HG changeset patch # User Dan Smith # Date 1196459649 28800 # Node ID 73ebe077a44586f83b28741943308a4009227f2e # Parent 801398c33b0a6486b096dc415c3d4aba47d9dc04 Make ElementCapabilities not assume a devid-style InstanceID For the cap_to_sys case, grab the host_cs and use cu_compare_ref() instead of inspecting the InstanceID directly. Signed-off-by: Dan Smith diff -r 801398c33b0a -r 73ebe077a445 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Fri Nov 30 13:51:05 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Fri Nov 30 13:54:09 2007 -0800 @@ -52,33 +52,22 @@ static CMPIStatus sys_to_cap(const CMPIO struct inst_list *list) { CMPIInstance *inst; - CMPIrc host_rc; - const char *host_name = NULL; - const char *sys_name = NULL; - CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIStatus s = {CMPI_RC_OK, NULL}; + const char *prop = NULL; s = get_host_cs(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; - host_rc = cu_get_str_prop(inst, "Name", &host_name); - if (host_rc != CMPI_RC_OK) - goto out; - - if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { + prop = cu_compare_ref(ref, inst); + if (prop != NULL) { cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Missing `Name' property"); - goto out; - } - - if (!STREQ(sys_name, host_name)) { - cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "System '%s' is not a host system.", sys_name); - goto out; - } - - s = get_vsm_cap(_BROKER, ref, sys_name, &inst); + CMPI_RC_ERR_NOT_FOUND, + "No such HostSystem (%s)", prop); + goto out; + } + + s = get_vsm_cap(_BROKER, ref, &inst); if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); out: @@ -89,44 +78,16 @@ static CMPIStatus cap_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - const char *inst_id; - char *host; - char *device; - const char *host_name; - CMPIrc host_rc; - CMPIInstance *inst; - CMPIStatus s = {CMPI_RC_OK, NULL}; - - if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Could not get InstanceID."); - goto out; - } - - if (!parse_fq_devid(inst_id, &host, &device)) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Could not get system name."); - goto out; - } + CMPIInstance *inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; s = get_host_cs(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; - host_rc = cu_get_str_prop(inst, "Name", &host_name); - if (host_rc != CMPI_RC_OK) - goto out; - - if (!STREQ(host_name, host)) - goto out; - inst_list_add(list, inst); out: - free(host); - free(device); return s; } From danms at us.ibm.com Fri Nov 30 20:56:06 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 13:56:06 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] Fix (again) VSMCaps and ElementCaps Message-ID: There was a lot of cruft in both VSMCaps and ElementCaps around generating a dynamic InstanceID with the HostSystem.Name in it that is really not necessary. This set just changes to a static InstanceID for VSMCaps and removes all the supporting code that it obviates. From kaitlin at linux.vnet.ibm.com Fri Nov 30 22:21:08 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 14:21:08 -0800 Subject: [Libvirt-cim] [PATCH] SD doesn't return instances in all cases Message-ID: <1776beb36f5cffcfad4e.1196461268@elm3b41.beaverton.ibm.com> # HG changeset patch # User Kaitlin Rupert # Date 1196460977 28800 # Node ID 1776beb36f5cffcfad4e581a8841f77f20bc3927 # Parent d5af3e219c22e8b32de64c69a29aea970ab6a9a4 SD doesn't return instances in all cases. Virt_SystemDevice doesn't return instances when CIM_ManagedElement is passed as a result class argument. This only applies to the VM to device case (see failint query below). The problem is that we use the result class to determine which device type to return. If no result class is specified, we return all associated devices. However, if CIM_ManagedElement is specified, we are unable to match the device type, and we return nothing. I think all of this can be removed because filter_results() in libcmpiutil should remove the need for this kind of checking. Failing query: wbemcli ain -ac Xen_SystemDevice -arc CIM_ManagedElement 'http://root:elm3b41 at localhost/root/virt:Xen_ComputerSystem.CreationClassName="Xen_ComputerSystem",Name="Domain-0"' Signed-off-by: Kaitlin Rupert diff -r d5af3e219c22 -r 1776beb36f5c src/Virt_SystemDevice.c --- a/src/Virt_SystemDevice.c Fri Nov 30 11:33:21 2007 -0800 +++ b/src/Virt_SystemDevice.c Fri Nov 30 14:16:17 2007 -0800 @@ -171,22 +171,10 @@ static CMPIStatus sys_to_dev(const CMPIO goto out; } - if (info->result_class) { - int type; - - type = device_type_from_classname(info->result_class); - - ret = get_dom_devices(host, - list, - type, - CLASSNAME(ref), - NAMESPACE(ref)); - } else { - ret = get_all_devices(host, - list, - CLASSNAME(ref), - NAMESPACE(ref)); - } + ret = get_all_devices(host, + list, + CLASSNAME(ref), + NAMESPACE(ref)); if (ret >= 0) { CMSetStatus(&s, CMPI_RC_OK); From danms at us.ibm.com Fri Nov 30 22:16:54 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 14:16:54 -0800 Subject: [Libvirt-cim] [PATCH] SDC doesn't support specific RASD classes In-Reply-To: (Kaitlin Rupert's message of "Fri, 30 Nov 2007 11:33:53 -0800") References: Message-ID: <87k5nz750p.fsf@theine.beaverton.ibm.com> KR> # HG changeset patch KR> # User Kaitlin Rupert KR> # Date 1196451201 28800 KR> # Node ID d5af3e219c22e8b32de64c69a29aea970ab6a9a4 KR> # Parent 6515e4a1c90bba936fa1a15ddf2f501491e16fb5 KR> SDC doesn't support specific RASD classes. KR> Instead of using Xen_ResourceAllocationSettingData / KR> KVM_ResourceAllocationSettingData in the KR> resource_allocation_setting_data list, we should use specific RASD KR> class names so that specifying a specific RASD class as a result KR> class is supported. Good call. Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 30 22:17:50 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 14:17:50 -0800 Subject: [Libvirt-cim] [PATCH] Status and debug cleanup In-Reply-To: References: Message-ID: <47508C0E.109@linux.vnet.ibm.com> Jay Gagnon wrote: > # HG changeset patch > # User Jay Gagnon > # Date 1196452080 18000 > # Node ID fcb3c7a237ed6640c38265ce82db0a664fb57013 > # Parent 7e9965cdb91e44722c345bc497774057ff72f652 > Status and debug cleanup. > I applied this patch and things built fine for me. Also, everything looked fine on my read through. +1 -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 30 22:19:24 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 14:19:24 -0800 Subject: [Libvirt-cim] [PATCH] Status and debug cleanup In-Reply-To: (Jay Gagnon's message of "Fri, 30 Nov 2007 14:51:26 -0400") References: Message-ID: <87fxyn74wj.fsf@theine.beaverton.ibm.com> JG> # HG changeset patch JG> # User Jay Gagnon JG> # Date 1196452080 18000 JG> # Node ID fcb3c7a237ed6640c38265ce82db0a664fb57013 JG> # Parent 7e9965cdb91e44722c345bc497774057ff72f652 JG> Status and debug cleanup. JG> After encountering various somewhat trivial but oft-occurring user JG> output issues, I've just lumped them all in. This is, JG> unfortunately, somewhat at odds with brand new the "stay on track" JG> guideline (which I wrote), but making these all separate would JG> have created a lot of that "patching a patch" thing where many JG> lines get changed in more than one patch, which is much more JG> obnoxious. So... I guess we'll let you slide *this* time... :) Applied. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From danms at us.ibm.com Fri Nov 30 22:22:12 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 14:22:12 -0800 Subject: [Libvirt-cim] [PATCH] SD doesn't return instances in all cases References: <1776beb36f5cffcfad4e.1196461268@elm3b41.beaverton.ibm.com> Message-ID: <874pf374rv.fsf@theine.beaverton.ibm.com> KR> I think all of this can be removed because filter_results() in KR> libcmpiutil should remove the need for this kind of checking. Yeah, which is really handy. I can see this becoming an issue later strictly for performance, but I think that this is fine for now and we can reintroduce the optimization (correctly) if we decide it's needed. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms at us.ibm.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: not available URL: From kaitlin at linux.vnet.ibm.com Fri Nov 30 22:52:13 2007 From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert) Date: Fri, 30 Nov 2007 14:52:13 -0800 Subject: [Libvirt-cim] [PATCH 0 of 2] Fix (again) VSMCaps and ElementCaps In-Reply-To: References: Message-ID: <4750941D.5050905@linux.vnet.ibm.com> Dan Smith wrote: > There was a lot of cruft in both VSMCaps and ElementCaps around generating > a dynamic InstanceID with the HostSystem.Name in it that is really not > necessary. > > This set just changes to a static InstanceID for VSMCaps and removes all > the supporting code that it obviates. > I was unable to apply this on a clean tree, but nice changes otherwise. -- Kaitlin Rupert IBM Linux Technology Center karupert at us.ibm.com From danms at us.ibm.com Fri Nov 30 22:35:48 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 15:35:48 -0700 Subject: [Libvirt-cim] [PATCH 0 of 2] #2 Fix (again) VSMCaps and ElementCaps Message-ID: There was a lot of cruft in both VSMCaps and ElementCaps around generating a dynamic InstanceID with the HostSystem.Name in it that is really not necessary. This set just changes to a static InstanceID for VSMCaps and removes all the supporting code that it obviates. Changes: - Just a rebase on tip From danms at us.ibm.com Fri Nov 30 22:35:50 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 15:35:50 -0700 Subject: [Libvirt-cim] [PATCH 2 of 2] Make ElementCapabilities not assume a devid-style InstanceID In-Reply-To: Message-ID: # HG changeset patch # User Dan Smith # Date 1196465546 28800 # Node ID e6be7823c8e90c1f4b722ce1b33d6d15db123029 # Parent 41b88691861933c0fa5b0ead6f27bd1b9730985d Make ElementCapabilities not assume a devid-style InstanceID For the cap_to_sys case, grab the host_cs and use cu_compare_ref() instead of inspecting the InstanceID directly. Signed-off-by: Dan Smith diff -r 41b886918619 -r e6be7823c8e9 src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Fri Nov 30 15:26:49 2007 -0800 +++ b/src/Virt_ElementCapabilities.c Fri Nov 30 15:32:26 2007 -0800 @@ -52,34 +52,22 @@ static CMPIStatus sys_to_cap(const CMPIO struct inst_list *list) { CMPIInstance *inst; - CMPIrc host_rc; - const char *host_name = NULL; - const char *sys_name = NULL; - CMPIStatus s = {CMPI_RC_OK, NULL}; + CMPIStatus s = {CMPI_RC_OK, NULL}; + const char *prop; s = get_host_cs(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; - host_rc = cu_get_str_prop(inst, "Name", &host_name); - if (host_rc != CMPI_RC_OK) - goto out; - - if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) { + prop = cu_compare_ref(ref, inst); + if (prop != NULL) { cu_statusf(_BROKER, &s, CMPI_RC_ERR_FAILED, - "Missing `Name' property"); - goto out; - } - - if (!STREQ(sys_name, host_name)) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "System '%s' is not a host system", sys_name); - goto out; - } - - s = get_vsm_cap(_BROKER, ref, sys_name, &inst); + "No such HostSystem (%s)", prop); + goto out; + } + + s = get_vsm_cap(_BROKER, ref, &inst); if (s.rc == CMPI_RC_OK) inst_list_add(list, inst); out: @@ -90,44 +78,16 @@ static CMPIStatus cap_to_sys(const CMPIO struct std_assoc_info *info, struct inst_list *list) { - const char *inst_id; - char *host; - char *device; - const char *host_name; - CMPIrc host_rc; - CMPIInstance *inst; - CMPIStatus s = {CMPI_RC_OK, NULL}; - - if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Could not get InstanceID"); - goto out; - } - - if (!parse_fq_devid(inst_id, &host, &device)) { - cu_statusf(_BROKER, &s, - CMPI_RC_ERR_FAILED, - "Could not get system name"); - goto out; - } + CMPIInstance *inst; + CMPIStatus s = {CMPI_RC_OK, NULL}; s = get_host_cs(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; - host_rc = cu_get_str_prop(inst, "Name", &host_name); - if (host_rc != CMPI_RC_OK) - goto out; - - if (!STREQ(host_name, host)) - goto out; - inst_list_add(list, inst); out: - free(host); - free(device); return s; } From danms at us.ibm.com Fri Nov 30 22:35:49 2007 From: danms at us.ibm.com (Dan Smith) Date: Fri, 30 Nov 2007 15:35:49 -0700 Subject: [Libvirt-cim] [PATCH 1 of 2] Make VirtualSystemManagementCapabilities not use a devid-style InstanceID In-Reply-To: Message-ID: <41b88691861933c0fa5b.1196465749@theine> # HG changeset patch # User Dan Smith # Date 1196465209 28800 # Node ID 41b88691861933c0fa5b0ead6f27bd1b9730985d # Parent 075b7c91e9729f9705af3a2f4726e6883be29b59 Make VirtualSystemManagementCapabilities not use a devid-style InstanceID This changes to a static InstanceID (since this is a singleton) and remove all the sys_name plumbing. Signed-off-by: Dan Smith diff -r 075b7c91e972 -r 41b886918619 src/Virt_VirtualSystemManagementCapabilities.c --- a/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 14:16:17 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.c Fri Nov 30 15:26:49 2007 -0800 @@ -30,7 +30,6 @@ #include "std_instance.h" #include "misc_util.h" -#include "device_parsing.h" #include "Virt_VirtualSystemManagementCapabilities.h" #include "Virt_HostSystem.h" @@ -48,25 +47,17 @@ enum {ADD_RESOURCES = 1, static CMPIStatus set_inst_properties(const CMPIBroker *broker, CMPIInstance *inst, - const char *classname, - const char *sys_name) + const char *classname) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIArray *array; uint16_t element; - char *devid; - + CMSetProperty(inst, "CreationClassName", (CMPIValue *)classname, CMPI_chars); - devid = get_fq_devid((char *)sys_name, "0"); - if (devid == NULL) { - cu_statusf(broker, &s, - CMPI_RC_ERR_FAILED, - "Could not get full ID"); - goto out; - } - CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars); + CMSetProperty(inst, "InstanceID", + (CMPIValue *)"ManagementCapabilities", CMPI_chars); array = CMNewArray(broker, 4, CMPI_uint16, &s); if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array)) @@ -92,7 +83,6 @@ static CMPIStatus set_inst_properties(co CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, - const char* sys_name, CMPIInstance **inst) { CMPIStatus s; @@ -124,7 +114,7 @@ CMPIStatus get_vsm_cap(const CMPIBroker goto out; } - s = set_inst_properties(broker, *inst, classname, sys_name); + s = set_inst_properties(broker, *inst, classname); out: free(classname); @@ -138,16 +128,8 @@ static CMPIStatus return_vsm_cap(const C { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; - const char *hostname = NULL; - s = get_host_cs(_BROKER, ref, &inst); - if (s.rc != CMPI_RC_OK) - goto out; - - if (cu_get_str_prop(inst, "Name", &hostname) != CMPI_RC_OK) - goto out; - - s = get_vsm_cap(_BROKER, ref, hostname, &inst); + s = get_vsm_cap(_BROKER, ref, &inst); if (s.rc != CMPI_RC_OK) goto out; diff -r 075b7c91e972 -r 41b886918619 src/Virt_VirtualSystemManagementCapabilities.h --- a/src/Virt_VirtualSystemManagementCapabilities.h Fri Nov 30 14:16:17 2007 -0800 +++ b/src/Virt_VirtualSystemManagementCapabilities.h Fri Nov 30 15:26:49 2007 -0800 @@ -20,7 +20,6 @@ */ CMPIStatus get_vsm_cap(const CMPIBroker *broker, const CMPIObjectPath *ref, - const char* sys_name, CMPIInstance **inst); /* * Local Variables: