[PATCH] SDS: Fixed segfaulting reference(Names) call due to missing assoc_classname
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196935598 -3600
# Node ID ba4bc35f508573c53e4303ce2e7a9b5299b95f38
# Parent 618509ea5c6089678975cde7f4b5a687aa1e68f0
SDS: Fixed segfaulting reference(Names) call due to missing assoc_classname
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 618509ea5c60 -r ba4bc35f5085 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Thu Dec 06 11:06:38 2007 +0100
+++ b/src/Virt_SettingsDefineState.c Thu Dec 06 11:06:38 2007 +0100
@@ -365,6 +365,8 @@ static struct std_assoc _vs_to_vssd = {
.target_class = (char**)&virtual_system_setting_data,
.target_prop = "SettingData",
+ .assoc_class = (char**)&assoc_classname,
+
.handler = vs_to_vssd,
.make_ref = make_ref
};
@@ -375,6 +377,8 @@ static struct std_assoc _vssd_to_vs = {
.target_class = (char**)&computer_system,
.target_prop = "ManagedElement",
+
+ .assoc_class = (char**)&assoc_classname,
.handler = vssd_to_vs,
.make_ref = make_ref
16 years, 11 months
[PATCH] [RFC] #2 - variable renaming in make_ref() of associations
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196858495 -3600
# Node ID af64285fa953aca6c4183d0fd6845d110ddd1a1d
# Parent 012fc8655c2b443511ba536ef2b425ac86f69f7b
[RFC] #2 - variable renaming in make_ref() of associations
Suggestion to rename some of the variables in make_ref()
to make the relations clearer.
Also moved the content of make_ref() to make_reference()
in libxkutil to generalize it. This make_reference can
then be used by each association's make_ref().
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 012fc8655c2b -r af64285fa953 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Wed Dec 05 12:49:18 2007 +0100
+++ b/libxkutil/misc_util.c Wed Dec 05 13:41:35 2007 +0100
@@ -342,7 +342,30 @@ bool match_hypervisor_prefix(const CMPIO
return rc;
}
-
+CMPIInstance *make_reference(const CMPIBroker *broker,
+ const CMPIObjectPath *source_ref,
+ const CMPIInstance *target_inst,
+ struct std_assoc *assoc,
+ const char *assoc_classname)
+{
+
+ CMPIInstance *ref_inst = NULL;
+
+ ref_inst = get_typed_instance(broker,
+ CLASSNAME(source_ref),
+ assoc_classname,
+ NAMESPACE(source_ref));
+
+ if (ref_inst != NULL) {
+ CMPIObjectPath *target_ref;
+
+ target_ref = CMGetObjectPath(target_inst, NULL);
+
+ set_reference(assoc, ref_inst, source_ref, target_ref);
+ }
+
+ return ref_inst;
+}
bool domain_online(virDomainPtr dom)
{
diff -r 012fc8655c2b -r af64285fa953 libxkutil/misc_util.h
--- a/libxkutil/misc_util.h Wed Dec 05 12:49:18 2007 +0100
+++ b/libxkutil/misc_util.h Wed Dec 05 13:41:35 2007 +0100
@@ -109,6 +109,12 @@ bool match_hypervisor_prefix(const CMPIO
bool match_hypervisor_prefix(const CMPIObjectPath *reference,
struct std_assoc_info *info);
+CMPIInstance *make_reference(const CMPIBroker *broker,
+ const CMPIObjectPath *source_ref,
+ const CMPIInstance *target_inst,
+ struct std_assoc *assoc,
+ const char *assoc_classname);
+
/*
* Local Variables:
* mode: C
diff -r 012fc8655c2b -r af64285fa953 src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 12:49:18 2007 +0100
+++ b/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 13:41:35 2007 +0100
@@ -247,27 +247,20 @@ static CMPIStatus pool_to_vdev(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
+static CMPIInstance *make_ref(const CMPIObjectPath *source_ref,
+ const CMPIInstance *target_inst,
struct std_assoc_info *info,
struct std_assoc *assoc)
{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "ElementAllocatedFromPool",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
+ CMPIInstance *ref_inst = NULL;
+
+ ref_inst = make_reference(_BROKER,
+ source_ref,
+ target_inst,
+ assoc,
+ "ElementAllocatedFromPool");
+
+ return ref_inst;
}
char* antecedent[] = {
16 years, 11 months
[PATCH 0 of 6] #2 Add migration support
by Dan Smith
Changes:
- Added VirtualSystemIsMigratableTo*() methods
- Fixed up reported issues
There is a blank migratable check still, and I still need to do
the MigrationSettingData class, but I'd like to get this into the
tree before I do.
16 years, 11 months
[PATCH 0 of 9] #2 - Reorganized association provider registration
by Heidi Eckhart
The provider registration approach - registering one provider
per subclass (Xen_<classname>Provider, KVM_<classname>Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Diff to patch #1:
- clarified patch message
- added match_hypervsior_prefix to association's handler functions
Tested for sfcb and Pegasus, but encountered a strange behavior with
Pegasus. Please can someone try to reproduce this on his/her system ?
The following call
wbemain -ac CIM_HostedDependency -noverify 'http://pegasus:pegasus@localhost/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain"'
should return
localhost:5988/root/virt:KVM_ResourcePoolConfigurationService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_ResourcePoolConfigurationService",Name="RPCS"
localhost:5988/root/virt:KVM_VirtualSystemManagementService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service"
localhost:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"
but the returned results for Pegasus depend on the order, in which the providers Virt_HostedDependency and Virt_HostedService have been called. Either
localhost:5988/root/virt:KVM_ResourcePoolConfigurationService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_ResourcePoolConfigurationService",Name="RPCS"
localhost:5988/root/virt:KVM_VirtualSystemManagementService.SystemCreationClassName="KVM_HostSystem",SystemName="localhost.localdomain",CreationClassName="KVM_VirtualSystemManagementService",Name="Management Service"
is returned if, Virt_HostedService was called first or
localhost:5988/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"
is returned, if Virt_HostedDependency was called first.
Thanks ... Heidi
16 years, 11 months
[PATCH 0 of 6] Add migration support
by Dan Smith
This patch set adds preliminary migration support based on the current
Virtual System Migration Profile. It's not quite done yet, but it does
actually migrate VMs (tested with Xen).
Still needing to be done are:
- MigrationSettingData (perhaps to include ssh/TLS flag?)
- Something for IsMigratable methods
- Job support
- Indication support
16 years, 11 months
[PATCH] [RFC] make_ref() of associations
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196686834 -3600
# Node ID bea3e027d42ff41fc452935427981739bab76573
# Parent a1582d092f517919470b9ce7ff034b89e4b2bade
[RFC] make_ref() of associations
While thinking about the implementation of make_ref() and about
my proposal to base the asscociation's instance creation on a
connect_by_classname, I came to the conclusion that opening a
connection to libvirt for not using it, is overkill for this
method. Once make_ref() gets called by the std_association logic,
the provider can rely on that the prefix of the given reference
was checked for the right hypervisor prefix. So I suggest to
update all make_ref() functions to use get_typed_instance().
... and refix some of my fixes :0.
Besides that I suggest to rename some of the variables in
make_ref() to make the relations clearer.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r a1582d092f51 -r bea3e027d42f src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Mon Dec 03 13:49:01 2007 +0100
+++ b/src/Virt_ElementAllocatedFromPool.c Mon Dec 03 14:00:34 2007 +0100
@@ -241,27 +241,27 @@ static CMPIStatus pool_to_vdev(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
+static CMPIInstance *make_ref(const CMPIObjectPath *source_op,
+ const CMPIInstance *target_inst,
struct std_assoc_info *info,
struct std_assoc *assoc)
{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "ElementAllocatedFromPool",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
+ CMPIInstance *assoc_inst = NULL;
+
+ assoc_inst = get_typed_instance(_BROKER,
+ CLASSNAME(source_op),
+ "ElementAllocatedFromPool",
+ NAMESPACE(source_op));
+
+ if (assoc_inst != NULL) {
+ CMPIObjectPath *target_op;
+
+ target_op = CMGetObjectPath(target_inst, NULL);
+
+ set_reference(assoc, assoc_inst, source_op, target_op);
+ }
+
+ return assoc_inst;
}
char* antecedent[] = {
16 years, 11 months
[PATCH] [RFC] variable renaming in make_ref() of associations
by Heidi Eckhart
# HG changeset patch
# User Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
# Date 1196855770 -3600
# Node ID b49cfc1c6e9c3e4669bceea2f518f6c4f8bf3f82
# Parent 012fc8655c2b443511ba536ef2b425ac86f69f7b
[RFC] variable renaming in make_ref() of associations
Suggestion to rename some of the variables in make_ref()
to make the relations clearer.
Signed-off-by: Heidi Eckhart <heidieck(a)linux.vnet.ibm.com>
diff -r 012fc8655c2b -r b49cfc1c6e9c src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 12:49:18 2007 +0100
+++ b/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 12:56:10 2007 +0100
@@ -247,27 +247,27 @@ static CMPIStatus pool_to_vdev(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
+static CMPIInstance *make_ref(const CMPIObjectPath *source_ref,
+ const CMPIInstance *target_inst,
struct std_assoc_info *info,
struct std_assoc *assoc)
{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "ElementAllocatedFromPool",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
+ CMPIInstance *ref_inst = NULL;
+
+ ref_inst = get_typed_instance(_BROKER,
+ CLASSNAME(source_ref),
+ "ElementAllocatedFromPool",
+ NAMESPACE(source_ref));
+
+ if (ref_inst != NULL) {
+ CMPIObjectPath *target_ref;
+
+ target_ref = CMGetObjectPath(target_inst, NULL);
+
+ set_reference(assoc, ref_inst, source_ref, target_ref);
+ }
+
+ return ref_inst;
}
char* antecedent[] = {
16 years, 11 months
[PATCH] VSMC returns extra instances - add connect_by_classname
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1196809769 28800
# Node ID f83fe9e0ad3648502dcc52eabdb8ebc2c6baf046
# Parent e9e11611dc975a72237a9653b0a4a07ab9b4b4e1
VSMC returns extra instances - add connect_by_classname.
VSMC is returning an instance for both KVM and Xen, when only a Xen instance should be returned.
Test query:
wbemcli ein http://localhost/root/virt:CIM_VirtualSystemManagementCapabilities
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r e9e11611dc97 -r f83fe9e0ad36 src/Virt_VirtualSystemManagementCapabilities.c
--- a/src/Virt_VirtualSystemManagementCapabilities.c Tue Dec 04 09:10:36 2007 -0800
+++ b/src/Virt_VirtualSystemManagementCapabilities.c Tue Dec 04 15:09:29 2007 -0800
@@ -128,6 +128,11 @@ static CMPIStatus return_vsm_cap(const C
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
+ virConnectPtr conn = NULL;
+
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
+ if (conn == NULL)
+ goto out;
s = get_vsm_cap(_BROKER, ref, &inst);
if (s.rc != CMPI_RC_OK)
@@ -138,6 +143,8 @@ static CMPIStatus return_vsm_cap(const C
else
CMReturnInstance(results, inst);
out:
+ virConnectClose(conn);
+
return s;
}
16 years, 11 months
[PATCH] Fix typos for disk & network classes in SDC SD & EAFP
by lizg@cn.ibm.com
# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1196763876 -28800
# Node ID 7dbad83883a3f5eaeedac4e415a97fb459ec50e5
# Parent 7fd4f296b8cc328a7492a24c731d8722bc485452
Fix typos for disk & network classes in SDC SD & EAFP
*_LogicalDisk & *_NetworkPort classes are typo-ed as *_Disk & *_Network
in several assoc classes' handler param. This leads to some assoc failure.
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r 7fd4f296b8cc -r 7dbad83883a3 src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Mon Dec 03 13:35:16 2007 +0100
+++ b/src/Virt_ElementAllocatedFromPool.c Tue Dec 04 18:24:36 2007 +0800
@@ -279,12 +279,12 @@ char* dependent[] = {
char* dependent[] = {
"Xen_Processor",
"Xen_Memory",
- "Xen_Network",
- "Xen_Disk",
+ "Xen_NetworkPort",
+ "Xen_LogicalDisk",
"KVM_Processor",
"KVM_Memory",
- "KVM_Network",
- "KVM_Disk",
+ "KVM_NetworkPort",
+ "KVM_LogicalDisk",
NULL
};
diff -r 7fd4f296b8cc -r 7dbad83883a3 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Mon Dec 03 13:35:16 2007 +0100
+++ b/src/Virt_SettingsDefineState.c Tue Dec 04 18:24:36 2007 +0800
@@ -304,12 +304,12 @@ char* logical_device[] = {
char* logical_device[] = {
"Xen_Processor",
"Xen_Memory",
- "Xen_Network",
- "Xen_Disk",
+ "Xen_NetworkPort",
+ "Xen_LogicalDisk",
"KVM_Processor",
"KVM_Memory",
- "KVM_Network",
- "KVM_Disk",
+ "KVM_NetworkPort",
+ "KVM_LogicalDisk",
NULL
};
diff -r 7fd4f296b8cc -r 7dbad83883a3 src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Mon Dec 03 13:35:16 2007 +0100
+++ b/src/Virt_SystemDevice.c Tue Dec 04 18:24:36 2007 +0800
@@ -241,12 +241,12 @@ char* part_component[] = {
char* part_component[] = {
"Xen_Processor",
"Xen_Memory",
- "Xen_Network",
- "Xen_Disk",
+ "Xen_NetworkPort",
+ "Xen_LogicalDisk",
"KVM_Processor",
"KVM_Memory",
- "KVM_Network",
- "KVM_Disk",
+ "KVM_NetworkPort",
+ "KVM_LogicalDisk",
NULL
};
16 years, 11 months
[PATCH 0 of 2] #2 Remove devid-style InstanceID support from ELEC and EC.
by Kaitlin Rupert
Removed devid-style InstanceID support from ELEC - this class now uses just the name of domain.
This caused a needed update in EC - cap_to_cs() no longer needs to parse devid-style InstanceIDs.
Updates: None
This is acutally just a resend. Heidi suggested to add connect_by_classname() to return_vsm_cap() in VSMC. However, since this patchset doesn't address changes in VSMC, I'll be sending the VSMC change as a seperate patch.
16 years, 11 months