[Libvirt-cim] [PATCH 1 of 3] Initialize libvirt at provider load

Dan Smith danms at us.ibm.com
Fri Nov 16 19:26:34 UTC 2007


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# 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 <danms at us.ibm.com>

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());
 
 
 /*




More information about the Libvirt-cim mailing list