From kaitlin at linux.vnet.ibm.com Sat Dec 1 00:17:13 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 16:17:13 -0800
Subject: [Libvirt-cim] [PATCH] ELEC cleanup - remove get_fq_devid()
Message-ID: <069db51711b508916780.1196468233@elm3b41.beaverton.ibm.com>
# HG changeset patch
# User Kaitlin Rupert
# Date 1196468209 28800
# Node ID 069db51711b5089167809cecc193b700aa2c6814
# Parent 075b7c91e9729f9705af3a2f4726e6883be29b59
ELEC cleanup - remove get_fq_devid().
Removing get_fq_devid() since it's not necessary for building an InstanceID. Since this change causes error1 to be removed, I also renamed error2 to out, which conforms to the style of the other of the providers. Also, having an error2 without an error1 seemed silly.
Signed-off-by: Kaitlin Rupert
diff -r 075b7c91e972 -r 069db51711b5 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 14:16:17 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 16:16:49 2007 -0800
@@ -30,7 +30,6 @@
#include "std_instance.h"
#include "misc_util.h"
-#include "device_parsing.h"
#include "cs_util.h"
#include "Virt_EnabledLogicalElementCapabilities.h"
@@ -58,24 +57,15 @@ static CMPIStatus set_inst_properties(co
CMPIArray *array;
uint16_t element;
int edit_name = 0;
- 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 error1;
- }
-
- CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars);
+ CMSetProperty(inst, "InstanceID", (CMPIValue *)sys_name, CMPI_chars);
array = CMNewArray(broker, 5, CMPI_uint16, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array))
- goto error2;
+ goto out;
element = (uint16_t)ENABLED;
CMSetArrayElementAt(array, 0, &element, CMPI_uint16);
@@ -97,9 +87,7 @@ static CMPIStatus set_inst_properties(co
CMSetProperty(inst, "ElementNameEditSupported",
(CMPIValue *)&edit_name, CMPI_boolean);
- error2:
- free(devid);
- error1:
+ out:
return s;
}
From kaitlin at linux.vnet.ibm.com Sat Dec 1 00:09:17 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 16:09:17 -0800
Subject: [Libvirt-cim] [PATCH 0 of 2] #2 Fix (again) VSMCaps and
ElementCaps
In-Reply-To:
References:
Message-ID: <4750A62D.1050400@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.
>
> Changes:
> - Just a rebase on tip
>
Excellent - this one applied for me. +1
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From danms at us.ibm.com Sat Dec 1 00:16:38 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 30 Nov 2007 16:16:38 -0800
Subject: [Libvirt-cim] [PATCH] ELEC cleanup - remove get_fq_devid()
In-Reply-To: <069db51711b508916780.1196468233@elm3b41.beaverton.ibm.com>
(Kaitlin Rupert's message of "Fri, 30 Nov 2007 16:17:13 -0800")
References: <069db51711b508916780.1196468233@elm3b41.beaverton.ibm.com>
Message-ID: <87abov5kwp.fsf@theine.beaverton.ibm.com>
KR> # HG changeset patch
KR> # User Kaitlin Rupert
KR> # Date 1196468209 28800
KR> # Node ID 069db51711b5089167809cecc193b700aa2c6814
KR> # Parent 075b7c91e9729f9705af3a2f4726e6883be29b59
KR> ELEC cleanup - remove get_fq_devid().
KR> Removing get_fq_devid() since it's not necessary for building an
KR> InstanceID. Since this change causes error1 to be removed, I also
KR> renamed error2 to out, which conforms to the style of the other of
KR> the providers. Also, having an error2 without an error1 seemed
KR> silly.
Yep, all good things.
However, doesn't Virt_ElementCapabilities.c:cap_to_sys() need to
change to no longer expecting to parse the devid-style InstanceID?
--
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 Sat Dec 1 00:26:44 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 16:26:44 -0800
Subject: [Libvirt-cim] [PATCH] ELEC cleanup - remove get_fq_devid()
In-Reply-To: <87abov5kwp.fsf@theine.beaverton.ibm.com>
References: <069db51711b508916780.1196468233@elm3b41.beaverton.ibm.com>
<87abov5kwp.fsf@theine.beaverton.ibm.com>
Message-ID: <4750AA44.3090201@linux.vnet.ibm.com>
Dan Smith wrote:
> Yep, all good things.
>
> However, doesn't Virt_ElementCapabilities.c:cap_to_sys() need to
> change to no longer expecting to parse the devid-style InstanceID?
>
>
No, your recent patch removed that functionality. cap_to_sys() is now
a more generic function - it doesn't do any kind of checking, it just
returns a HostSystem instance.
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From danms at us.ibm.com Sat Dec 1 00:29:46 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 30 Nov 2007 16:29:46 -0800
Subject: [Libvirt-cim] [PATCH] ELEC cleanup - remove get_fq_devid()
In-Reply-To: <4750AA44.3090201@linux.vnet.ibm.com> (Kaitlin Rupert's message
of "Fri, 30 Nov 2007 16:26:44 -0800")
References: <069db51711b508916780.1196468233@elm3b41.beaverton.ibm.com>
<87abov5kwp.fsf@theine.beaverton.ibm.com>
<4750AA44.3090201@linux.vnet.ibm.com>
Message-ID: <871wa75kat.fsf@theine.beaverton.ibm.com>
KR> No, your recent patch removed that functionality. cap_to_sys() is
KR> now a more generic function - it doesn't do any kind of checking,
KR> it just returns a HostSystem instance.
Sorry, yes, I meant cap_to_cs() :)
--
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 Sat Dec 1 01:10:20 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 17:10:20 -0800
Subject: [Libvirt-cim] [PATCH] ELEC cleanup - remove get_fq_devid()
In-Reply-To: <871wa75kat.fsf@theine.beaverton.ibm.com>
References: <069db51711b508916780.1196468233@elm3b41.beaverton.ibm.com>
<87abov5kwp.fsf@theine.beaverton.ibm.com>
<4750AA44.3090201@linux.vnet.ibm.com>
<871wa75kat.fsf@theine.beaverton.ibm.com>
Message-ID: <4750B47C.4010907@linux.vnet.ibm.com>
Dan Smith wrote:
> KR> No, your recent patch removed that functionality. cap_to_sys() is
> KR> now a more generic function - it doesn't do any kind of checking,
> KR> it just returns a HostSystem instance.
>
> Sorry, yes, I meant cap_to_cs() :)
>
Yep, you're right. I must have made a mistake when I unit tested,
because my queries to EC passed before I submitted. Oops. Will send a
patch set. =)
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From kaitlin at linux.vnet.ibm.com Sat Dec 1 01:22:20 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 17:22:20 -0800
Subject: [Libvirt-cim] [PATCH 0 of 2] Remove devid-style InstanceID support
from ELEC and EC.
Message-ID:
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.
From kaitlin at linux.vnet.ibm.com Sat Dec 1 01:22:22 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 17:22:22 -0800
Subject: [Libvirt-cim] [PATCH 2 of 2] Removing support for devid-style
InstanceID from EC
In-Reply-To:
Message-ID: <23e70ea23f1a9d8fd59e.1196472142@elm3b41.beaverton.ibm.com>
# HG changeset patch
# User Kaitlin Rupert
# Date 1196472093 28800
# Node ID 23e70ea23f1a9d8fd59ed0980b077a014da8eb8b
# Parent e69c02e79e40056b1d1a4825c048d70355e9cf85
Removing support for devid-style InstanceID from EC.
Since ELEC no longer uses devid-style InstanceID, we need to remove the devid-parsing from cap_to_cs().
Signed-off-by: Kaitlin Rupert
diff -r e69c02e79e40 -r 23e70ea23f1a src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Fri Nov 30 16:54:45 2007 -0800
+++ b/src/Virt_ElementCapabilities.c Fri Nov 30 17:21:33 2007 -0800
@@ -31,7 +31,6 @@
#include "libcmpiutil.h"
#include "misc_util.h"
#include "std_association.h"
-#include "device_parsing.h"
#include "Virt_VirtualSystemManagementCapabilities.h"
#include "Virt_EnabledLogicalElementCapabilities.h"
@@ -119,8 +118,6 @@ static CMPIStatus cap_to_cs(const CMPIOb
struct inst_list *list)
{
const char *inst_id;
- char *host;
- char *device;
CMPIInstance *inst;
virConnectPtr conn;
CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -129,13 +126,6 @@ static CMPIStatus cap_to_cs(const CMPIOb
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"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");
goto error1;
}
@@ -143,14 +133,12 @@ static CMPIStatus cap_to_cs(const CMPIOb
if (s.rc != CMPI_RC_OK)
goto error1;
- inst = instance_from_name(_BROKER, conn, host, ref);
+ inst = instance_from_name(_BROKER, conn, inst_id, ref);
if (inst)
inst_list_add(list, inst);
virConnectClose(conn);
error1:
- free(host);
- free(device);
return s;
}
From kaitlin at linux.vnet.ibm.com Sat Dec 1 01:22:21 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Fri, 30 Nov 2007 17:22:21 -0800
Subject: [Libvirt-cim] [PATCH 1 of 2] ELEC cleanup - remove get_fq_devid()
In-Reply-To:
Message-ID:
# HG changeset patch
# User Kaitlin Rupert
# Date 1196470485 28800
# Node ID e69c02e79e40056b1d1a4825c048d70355e9cf85
# Parent e6be7823c8e90c1f4b722ce1b33d6d15db123029
ELEC cleanup - remove get_fq_devid().
Removing get_fq_devid() since it's not necessary for building an InstanceID. Since this change causes error1 to be removed, I also renamed error2 to out, which conforms to the style of the other of the providers. Also, having an error2 without an error1 seemed silly.
Signed-off-by: Kaitlin Rupert
diff -r e6be7823c8e9 -r e69c02e79e40 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 15:32:26 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 16:54:45 2007 -0800
@@ -30,7 +30,6 @@
#include "std_instance.h"
#include "misc_util.h"
-#include "device_parsing.h"
#include "cs_util.h"
#include "Virt_EnabledLogicalElementCapabilities.h"
@@ -58,24 +57,15 @@ static CMPIStatus set_inst_properties(co
CMPIArray *array;
uint16_t element;
int edit_name = 0;
- 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 error1;
- }
-
- CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars);
+ CMSetProperty(inst, "InstanceID", (CMPIValue *)sys_name, CMPI_chars);
array = CMNewArray(broker, 5, CMPI_uint16, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array))
- goto error2;
+ goto out;
element = (uint16_t)ENABLED;
CMSetArrayElementAt(array, 0, &element, CMPI_uint16);
@@ -97,9 +87,7 @@ static CMPIStatus set_inst_properties(co
CMSetProperty(inst, "ElementNameEditSupported",
(CMPIValue *)&edit_name, CMPI_boolean);
- error2:
- free(devid);
- error1:
+ out:
return s;
}
From heidieck at linux.vnet.ibm.com Mon Dec 3 08:53:43 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 09:53:43 +0100
Subject: [Libvirt-cim] [PATCH] ESD does not support specific result clases
properly
In-Reply-To: <6515e4a1c90bba936fa1.1196448753@elm3b41.beaverton.ibm.com>
References: <6515e4a1c90bba936fa1.1196448753@elm3b41.beaverton.ibm.com>
Message-ID: <4753C417.6080408@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> # 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"'
>
>
Great Kaitlin :). You got me. When changing this association, I was
really confused about the given references, but forgot to add this
comment to the mail. This makes it now clear, how the association works
:). Good work !
--
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 Dec 3 08:54:36 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 09:54:36 +0100
Subject: [Libvirt-cim] [PATCH] SDC doesn't support specific RASD classes
In-Reply-To:
References:
Message-ID: <4753C44C.6040301@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> # 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.
>
Great :) !
> I also missed this one while reviewing Heidi's patches.
Me too :( ... ooops.
--
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 Dec 3 09:21:47 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 10:21:47 +0100
Subject: [Libvirt-cim] [PATCH] SD doesn't return instances in all cases
In-Reply-To: <874pf374rv.fsf@theine.beaverton.ibm.com>
References: <1776beb36f5cffcfad4e.1196461268@elm3b41.beaverton.ibm.com>
<874pf374rv.fsf@theine.beaverton.ibm.com>
Message-ID: <4753CAAB.4050509@linux.vnet.ibm.com>
Good catch Kaitlin :).
Dan Smith wrote:
> 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.
Now, that you both pick up the filter_results() function, this is a good
time to enter this discussion. I agree that the filter_results()
function is handy and takes away a lot of checking and distinguishing
from the provider. For tiny numbers of returned instances and fast
systems, this will not cause any problems. But we should keep in mind,
that the providers should also scale for a large number of virtual
machines. As Dan already mentioned - this approach will become an
performance issue later. On the other hand its more the responsibility
of the provider - especially for our ones, that handle a lot of
subclasses at one time - to filter the returned instances, as the
responsibility of the generic association logic. So I want to follow
Dan's opinion and keep it for now. But we should add this to our ToDo
list and fix as time allows. I suppose this will mean to reorganize the
providers a bit and I do not expect a huge effort.
--
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 yunguol at cn.ibm.com Mon Dec 3 09:30:39 2007
From: yunguol at cn.ibm.com (Guo Lian Yun)
Date: Mon, 3 Dec 2007 17:30:39 +0800
Subject: [Libvirt-cim] Failing qurey of VirtualSystemManagementCapabilities
in Pegasus
Message-ID:
Hi,
I try to test VirtualSystemManagementCapabilities and get results as
follows:
Failing queries in Pegasus:
wbemein
http://root:password at localhost/root/virt:Xen_VirtualSystemManagementCapabilities
The return results list below, and that make tog-pegasus stop.
*
* wbemein: Http Exception: server returned nothing (no headers, no data)
*
However, I can get expected results in sfcb.
wbemein
http://root:password at localhost/root/virt:Xen_VirtualSystemManagementCapabilities
localhost:5988/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="zeit/0"
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol at cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From daisy at linux.vnet.ibm.com Mon Dec 3 09:36:00 2007
From: daisy at linux.vnet.ibm.com (daisy)
Date: Mon, 03 Dec 2007 17:36:00 +0800
Subject: [Libvirt-cim] Failing qurey of VirtualSystemManagementCapabilities
in Pegasus
Message-ID: <4753CE00.8010001@linux.vnet.ibm.com>
Hi,
I try to test VirtualSystemManagementCapabilities and get results as
follows:
Failing queries in Pegasus:
wbemein
http://root:password at localhost/root/virt:Xen_VirtualSystemManagementCapabilities
The return results list below, and that make tog-pegasus stop.
*
* wbemein: Http Exception: server returned nothing (no headers, no data)
*
However, I can get expected results in sfcb.
wbemein
http://root:password at localhost/root/virt:Xen_VirtualSystemManagementCapabilities
localhost:5988/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="zeit/0"
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol at cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
From daisy at linux.vnet.ibm.com Mon Dec 3 09:42:17 2007
From: daisy at linux.vnet.ibm.com (daisy)
Date: Mon, 03 Dec 2007 17:42:17 +0800
Subject: [Libvirt-cim] Failing qurey of EnabledLogicalElementCapabilities in
Pegasus
Message-ID: <4753CF79.40104@linux.vnet.ibm.com>
Hi,
I try to test EnabledLogicalElementCapabilities and get results as follows:
Failing queries in Pegasus:
wbemein
http://root:password at localhost/root/virt:Xen_EnabledLogicalElementCapabilities
*
* wbemein: Http Exception: server returned nothing (no headers, no data)
*
However, I can get expected results in sfcb.
wbemein
http://root:password at localhost/root/virt:Xen_EnabledLogicalElementCapabilities
localhost:5988/root/virt:Xen_EnabledLogicalElementCapabilities.InstanceID="Domain-0/0"
Best,
Regards
Daisy Guo Lian Yun
E-mail: yunguol at cn.ibm.com
IBM China Development Lab, Shanghai, China
TEL: (86)-21-61008057
From heidieck at linux.vnet.ibm.com Mon Dec 3 10:13:03 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 11:13:03 +0100
Subject: [Libvirt-cim] [PATCH 0 of 2] #2 Fix (again) VSMCaps and
ElementCaps
In-Reply-To: <4750A62D.1050400@linux.vnet.ibm.com>
References: <4750A62D.1050400@linux.vnet.ibm.com>
Message-ID: <4753D6AF.8050005@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> 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.
>>
>> Changes:
>> - Just a rebase on tip
>>
> Excellent - this one applied for me. +1
>
works for me too. +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 Mon Dec 3 10:23:26 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 11:23:26 +0100
Subject: [Libvirt-cim] [PATCH 0 of 2] Remove devid-style InstanceID support
from ELEC and EC.
In-Reply-To:
References:
Message-ID: <4753D91E.5010902@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> 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.
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
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 Mon Dec 3 10:26:00 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 11:26:00 +0100
Subject: [Libvirt-cim] Failing qurey of VirtualSystemManagementCapabilities
in Pegasus
In-Reply-To:
References:
Message-ID: <4753D9B8.8040100@linux.vnet.ibm.com>
Guo Lian Yun wrote:
>
> Hi,
>
> I try to test VirtualSystemManagementCapabilities and get results as
> follows:
>
> Failing queries in Pegasus:
>
> wbemein
> http://root:password at localhost/root/virt:Xen_VirtualSystemManagementCapabilities
>
> The return results list below, and that make tog-pegasus stop.
> *
> * wbemein: Http Exception: server returned nothing (no headers, no data)
> *
>
> However, I can get expected results in sfcb.
>
> wbemein
> http://root:password at localhost/root/virt:Xen_VirtualSystemManagementCapabilities
>
> localhost:5988/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="zeit/0"
>
Please check, if you have installed the latest libcmpiutil and
libvirt-cim libraries for Pegasus. I have tested in my system and it works.
If you have installed sfcb and Pegasus on one machine, configures takes
sfcb per default. You need to
./configure CIMSERVER=pegasus, make clean, make ...
to compile and install for Pegasus.
--
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 Dec 3 11:48:05 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 12:48:05 +0100
Subject: [Libvirt-cim] [PATCH 0 of 2] Remove devid-style InstanceID support
from ELEC and EC.
In-Reply-To:
References:
Message-ID: <4753ECF5.2030502@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> 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.
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>
There seems to be something broken by the last patch set series (applied
the two from Dan, followed by the two from Kaitlin).
Before applying patch set:
wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities
localhost:5988/root/virt:KVM_VirtualSystemManagementCapabilities.InstanceID="localhost.localdomain/0"
localhost:5988/root/virt:KVM_EnabledLogicalElementCapabilities.InstanceID="qemu1/0"
After applying patch set:
wbemein http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities
localhost:5988/root/virt:KVM_VirtualSystemManagementCapabilities.InstanceID="ManagementCapabilities"
localhost:5988/root/virt:Xen_VirtualSystemManagementCapabilities.InstanceID="ManagementCapabilities"
localhost:5988/root/virt:KVM_EnabledLogicalElementCapabilities.InstanceID="qemu1"
The instance of Xen_VirtualSystemManagementCapabilities is wrong. I had
a look into the code and think this could be easily fixed by starting
return_vsm_cap() with an connect_by_classname(). Kaitlin, please can you
incorporate that fix into your patch set ? 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 Dec 3 11:37:02 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:02 +0200
Subject: [Libvirt-cim] [PATCH 5 of 9] RAFP: Provider registered per subclass
In-Reply-To:
Message-ID: <9fac31df90d1ce6279af.1196685422@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196685311 -3600
# Node ID 9fac31df90d1ce6279aff869ad9da51b411223e9
# Parent 495e8bdd4e1415b253fd64f0527760ad11b75580
RAFP: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 495e8bdd4e14 -r 9fac31df90d1 schema/ResourceAllocationFromPool.registration
--- a/schema/ResourceAllocationFromPool.registration Mon Dec 03 13:35:10 2007 +0100
+++ b/schema/ResourceAllocationFromPool.registration Mon Dec 03 13:35:11 2007 +0100
@@ -1,4 +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
+Xen_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association
+KVM_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association
\ No newline at end of file
diff -r 495e8bdd4e14 -r 9fac31df90d1 src/Virt_ResourceAllocationFromPool.c
--- a/src/Virt_ResourceAllocationFromPool.c Mon Dec 03 13:35:10 2007 +0100
+++ b/src/Virt_ResourceAllocationFromPool.c Mon Dec 03 13:35:11 2007 +0100
@@ -305,8 +305,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:36:58 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:36:58 +0200
Subject: [Libvirt-cim] [PATCH 1 of 9] EAFP: Provider registered per subclass
In-Reply-To:
Message-ID: <6dbbe2c148a7cc2ba74f.1196685418@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196683313 -3600
# Node ID 6dbbe2c148a7cc2ba74ffc9e3ddcf7acdc30042c
# Parent 8140438a647cd53017d79b7036702fc053fe9e9c
EAFP: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
wbemain -ac CIM_ElementAllocatedFromPool 'http://localhost/root/virt:KVM_Memory.DeviceID="qemu1/mem",CreationClassName="KVM_Memory",SystemName="qemu1",SystemCreationClassName=""'
localhost:5988/root/virt:KVM_MemoryPool.InstanceID="MemoryPool/0"
localhost:5988/root/virt:KVM_MemoryPool.InstanceID="MemoryPool/0"
Signed-off-by: Heidi Eckhart
diff -r 8140438a647c -r 6dbbe2c148a7 schema/ElementAllocatedFromPool.registration
--- a/schema/ElementAllocatedFromPool.registration Fri Nov 30 17:21:33 2007 -0800
+++ b/schema/ElementAllocatedFromPool.registration Mon Dec 03 13:01:53 2007 +0100
@@ -1,4 +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
+Xen_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
+KVM_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
diff -r 8140438a647c -r 6dbbe2c148a7 src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Fri Nov 30 17:21:33 2007 -0800
+++ b/src/Virt_ElementAllocatedFromPool.c Mon Dec 03 13:01:53 2007 +0100
@@ -326,8 +326,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:36:57 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:36:57 +0200
Subject: [Libvirt-cim] [PATCH 0 of 9] Reorganized association provider
registration
Message-ID:
The association provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration. This
patch set tries to fix it. Please review. Thanks.
Based on:
- #2 Fix (again) VSMCaps and ElementCap
- Remove devid-style InstanceID support from ELEC and EC
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:37:05 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:05 +0200
Subject: [Libvirt-cim] [PATCH 8 of 9] SD: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196685313 -3600
# Node ID c6de8c296f561df41811ca04c2ea992b729cfea3
# Parent 909704b38ca4c9bfcb1121924053f26818d8316b
SD: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 909704b38ca4 -r c6de8c296f56 schema/SystemDevice.registration
--- a/schema/SystemDevice.registration Mon Dec 03 13:35:12 2007 +0100
+++ b/schema/SystemDevice.registration Mon Dec 03 13:35:13 2007 +0100
@@ -1,4 +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
+Xen_SystemDevice root/virt Virt_SystemDeviceProvider Virt_SystemDevice association
+KVM_SystemDevice root/virt Virt_SystemDeviceProvider Virt_SystemDevice association
diff -r 909704b38ca4 -r c6de8c296f56 src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Mon Dec 03 13:35:12 2007 +0100
+++ b/src/Virt_SystemDevice.c Mon Dec 03 13:35:13 2007 +0100
@@ -288,8 +288,7 @@ static struct std_assoc *assoc_handlers[
NULL
};
-STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
-STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
+STDA_AssocMIStub(, Virt_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:36:59 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:36:59 +0200
Subject: [Libvirt-cim] [PATCH 2 of 9] EC: Provider registered per subclass
In-Reply-To:
Message-ID: <97209a4aec46e659a913.1196685419@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196683550 -3600
# Node ID 97209a4aec46e659a9134dc28ac19c2f43b51c7c
# Parent 6dbbe2c148a7cc2ba74ffc9e3ddcf7acdc30042c
EC: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 6dbbe2c148a7 -r 97209a4aec46 schema/ElementCapabilities.registration
--- a/schema/ElementCapabilities.registration Mon Dec 03 13:01:53 2007 +0100
+++ b/schema/ElementCapabilities.registration Mon Dec 03 13:05:50 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association
-KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association
+Xen_ElementCapabilities root/virt Virt_ElementCapabilitiesProvider Virt_ElementCapabilities association
+KVM_ElementCapabilities root/virt Virt_ElementCapabilitiesProvider Virt_ElementCapabilities association
diff -r 6dbbe2c148a7 -r 97209a4aec46 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Mon Dec 03 13:01:53 2007 +0100
+++ b/src/Virt_ElementCapabilities.c Mon Dec 03 13:05:50 2007 +0100
@@ -359,8 +359,7 @@ struct std_assoc *assoc_handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
-STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
+STDA_AssocMIStub(, Virt_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
* Local Variables:
* mode: C
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:37:00 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:00 +0200
Subject: [Libvirt-cim] [PATCH 3 of 9] ESD: Provider registered per subclass
In-Reply-To:
Message-ID: <7c6276f57a7423a8c9a8.1196685420@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196683916 -3600
# Node ID 7c6276f57a7423a8c9a88fd48a3b4b7180948fd1
# Parent 97209a4aec46e659a9134dc28ac19c2f43b51c7c
ESD: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 97209a4aec46 -r 7c6276f57a74 schema/ElementSettingData.registration
--- a/schema/ElementSettingData.registration Mon Dec 03 13:05:50 2007 +0100
+++ b/schema/ElementSettingData.registration Mon Dec 03 13:11:56 2007 +0100
@@ -1,4 +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
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_ElementSettingData root/virt Virt_ElementSettingDataProvider Virt_ElementSettingData association
+KVM_ElementSettingData root/virt Virt_ElementSettingDataProvider Virt_ElementSettingData association
diff -r 97209a4aec46 -r 7c6276f57a74 src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c Mon Dec 03 13:05:50 2007 +0100
+++ b/src/Virt_ElementSettingData.c Mon Dec 03 13:11:56 2007 +0100
@@ -227,8 +227,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:37:01 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:01 +0200
Subject: [Libvirt-cim] [PATCH 4 of 9] HS: Provider registered per subclass
In-Reply-To:
Message-ID: <495e8bdd4e1415b253fd.1196685421@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196685310 -3600
# Node ID 495e8bdd4e1415b253fd64f0527760ad11b75580
# Parent 7c6276f57a7423a8c9a88fd48a3b4b7180948fd1
HS: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 7c6276f57a74 -r 495e8bdd4e14 schema/HostedService.registration
--- a/schema/HostedService.registration Mon Dec 03 13:11:56 2007 +0100
+++ b/schema/HostedService.registration Mon Dec 03 13:35:10 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
-# Classname Namespace ProviderName ProviderModule ProviderTypes ...
-Xen_HostedService root/virt Xen_HostedServiceProvider Virt_HostedService association
-KVM_HostedService root/virt KVM_HostedServiceProvider Virt_HostedService association
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_HostedService root/virt Virt_HostedServiceProvider Virt_HostedService association
+KVM_HostedService root/virt Virt_HostedServiceProvider Virt_HostedService association
diff -r 7c6276f57a74 -r 495e8bdd4e14 src/Virt_HostedService.c
--- a/src/Virt_HostedService.c Mon Dec 03 13:11:56 2007 +0100
+++ b/src/Virt_HostedService.c Mon Dec 03 13:35:10 2007 +0100
@@ -159,8 +159,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:37:06 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:06 +0200
Subject: [Libvirt-cim] [PATCH 9 of 9] VSSDC: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196685314 -3600
# Node ID cd9afb53c5e76783d891d7bda74d1e642cf6701e
# Parent c6de8c296f561df41811ca04c2ea992b729cfea3
VSSDC: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r c6de8c296f56 -r cd9afb53c5e7 schema/VSSDComponent.registration
--- a/schema/VSSDComponent.registration Mon Dec 03 13:35:13 2007 +0100
+++ b/schema/VSSDComponent.registration Mon Dec 03 13:35:14 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association
-KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association
+Xen_VirtualSystemSettingDataComponent root/virt Virt_VSSDComponentProvider Virt_VSSDComponent association
+KVM_VirtualSystemSettingDataComponent root/virt Virt_VSSDComponentProvider Virt_VSSDComponent association
diff -r c6de8c296f56 -r cd9afb53c5e7 src/Virt_VSSDComponent.c
--- a/src/Virt_VSSDComponent.c Mon Dec 03 13:35:13 2007 +0100
+++ b/src/Virt_VSSDComponent.c Mon Dec 03 13:35:14 2007 +0100
@@ -230,8 +230,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:37:04 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:04 +0200
Subject: [Libvirt-cim] [PATCH 7 of 9] SDS: Provider registered per subclass
In-Reply-To:
Message-ID: <909704b38ca4c9bfcb11.1196685424@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196685312 -3600
# Node ID 909704b38ca4c9bfcb1121924053f26818d8316b
# Parent 4caca9f23d36235f40a1011be956e3c8d135f77b
SDS: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 4caca9f23d36 -r 909704b38ca4 schema/SettingsDefineState.registration
--- a/schema/SettingsDefineState.registration Mon Dec 03 13:35:11 2007 +0100
+++ b/schema/SettingsDefineState.registration Mon Dec 03 13:35:12 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association
-KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association
+Xen_SettingsDefineState root/virt Virt_SettingsDefineStateProvider Virt_SettingsDefineState association
+KVM_SettingsDefineState root/virt Virt_SettingsDefineStateProvider Virt_SettingsDefineState association
diff -r 4caca9f23d36 -r 909704b38ca4 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Mon Dec 03 13:35:11 2007 +0100
+++ b/src/Virt_SettingsDefineState.c Mon Dec 03 13:35:12 2007 +0100
@@ -399,8 +399,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:37:03 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:37:03 +0200
Subject: [Libvirt-cim] [PATCH 6 of 9] SDC: Provider registered per subclass
In-Reply-To:
Message-ID: <4caca9f23d36235f40a1.1196685423@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196685311 -3600
# Node ID 4caca9f23d36235f40a1011be956e3c8d135f77b
# Parent 9fac31df90d1ce6279aff869ad9da51b411223e9
SDC: Provider registered per subclass
The provider was registered for each subclass with a different
name. That caused duplicated instances as the same provider gets
called twice, but has no chance to figure out for which registration.
Signed-off-by: Heidi Eckhart
diff -r 9fac31df90d1 -r 4caca9f23d36 schema/SettingsDefineCapabilities.registration
--- a/schema/SettingsDefineCapabilities.registration Mon Dec 03 13:35:11 2007 +0100
+++ b/schema/SettingsDefineCapabilities.registration Mon Dec 03 13:35:11 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
+Xen_SettingsDefineCapabilities root/virt Virt_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association
+KVM_SettingsDefineCapabilities root/virt Virt_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association
diff -r 9fac31df90d1 -r 4caca9f23d36 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Mon Dec 03 13:35:11 2007 +0100
+++ b/src/Virt_SettingsDefineCapabilities.c Mon Dec 03 13:35:11 2007 +0100
@@ -900,8 +900,7 @@ struct std_assoc *assoc_handlers[] = {
};
-STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
-STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
+STDA_AssocMIStub(, Virt_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:40:33 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:40:33 +0200
Subject: [Libvirt-cim] [PATCH 2 of 2] HS: Added Association declaration to
mof
In-Reply-To:
Message-ID: <1217a5cd073c1b49bb2b.1196685633@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196685316 -3600
# Node ID 1217a5cd073c1b49bb2b5224bedf9986672ba207
# Parent 7a5f0b76faf104aa98922194d190724950582712
HS: Added Association declaration to mof
Signed-off-by: Heidi Eckhart
diff -r 7a5f0b76faf1 -r 1217a5cd073c schema/HostedService.mof
--- a/schema/HostedService.mof Mon Dec 03 13:35:15 2007 +0100
+++ b/schema/HostedService.mof Mon Dec 03 13:35: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
+{
};
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:40:32 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:40:32 +0200
Subject: [Libvirt-cim] [PATCH 1 of 2] ESD: Added Association declaration to
mof
In-Reply-To:
Message-ID: <7a5f0b76faf104aa9892.1196685632@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196685315 -3600
# Node ID 7a5f0b76faf104aa98922194d190724950582712
# Parent cd9afb53c5e76783d891d7bda74d1e642cf6701e
ESD: Added Association declaration to mof
Signed-off-by: Heidi Eckhart
diff -r cd9afb53c5e7 -r 7a5f0b76faf1 schema/ElementSettingData.mof
--- a/schema/ElementSettingData.mof Mon Dec 03 13:35:14 2007 +0100
+++ b/schema/ElementSettingData.mof Mon Dec 03 13:35:15 2007 +0100
@@ -1,6 +1,11 @@
// Copyright IBM Corp. 2007
-class Xen_ElementSettingData : CIM_ElementSettingData {
+
+[Association]
+class Xen_ElementSettingData : CIM_ElementSettingData
+{
};
-class KVM_ElementSettingData : CIM_ElementSettingData {
+[Association]
+class KVM_ElementSettingData : CIM_ElementSettingData
+{
};
From heidieck at linux.vnet.ibm.com Mon Dec 3 11:40:31 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:40:31 +0200
Subject: [Libvirt-cim] [PATCH 0 of 2] Added Association declaration to mof
Message-ID:
The qualifier [Association] was missing in the mof for ElementSettingData and HostedSystem.
From heidieck at linux.vnet.ibm.com Mon Dec 3 12:45:03 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 13:45:03 +0100
Subject: [Libvirt-cim] [PATCH 00 of 12] #3 - Adoption of changes to
std_assoc struct in std_association for all associations
In-Reply-To: <47504320.5080505@linux.vnet.ibm.com>
References:
<47504320.5080505@linux.vnet.ibm.com>
Message-ID: <4753FA4F.3080300@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> 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. =)
Yes. Kaitlin, if you have time and would like to do it, it would be
great if you can you investigate a bit on it ? I would like to have a
look into the make_ref() (connect_by_classname) and
match_hypervisor_prefix() patch sets for tomorrow.
--
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 Dec 3 12:01:42 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Mon, 03 Dec 2007 14:01:42 +0200
Subject: [Libvirt-cim] [PATCH] [RFC] make_ref() of associations
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# 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
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[] = {
From danms at us.ibm.com Mon Dec 3 15:45:55 2007
From: danms at us.ibm.com (Dan Smith)
Date: Mon, 03 Dec 2007 07:45:55 -0800
Subject: [Libvirt-cim] [PATCH 0 of 9] Reorganized association provider
registration
In-Reply-To: (Heidi Eckhart's
message of "Mon, 03 Dec 2007 13:36:57 +0200")
References:
Message-ID: <87sl2j4w98.fsf@theine.beaverton.ibm.com>
HE> The association provider was registered for each subclass with a
HE> different name. That caused duplicated instances as the same
HE> provider gets called twice, but has no chance to figure out for
HE> which registration.
It does, actually, if you use ASSOC_MATCH(). That was the little hack
we used to prevent duplicate entries while enumerating a CIM_Foo class
while we were not using connect_by_classname(). However, I think that
using the classname connection to prevent duplicates is better. Some
care may be required in associations that do not have to connect to
libvirt.
HE> This patch set tries to fix it. Please review. Thanks.
I tested EAFP and it works for me. I'll move on to test the rest, but
feedback from others would be good.
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 Dec 3 16:33:07 2007
From: danms at us.ibm.com (Dan Smith)
Date: Mon, 03 Dec 2007 08:33:07 -0800
Subject: [Libvirt-cim] [PATCH 8 of 9] SD: Provider registered per subclass
In-Reply-To: (Heidi
Eckhart's message of "Mon, 03 Dec 2007 13:37:05 +0200")
References:
Message-ID: <87k5nv4u2k.fsf@theine.beaverton.ibm.com>
HE> # HG changeset patch
HE> # User Heidi Eckhart
HE> # Date 1196685313 -3600
HE> # Node ID c6de8c296f561df41811ca04c2ea992b729cfea3
HE> # Parent 909704b38ca4c9bfcb1121924053f26818d8316b
HE> SD: Provider registered per subclass
Some of these providers still have ASSOC_MATCH() in them which, when
combined with your s/Xen_/Virt_/ change to the provider name, causes
them to always return no instances. I first noticed this with
SystemDevice, but there are others in your set that need to have those
calls removed.
When I remove them, this patch seems fine 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 Mon Dec 3 16:44:41 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Mon, 03 Dec 2007 11:44:41 -0500
Subject: [Libvirt-cim] [PATCH] Patch guidelines added to SubmittingPatches
In-Reply-To: <87fxyoahjn.fsf@theine.beaverton.ibm.com>
References:
<87mysxauow.fsf@theine.beaverton.ibm.com>
<474F2631.40605@linux.vnet.ibm.com>
<87fxyoahjn.fsf@theine.beaverton.ibm.com>
Message-ID: <47543279.9040905@linux.vnet.ibm.com>
Dan Smith wrote:
> 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
+
+Patches
+
+To submit patches to libvirt-cim, you must follow the DCO process, outlined
+below:
+
+Developer's Certificate of Origin 1.1
+By making a contribution to this project, I certify that:
+
+-
+
+ The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license indicated in
+ the file; or
+
+
+-
+
+ The contribution is based upon previous work that, to the best of my
+ knowledge, is covered under an appropriate open source license and I have the
+ right under that license to submit that work with modifications, whether
+ created in whole or in part by me, under the same open source license
+ (unless I am permitted to submit under a different license), as indicated in
+ the file; or
+
+
+-
+
+ The contribution was provided directly to me by some other person who
+ certified (1), (2) or (3) and I have not modified it.
+
+
+-
+
+ I understand and agree that this project and the contribution are public and
+ that a record of the contribution (including all personal information I
+ submit with it, including my sign-off) is maintained indefinitely and may be
+ redistributed consistent with this project or the open source license(s)
+ involved.
+
+
+
+
+then you just add a line saying
+
+
+ Signed-off-by: Random J Developer <random at developer.example.org>
+
+
+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.
+
+
+ For help on how to use the patchbomb extension, see
+ Section 14.4 of
+ Distributed revision control with Mercurial.
+
+
+ For help on the queues extension, see
+ Chapter 12.
+
+
+Single Patches:
+
+-
+
+ 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."
+
+
+-
+
+ 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.
+
+
+-
+
+ Stay on task with a patch. If you notice other problems while you are
+ working on a 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.
+
+
+-
+
+ 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.
+
+
+-
+
+ 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.
+
+
+-
+
+ 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.
+
+
+-
+
+ 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:
+
+-
+
+ 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.
+
+
+-
+
+ 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."
+
+
+-
+
+ If you resend a patchset, apply part (6) 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
+ grendel at linux.vnet.ibm.com
+
+ Patch Compliance Officer
Schema
diff -r d182b5a3324f -r 1a3e2e6e3ec1 doc/site.xsl
--- a/doc/site.xsl Mon Dec 03 11:22:46 2007 -0500
+++ b/doc/site.xsl Tue Dec 04 10:48:47 2007 -0500
@@ -50,6 +50,9 @@
schema.html
+
+
+ patches.html
unknown.html
From kaitlin at linux.vnet.ibm.com Tue Dec 4 15:53:25 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 07:53:25 -0800
Subject: [Libvirt-cim] [PATCH 0 of 9] Reorganized association provider
registration
In-Reply-To: <87hciy1nfy.fsf@theine.beaverton.ibm.com>
References:
<475435BB.6070902@linux.vnet.ibm.com>
<87fxyj4sjh.fsf@theine.beaverton.ibm.com>
<4754475A.6010102@linux.vnet.ibm.com>
<4755492C.1070409@linux.vnet.ibm.com>
<87hciy1nfy.fsf@theine.beaverton.ibm.com>
Message-ID: <475577F5.30202@linux.vnet.ibm.com>
Dan Smith wrote:
> HE> Yes, for Pegasus, but not for sfcb - sfcb calls the association
> HE> provider only once, with the client's assocClass
> HE> (e.g. CIM_SystemDevice), while Pegasus manipulates assocClass to
> HE> fit the subclass' association name (Xen_SystemDevice and
> HE> KVM_SystemDevice) and calls the provider for each subclass.
>
> Ah, okay. Hmm, that's unfortunate that they behave so differently.
>
> So, if you resolve the association with an assocClass of CIM_Foo on
> sfcb, the provider handler actually sees CIM_Foo as the assocClass,
> per my testing just now. So we need to make sure that we don't use
> the assocClass (or resultClass) as the target of a
> connect_by_classname(). Might be obvious, but I just wanted to make
> it explicit.
>
>
Oh, both of these points are interesting - I didn't realize sfcb behaves
differently (I've never used it). Thanks for bringing up this issue
Heidi =)
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From grendel at linux.vnet.ibm.com Tue Dec 4 15:57:04 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Tue, 04 Dec 2007 10:57:04 -0500
Subject: [Libvirt-cim] [PATCH] Add patching guidelines to site
In-Reply-To: <1a3e2e6e3ec15d8f600e.1196783365@wulfgar.pok.ibm.com>
References: <1a3e2e6e3ec15d8f600e.1196783365@wulfgar.pok.ibm.com>
Message-ID: <475578D0.6020305@linux.vnet.ibm.com>
Jay Gagnon wrote:
> # HG changeset patch
> # User Jay Gagnon
> # Date 1196783327 18000
> # Node ID 1a3e2e6e3ec15d8f600eb21477e18b6a48ccb2df
> # Parent d182b5a3324feb2d8403d995f8208f8e0057aa6d
> Add patching guidelines to site.
>
> Signed-off-by: Jay Gagnon
>
>
>
This also serves as a reminder that we haven't actually committed my
patch for doc/SubmittingPatches. :)
Also, I'll double-check this but I think I still need to send out the
equivalent patch for libcmpiutil's doc/SubmittingPatches.
--
-Jay
From danms at us.ibm.com Tue Dec 4 16:09:34 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:09:34 -0800
Subject: [Libvirt-cim] [PATCH] Add patching guidelines to site
In-Reply-To: <475578D0.6020305@linux.vnet.ibm.com> (Jay Gagnon's message of
"Tue, 04 Dec 2007 10:57:04 -0500")
References: <1a3e2e6e3ec15d8f600e.1196783365@wulfgar.pok.ibm.com>
<475578D0.6020305@linux.vnet.ibm.com>
Message-ID: <871wa21lxd.fsf@theine.beaverton.ibm.com>
JG> This also serves as a reminder that we haven't actually committed
JG> my patch for doc/SubmittingPatches. :)
Actually, I just committed it with the web patch:)
JG> Also, I'll double-check this but I think I still need to send out
JG> the equivalent patch for libcmpiutil's doc/SubmittingPatches.
You can if you want, but I think the libvirt-cim version probably
covers us for now, and it would just be duplicate information.
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 Dec 4 16:13:49 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:13:49 -0800
Subject: [Libvirt-cim] [PATCH 3 of 6] Add VirtualSystemMigrationService
In-Reply-To: <4754B595.6080506@linux.vnet.ibm.com> (Kaitlin Rupert's message
of "Mon, 03 Dec 2007 18:04:05 -0800")
References: <5ba311c0a725a603bb0e.1196711788@theine>
<4754B333.4000404@linux.vnet.ibm.com>
<87lk8b2pdf.fsf@theine.beaverton.ibm.com>
<4754B595.6080506@linux.vnet.ibm.com>
Message-ID: <87wsruzbcy.fsf@theine.beaverton.ibm.com>
KR> Could you also include instructions on testing migration? It
KR> seems difficult to do via wbemcli - I haven't tested a method
KR> provider before.
I use the following xml with wbemcat or wbemexec to make the method
call:
Xen_VirtualSystemMigrationService
foo.bar.com
Xen_ComputerSystem
pv0
localhost
You'll need to change "pv0" to the name of a valid domain, and the
"localhost" to a valid destination host (or leave it as localhost to
test on loopback).
Note that unless you have a key setup, you'll need to type root's
password on the CIMOM's stdin.
You should be able to tweak the above to test the IsMigratable flavor
as well.
--
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 Dec 4 16:16:00 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Tue, 04 Dec 2007 11:16:00 -0500
Subject: [Libvirt-cim] [PATCH] Add patching guidelines to site
In-Reply-To: <871wa21lxd.fsf@theine.beaverton.ibm.com>
References: <1a3e2e6e3ec15d8f600e.1196783365@wulfgar.pok.ibm.com>
<475578D0.6020305@linux.vnet.ibm.com>
<871wa21lxd.fsf@theine.beaverton.ibm.com>
Message-ID: <47557D40.2020601@linux.vnet.ibm.com>
Dan Smith wrote:
> JG> This also serves as a reminder that we haven't actually committed
> JG> my patch for doc/SubmittingPatches. :)
>
> Actually, I just committed it with the web patch:)
>
Cools
> JG> Also, I'll double-check this but I think I still need to send out
> JG> the equivalent patch for libcmpiutil's doc/SubmittingPatches.
>
> You can if you want, but I think the libvirt-cim version probably
> covers us for now, and it would just be duplicate information.
>
Okay, in that case I won't bother. We can always do it later if
somebody says we have to.
--
-Jay
From danms at us.ibm.com Tue Dec 4 15:56:02 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:02 -0700
Subject: [Libvirt-cim] [PATCH 0 of 6] #2 Add migration support
Message-ID:
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.
From danms at us.ibm.com Tue Dec 4 15:56:04 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:04 -0700
Subject: [Libvirt-cim] [PATCH 2 of 6] Add VirtualSystemMigrationCapabilties
build support
In-Reply-To:
Message-ID: <853bc758cb198acef26f.1196787364@theine>
# HG changeset patch
# User Dan Smith
# Date 1196787215 28800
# Node ID 853bc758cb198acef26fb916fa913108ef50a3f8
# Parent 4a7e5f2cbb2301be1421491d1ba03870983af27f
Add VirtualSystemMigrationCapabilties build support
Signed-off-by: Dan Smith
diff -r 4a7e5f2cbb23 -r 853bc758cb19 Makefile.am
--- a/Makefile.am Tue Dec 04 08:53:32 2007 -0800
+++ b/Makefile.am Tue Dec 04 08:53:35 2007 -0800
@@ -33,7 +33,8 @@ MOFS = \
schema/ResourceAllocationFromPool.mof \
schema/ElementAllocatedFromPool.mof \
schema/HostedService.mof \
- schema/ElementSettingData.mof
+ schema/ElementSettingData.mof \
+ schema/VSMigrationCapabilities.mof
INTEROP_MOFS = \
schema/ComputerSystem.mof \
@@ -72,7 +73,8 @@ REGS = \
schema/ResourceAllocationFromPool.registration \
schema/ElementAllocatedFromPool.registration \
schema/HostedService.registration \
- schema/ElementSettingData.registration
+ schema/ElementSettingData.registration \
+ schema/VSMigrationCapabilities.registration
INTEROP_REGS = \
schema/RegisteredProfile.registration \
diff -r 4a7e5f2cbb23 -r 853bc758cb19 schema/VSMigrationCapabilities.mof
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/VSMigrationCapabilities.mof Tue Dec 04 08:53:35 2007 -0800
@@ -0,0 +1,17 @@
+// Copyright IBM Corp. 2007
+
+class Virt_VirtualSystemMigrationCapabilities : CIM_Capabilities {
+
+ uint16 DestinationHostFormatsSupported[];
+
+ uint16 SynchronousMethodsSupported[];
+
+ uint16 AsynchronousMethodsSupported[];
+
+};
+
+class Xen_VirtualSystemMigrationCapabilities : Virt_VirtualSystemMigrationCapabilities {
+};
+
+class KVM_VirtualSystemMigrationCapabilities : Virt_VirtualSystemMigrationCapabilities {
+};
diff -r 4a7e5f2cbb23 -r 853bc758cb19 schema/VSMigrationCapabilities.registration
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/VSMigrationCapabilities.registration Tue Dec 04 08:53:35 2007 -0800
@@ -0,0 +1,4 @@
+# Copyright IBM Corp. 2007
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_VirtualSystemMigrationCapabilities root/virt Virt_VSMC Virt_VSMigrationCapabilities instance
+KVM_VirtualSystemMigrationCapabilities root/virt Virt_VSMC Virt_VSMigrationCapabilities instance
\ No newline at end of file
diff -r 4a7e5f2cbb23 -r 853bc758cb19 src/Makefile.am
--- a/src/Makefile.am Tue Dec 04 08:53:32 2007 -0800
+++ b/src/Makefile.am Tue Dec 04 08:53:35 2007 -0800
@@ -50,7 +50,8 @@ provider_LTLIBRARIES = libVirt_ComputerS
libVirt_ResourceAllocationFromPool.la \
libVirt_ElementAllocatedFromPool.la \
libVirt_HostedService.la \
- libVirt_ElementSettingData.la
+ libVirt_ElementSettingData.la \
+ libVirt_VSMigrationCapabilities.la
libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c
libVirt_Device_la_SOURCES = Virt_Device.c
@@ -138,3 +139,5 @@ libVirt_ElementSettingData_la_DEPENDENCI
libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_RASD.la
libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c
libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD -lVirt_RASD
+
+libVirt_VSMigrationCapabilities_la_SOURCES = Virt_VSMigrationCapabilities.c
\ No newline at end of file
From danms at us.ibm.com Tue Dec 4 15:56:03 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:03 -0700
Subject: [Libvirt-cim] [PATCH 1 of 6] Add VirtualSystemMigrationCapabilities
In-Reply-To:
Message-ID: <4a7e5f2cbb2301be1421.1196787363@theine>
# HG changeset patch
# User Dan Smith
# Date 1196787212 28800
# Node ID 4a7e5f2cbb2301be1421491d1ba03870983af27f
# Parent 32b2c8519573142f2b3176c40501b0ca0c305a7c
Add VirtualSystemMigrationCapabilities
Changes:
- Fixed array size for async methods
- Added sync methods
Signed-off-by: Dan Smith
diff -r 32b2c8519573 -r 4a7e5f2cbb23 src/Virt_VSMigrationCapabilities.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_VSMigrationCapabilities.c Tue Dec 04 08:53:32 2007 -0800
@@ -0,0 +1,192 @@
+/*
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * 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
+ */
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "libcmpiutil.h"
+#include "misc_util.h"
+#include "std_instance.h"
+
+#include "Virt_VSMigrationCapabilities.h"
+
+const static CMPIBroker *_BROKER;
+
+#define SVPC_MIG_MVSTH 2
+#define SVPC_MIG_MVSTS 3
+#define SVPC_MIG_CVSIMTH 4
+#define SVPC_MIG_CVSIMTS 5
+
+static CMPIStatus set_method_properties(const CMPIBroker *broker,
+ CMPIInstance *inst)
+{
+ CMPIArray *array;
+ CMPIStatus s;
+ uint16_t val;
+
+ array = CMNewArray(broker, 2, CMPI_INTEGER, &s);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
+ val = SVPC_MIG_MVSTH;
+ CMSetArrayElementAt(array, 0, (CMPIValue *)&val, CMPI_uint16);
+
+ val = SVPC_MIG_MVSTS;
+ CMSetArrayElementAt(array, 1, (CMPIValue *)&val, CMPI_uint16);
+
+ CMSetProperty(inst, "AsynchronousMethodsSupported",
+ (CMPIValue *)&array, CMPI_ARRAY);
+
+
+ array = CMNewArray(broker, 2, CMPI_INTEGER, &s);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
+ val = SVPC_MIG_CVSIMTH;
+ CMSetArrayElementAt(array, 0, (CMPIValue *)&val, CMPI_uint16);
+
+ val = SVPC_MIG_CVSIMTS;
+ CMSetArrayElementAt(array, 1, (CMPIValue *)&val, CMPI_uint16);
+
+ CMSetProperty(inst, "SynchronousMethodsSupported",
+ (CMPIValue *)&array, CMPI_ARRAY);
+
+ CMSetStatus(&s, CMPI_RC_OK);
+
+ return s;
+}
+
+CMPIStatus get_migration_caps(const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ const CMPIBroker *broker)
+{
+ CMPIInstance *inst;
+ CMPIStatus s;
+
+ inst = get_typed_instance(broker,
+ CLASSNAME(ref),
+ "VirtualSystemMigrationCapabilities",
+ NAMESPACE(ref));
+ if (inst == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get instance for %s", CLASSNAME(ref));
+ return s;
+ }
+
+ CMSetProperty(inst, "InstanceID",
+ (CMPIValue *)"MigrationCapabilities", CMPI_chars);
+
+ s = set_method_properties(broker, inst);
+
+ if (s.rc == CMPI_RC_OK)
+ *_inst = inst;
+
+ return s;
+}
+
+static CMPIStatus return_vsmc(const CMPIObjectPath *ref,
+ const CMPIResult *results,
+ bool name_only)
+{
+ CMPIInstance *inst;
+ CMPIStatus s;
+
+ s = get_migration_caps(ref, &inst, _BROKER);
+
+ if (s.rc == CMPI_RC_OK) {
+ if (name_only)
+ cu_return_instance_name(results, inst);
+ else
+ CMReturnInstance(results, inst);
+ }
+
+ return s;
+}
+
+static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref)
+{
+ return return_vsmc(ref, results, true);
+}
+
+static CMPIStatus EnumInstances(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const char **properties)
+{
+
+ return return_vsmc(ref, results, false);
+}
+
+
+static CMPIStatus GetInstance(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const char **properties)
+{
+ CMPIInstance *inst;
+ CMPIStatus s;
+ const char *prop;
+
+ s = get_migration_caps(ref, &inst, _BROKER);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
+ prop = cu_compare_ref(ref, inst);
+ if (prop != NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)", prop);
+ } else {
+ CMReturnInstance(results, inst);
+ }
+
+ return s;
+}
+
+DEFAULT_CI();
+DEFAULT_MI();
+DEFAULT_DI();
+DEFAULT_EQ();
+DEFAULT_INST_CLEANUP();
+
+STD_InstanceMIStub(, Virt_VSMC,
+ _BROKER,
+ libvirt_cim_init());
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 32b2c8519573 -r 4a7e5f2cbb23 src/Virt_VSMigrationCapabilities.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_VSMigrationCapabilities.h Tue Dec 04 08:53:32 2007 -0800
@@ -0,0 +1,35 @@
+/*
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * 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
+ */
+
+CMPIStatus get_migration_caps(const CMPIObjectPath *reference,
+ CMPIInstance **_inst,
+ const CMPIBroker *broker);
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
+
From danms at us.ibm.com Tue Dec 4 15:56:08 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:08 -0700
Subject: [Libvirt-cim] [PATCH 6 of 6] Add ElementCapabilities support for
VirtualSystemMigrationCapabilities
In-Reply-To:
Message-ID:
# HG changeset patch
# User Dan Smith
# Date 1196787356 28800
# Node ID bde7af5c35fa76a58a825817f181d2e6a08096ee
# Parent b71790bb1ff44e6cbd8eebf28caee6ce3c21a340
Add ElementCapabilities support for VirtualSystemMigrationCapabilities
Signed-off-by: Dan Smith
diff -r b71790bb1ff4 -r bde7af5c35fa src/Makefile.am
--- a/src/Makefile.am Tue Dec 04 08:55:55 2007 -0800
+++ b/src/Makefile.am Tue Dec 04 08:55:56 2007 -0800
@@ -88,12 +88,13 @@ libVirt_ElementConformsToProfile_la_LIBA
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_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la
libVirt_ElementCapabilities_la_SOURCES = Virt_ElementCapabilities.c
libVirt_ElementCapabilities_la_LIBADD = -lVirt_VirtualSystemManagementCapabilities \
-lVirt_EnabledLogicalElementCapabilities \
-lVirt_ComputerSystem \
- -lVirt_HostSystem
+ -lVirt_HostSystem \
+ -lVirt_VSMigrationCapabilities
libVirt_AllocationCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la
libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c
diff -r b71790bb1ff4 -r bde7af5c35fa src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Tue Dec 04 08:55:55 2007 -0800
+++ b/src/Virt_ElementCapabilities.c Tue Dec 04 08:55:56 2007 -0800
@@ -37,6 +37,7 @@
#include "Virt_EnabledLogicalElementCapabilities.h"
#include "Virt_ComputerSystem.h"
#include "Virt_HostSystem.h"
+#include "Virt_VSMigrationCapabilities.h"
/* Associate an XXX_Capabilities to the proper XXX_ManagedElement.
*
@@ -70,6 +71,11 @@ static CMPIStatus sys_to_cap(const CMPIO
s = get_vsm_cap(_BROKER, ref, &inst);
if (s.rc == CMPI_RC_OK)
inst_list_add(list, inst);
+
+ s = get_migration_caps(ref, &inst, _BROKER);
+ if (s.rc == CMPI_RC_OK)
+ inst_list_add(list, inst);
+
out:
return s;
}
@@ -249,8 +255,10 @@ char* host_system[] = {
char* virtual_system_management_capabilities[] = {
"Xen_VirtualSystemManagementCapabilities",
+ "Xen_VirtualSystemMigrationCapabilities",
"KVM_VirtualSystemManagementCapabilities",
- NULL
+ "KVM_VirtualSystemMigrationCapabilities",
+ NULL,
};
struct std_assoc system_to_vsm_cap = {
From danms at us.ibm.com Tue Dec 4 15:56:06 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:06 -0700
Subject: [Libvirt-cim] [PATCH 4 of 6] Add VirtualSystemMigrationService
In-Reply-To:
Message-ID: <058dc68a17d0303c8272.1196787366@theine>
# HG changeset patch
# User Dan Smith
# Date 1196787286 28800
# Node ID 058dc68a17d0303c8272f9b2c52916f783ba3ae8
# Parent 58bd9f06204f69bbdbe3724cf45b845a58dedd4a
Add VirtualSystemMigrationService
Changes:
- Added rough IsMigratable support
- Added method return code support
- Fixed unnecessary status
- Fixed conn instead of dconn in failure path
Signed-off-by: Dan Smith
diff -r 58bd9f06204f -r 058dc68a17d0 src/Virt_VSMigrationService.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_VSMigrationService.c Tue Dec 04 08:54:46 2007 -0800
@@ -0,0 +1,517 @@
+/*
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * 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
+ */
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+#include
+
+#include "libcmpiutil.h"
+#include "misc_util.h"
+#include "std_instance.h"
+#include "std_invokemethod.h"
+
+#include "Virt_VSMigrationService.h"
+
+#define METHOD_RETURN(r, v) do { \
+ uint32_t rc = v; \
+ CMReturnData(r, (CMPIValue *)&rc, CMPI_uint32); \
+ } while (0);
+
+const static CMPIBroker *_BROKER;
+
+static const char *transport_from_ref(const CMPIObjectPath *ref)
+{
+ const char *cn;
+
+ cn = CLASSNAME(ref);
+
+ if (STARTS_WITH(cn, "Xen"))
+ return "xen+ssh";
+ else if (STARTS_WITH(cn, "KVM"))
+ return "qemu+ssh";
+ else
+ return NULL;
+}
+
+static char *dest_uri(const CMPIObjectPath *ref,
+ const char *dest)
+{
+ char *uri;
+ const char *tport = NULL;
+
+ tport = transport_from_ref(ref);
+ if (tport == NULL) {
+ CU_DEBUG("Failed to get transport for %s", CLASSNAME(ref));
+ return NULL;
+ }
+
+ if (asprintf(&uri, "%s://%s/", tport, dest) == -1)
+ uri = NULL;
+
+ return uri;
+}
+
+static CMPIStatus check_caps(virConnectPtr conn, virConnectPtr dconn)
+{
+ return (CMPIStatus){CMPI_RC_OK, NULL};
+}
+
+static CMPIStatus check_hver(virConnectPtr conn, virConnectPtr dconn)
+{
+ CMPIStatus s;
+ unsigned long local;
+ unsigned long remote;
+
+ if (virConnectGetVersion(conn, &local)) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get local Hypervisor version");
+ goto out;
+ }
+
+ if (virConnectGetVersion(dconn, &remote)) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get remote hypervisor version");
+ goto out;
+ }
+
+ if (remote >= local) {
+ CU_DEBUG("Version check OK (%lu >= %lu)", remote, local);
+ CMSetStatus(&s, CMPI_RC_OK);
+ } else {
+ CU_DEBUG("Version check FAILED (%lu < %lu)", remote, local);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Remote hypervisor is older than local (%lu < %lu)",
+ remote, local);
+ }
+
+ CMSetStatus(&s, CMPI_RC_OK);
+
+ out:
+ return s;
+}
+
+static CMPIStatus vs_migratable(const CMPIObjectPath *ref,
+ const char *domain,
+ const char *destination,
+ const CMPIResult *results)
+{
+ CMPIStatus s;
+ char *uri = NULL;
+ virConnectPtr conn = NULL;
+ virConnectPtr dconn = NULL;
+ uint32_t retcode = 1;
+
+ uri = dest_uri(ref, destination);
+ if (uri == NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to construct a valid libvirt URI");
+ goto out;
+ }
+
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
+ if (conn == NULL)
+ goto out;
+
+ dconn = virConnectOpen(uri);
+ if (dconn == NULL) {
+ CU_DEBUG("Failed to connect to remote host (%s)", uri);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to connect to remote host (%s)", uri);
+ goto out;
+ }
+
+ s = check_hver(conn, dconn);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ s = check_caps(conn, dconn);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ retcode = 0;
+ CMSetStatus(&s, CMPI_RC_OK);
+
+ out:
+ CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
+
+ free(uri);
+ virConnectClose(conn);
+ virConnectClose(dconn);
+
+ return s;
+}
+
+static CMPIStatus vs_migratable_host(CMPIMethodMI *self,
+ const CMPIContext *ctx,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const CMPIArgs *argsin,
+ CMPIArgs *argsout)
+{
+ CMPIStatus s;
+ const char *dhost = NULL;
+ CMPIObjectPath *system;
+ const char *name = NULL;
+
+ cu_get_str_arg(argsin, "DestinationHost", &dhost);
+ cu_get_ref_arg(argsin, "ComputerSystem", &system);
+
+ if (cu_get_str_path(system, "Name", &name) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in ComputerSystem");
+ METHOD_RETURN(results, 1);
+ return s;
+ }
+
+ return vs_migratable(ref, name, dhost, results);
+}
+
+static CMPIStatus vs_migratable_system(CMPIMethodMI *self,
+ const CMPIContext *ctx,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const CMPIArgs *argsin,
+ CMPIArgs *argsout)
+{
+ CMPIStatus s;
+ CMPIObjectPath *dsys;
+ CMPIObjectPath *sys;
+ const char *dname;
+ const char *name;
+
+ cu_get_ref_arg(argsin, "DestinationSystem", &dsys);
+ cu_get_ref_arg(argsin, "ComputerSystem", &sys);
+
+ if (cu_get_str_path(dsys, "Name", &dname) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in DestinationSystem");
+ METHOD_RETURN(results, 1);
+ return s;
+ }
+
+ if (cu_get_str_path(sys, "Name", &name) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in ComputerSystem");
+ METHOD_RETURN(results, 1);
+ return s;
+ }
+
+ return vs_migratable(ref, name, dname, results);
+}
+
+static CMPIStatus migrate_vs(const CMPIObjectPath *ref,
+ const char *domain,
+ const char *destination,
+ const CMPIResult *results)
+{
+ CMPIStatus s;
+ virConnectPtr conn = NULL;
+ virConnectPtr dconn = NULL;
+ virDomainPtr dom = NULL;
+ virDomainPtr ddom = NULL;
+ char *uri = NULL;
+ uint32_t retcode = 1;
+
+ uri = dest_uri(ref, destination);
+ if (uri == NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to construct a valid libvirt URI");
+ goto out;
+ }
+
+ conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
+ if (conn == NULL)
+ goto out;
+
+ dom = virDomainLookupByName(conn, domain);
+ if (dom == NULL) {
+ CU_DEBUG("Failed to lookup `%s'", domain);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to lookup domain `%s'", domain);
+ goto out;
+ }
+
+ dconn = virConnectOpen(uri);
+ if (dconn == NULL) {
+ CU_DEBUG("Failed to connect to remote host (%s)", uri);
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Failed to connect to remote host (%s)", uri);
+ goto out;
+ }
+
+ CU_DEBUG("Migrating %s -> %s", domain, uri);
+
+ ddom = virDomainMigrate(dom, dconn, VIR_MIGRATE_LIVE, NULL, NULL, 0);
+ if (ddom == NULL) {
+ CU_DEBUG("Migration failed");
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Migration Failed");
+ goto out;
+ }
+
+ CU_DEBUG("Migration succeeded");
+ retcode = 0;
+ CMSetStatus(&s, CMPI_RC_OK);
+
+ out:
+ CMReturnData(results, (CMPIValue *)&retcode, CMPI_uint32);
+
+ free(uri);
+ virDomainFree(dom);
+ virDomainFree(ddom);
+ virConnectClose(conn);
+ virConnectClose(dconn);
+
+ return s;
+}
+
+static CMPIStatus migrate_vs_host(CMPIMethodMI *self,
+ const CMPIContext *ctx,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const CMPIArgs *argsin,
+ CMPIArgs *argsout)
+{
+ CMPIStatus s;
+ const char *dhost = NULL;
+ CMPIObjectPath *system;
+ const char *name = NULL;
+
+ cu_get_str_arg(argsin, "DestinationHost", &dhost);
+ cu_get_ref_arg(argsin, "ComputerSystem", &system);
+
+ if (cu_get_str_path(system, "Name", &name) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in ComputerSystem");
+ METHOD_RETURN(results, 1);
+ return s;
+ }
+
+ return migrate_vs(ref, name, dhost, results);
+}
+
+static CMPIStatus migrate_vs_system(CMPIMethodMI *self,
+ const CMPIContext *ctx,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const CMPIArgs *argsin,
+ CMPIArgs *argsout)
+{
+ CMPIStatus s;
+ CMPIObjectPath *dsys;
+ CMPIObjectPath *sys;
+ const char *dname;
+ const char *name;
+
+ cu_get_ref_arg(argsin, "DestinationSystem", &dsys);
+ cu_get_ref_arg(argsin, "ComputerSystem", &sys);
+
+ if (cu_get_str_path(dsys, "Name", &dname) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in DestinationSystem");
+ METHOD_RETURN(results, 1);
+ return s;
+ }
+
+ if (cu_get_str_path(sys, "Name", &name) != CMPI_RC_OK) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "Missing key (Name) in ComputerSystem");
+ METHOD_RETURN(results, 1);
+ return s;
+ }
+
+ return migrate_vs(ref, name, dname, results);
+}
+
+static struct method_handler vsimth = {
+ .name = "VirtualSystemIsMigratableToHost",
+ .handler = vs_migratable_host,
+ .args = {{"ComputerSystem", CMPI_ref},
+ {"DestinationHost", CMPI_string},
+ ARG_END
+ }
+};
+
+static struct method_handler vsimts = {
+ .name = "VirtualSystemIsMigratableToSystem",
+ .handler = vs_migratable_system,
+ .args = {{"ComputerSystem", CMPI_ref},
+ {"DestinationSystem", CMPI_ref},
+ ARG_END
+ }
+};
+
+static struct method_handler mvsth = {
+ .name = "MigrateVirtualSystemToHost",
+ .handler = migrate_vs_host,
+ .args = {{"ComputerSystem", CMPI_ref},
+ {"DestinationHost", CMPI_string},
+ ARG_END
+ }
+};
+
+static struct method_handler mvsts = {
+ .name = "MigrateVirtualSystemToSystem",
+ .handler = migrate_vs_system,
+ .args = {{"ComputerSystem", CMPI_ref},
+ {"DestinationSystem", CMPI_ref},
+ ARG_END
+ }
+};
+
+static struct method_handler *my_handlers[] = {
+ &vsimth,
+ &vsimts,
+ &mvsth,
+ &mvsts,
+ NULL
+};
+
+STDIM_MethodMIStub(, Virt_VSMigrationService, _BROKER,
+ libvirt_cim_init(), my_handlers);
+
+CMPIStatus get_migration_service(const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ const CMPIBroker *broker)
+{
+ CMPIInstance *inst;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ inst = get_typed_instance(broker,
+ CLASSNAME(ref),
+ "VirtualSystemMigrationService",
+ NAMESPACE(ref));
+ if (inst == NULL) {
+ cu_statusf(broker, &s,
+ CMPI_RC_ERR_FAILED,
+ "Unable to get instance for %s", CLASSNAME(ref));
+ return s;
+ }
+
+ CMSetProperty(inst, "Name",
+ (CMPIValue *)"MigrationService", CMPI_chars);
+
+ *_inst = inst;
+
+ return s;
+}
+
+static CMPIStatus return_vsms(const CMPIObjectPath *ref,
+ const CMPIResult *results,
+ bool name_only)
+{
+ CMPIInstance *inst;
+ CMPIStatus s;
+
+ s = get_migration_service(ref, &inst, _BROKER);
+ if (s.rc == CMPI_RC_OK) {
+ if (name_only)
+ cu_return_instance_name(results, inst);
+ else
+ CMReturnInstance(results, inst);
+ }
+
+ return s;
+}
+
+static CMPIStatus EnumInstanceNames(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref)
+{
+ return return_vsms(ref, results, true);
+}
+
+static CMPIStatus EnumInstances(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const char **properties)
+{
+
+ return return_vsms(ref, results, false);
+}
+
+
+static CMPIStatus GetInstance(CMPIInstanceMI *self,
+ const CMPIContext *context,
+ const CMPIResult *results,
+ const CMPIObjectPath *ref,
+ const char **properties)
+{
+ CMPIInstance *inst;
+ CMPIStatus s;
+ const char *prop;
+
+ s = get_migration_service(ref, &inst, _BROKER);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+
+ prop = cu_compare_ref(ref, inst);
+ if (prop != NULL) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_NOT_FOUND,
+ "No such instance (%s)", prop);
+ } else {
+ CMReturnInstance(results, inst);
+ }
+
+ return s;
+}
+
+DEFAULT_CI();
+DEFAULT_MI();
+DEFAULT_DI();
+DEFAULT_EQ();
+DEFAULT_INST_CLEANUP();
+
+STD_InstanceMIStub(, Virt_VSMigrationService,
+ _BROKER,
+ libvirt_cim_init());
+/*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 58bd9f06204f -r 058dc68a17d0 src/Virt_VSMigrationService.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_VSMigrationService.h Tue Dec 04 08:54:46 2007 -0800
@@ -0,0 +1,35 @@
+/*
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * 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
+ */
+
+CMPIStatus get_migration_service(const CMPIObjectPath *reference,
+ CMPIInstance **_inst,
+ const CMPIBroker *broker);
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */
+
From danms at us.ibm.com Tue Dec 4 15:56:05 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:05 -0700
Subject: [Libvirt-cim] [PATCH 3 of 6] Add build support for
VirtualSystemMigrationService
In-Reply-To:
Message-ID: <58bd9f06204f69bbdbe3.1196787365@theine>
# HG changeset patch
# User Dan Smith
# Date 1196787215 28800
# Node ID 58bd9f06204f69bbdbe3724cf45b845a58dedd4a
# Parent 853bc758cb198acef26fb916fa913108ef50a3f8
Add build support for VirtualSystemMigrationService
Signed-off-by: Dan Smith
diff -r 853bc758cb19 -r 58bd9f06204f Makefile.am
--- a/Makefile.am Tue Dec 04 08:53:35 2007 -0800
+++ b/Makefile.am Tue Dec 04 08:53:35 2007 -0800
@@ -34,7 +34,8 @@ MOFS = \
schema/ElementAllocatedFromPool.mof \
schema/HostedService.mof \
schema/ElementSettingData.mof \
- schema/VSMigrationCapabilities.mof
+ schema/VSMigrationCapabilities.mof \
+ schema/VSMigrationService.mof
INTEROP_MOFS = \
schema/ComputerSystem.mof \
@@ -74,7 +75,8 @@ REGS = \
schema/ElementAllocatedFromPool.registration \
schema/HostedService.registration \
schema/ElementSettingData.registration \
- schema/VSMigrationCapabilities.registration
+ schema/VSMigrationCapabilities.registration \
+ schema/VSMigrationService.registration
INTEROP_REGS = \
schema/RegisteredProfile.registration \
diff -r 853bc758cb19 -r 58bd9f06204f schema/VSMigrationService.mof
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/VSMigrationService.mof Tue Dec 04 08:53:35 2007 -0800
@@ -0,0 +1,41 @@
+// Copyright IBM Corp. 2007
+
+// Placeholder definition until schema is available upstream
+
+class CIM_VirtualSystemMigrationService : CIM_Service {
+ uint32 VirtualSystemIsMigratableToHost(
+ [Out]
+ CIM_ConcreteJob REF Job,
+ [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
+ string NewResourceSettingData[],
+ [In, EmbeddedInstance("CIM_SettingData")]
+ string MigrationSettingData,
+ [In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
+ string NewSystemSettingData,
+ [In]
+ CIM_ComputerSystem REF ComputerSystem,
+ [In]
+ string DestinationHost);
+
+ uint32 MigrateVirtualSystemToHost(
+ [Out]
+ CIM_ConcreteJob REF Job,
+ [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
+ string NewResourceSettingData[],
+ [In, EmbeddedInstance("CIM_SettingData")]
+ string MigrationSettingData,
+ [In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
+ string NewSystemSettingData,
+ [In]
+ CIM_ComputerSystem REF ComputerSystem,
+ [In]
+ string DestinationHost);
+
+};
+
+class Xen_VirtualSystemMigrationService : CIM_VirtualSystemMigrationService {
+};
+
+class KVM_VirtualSystemMigrationService : CIM_VirtualSystemMigrationService {
+};
+
diff -r 853bc758cb19 -r 58bd9f06204f schema/VSMigrationService.registration
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/VSMigrationService.registration Tue Dec 04 08:53:35 2007 -0800
@@ -0,0 +1,4 @@
+# Copyright IBM Corp. 2007
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance method
+KVM_VirtualSystemMigrationService root/virt Virt_VSMigrationService Virt_VSMigrationService instance method
\ No newline at end of file
diff -r 853bc758cb19 -r 58bd9f06204f src/Makefile.am
--- a/src/Makefile.am Tue Dec 04 08:53:35 2007 -0800
+++ b/src/Makefile.am Tue Dec 04 08:53:35 2007 -0800
@@ -51,7 +51,8 @@ provider_LTLIBRARIES = libVirt_ComputerS
libVirt_ElementAllocatedFromPool.la \
libVirt_HostedService.la \
libVirt_ElementSettingData.la \
- libVirt_VSMigrationCapabilities.la
+ libVirt_VSMigrationCapabilities.la \
+ libVirt_VSMigrationService.la
libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c
libVirt_Device_la_SOURCES = Virt_Device.c
@@ -140,4 +141,6 @@ libVirt_ElementSettingData_la_SOURCES =
libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c
libVirt_ElementSettingData_la_LIBADD = -lVirt_VSSD -lVirt_RASD
-libVirt_VSMigrationCapabilities_la_SOURCES = Virt_VSMigrationCapabilities.c
\ No newline at end of file
+libVirt_VSMigrationCapabilities_la_SOURCES = Virt_VSMigrationCapabilities.c
+
+libVirt_VSMigrationService_la_SOURCES = Virt_VSMigrationService.c
\ No newline at end of file
From danms at us.ibm.com Tue Dec 4 15:56:07 2007
From: danms at us.ibm.com (Dan Smith)
Date: Tue, 04 Dec 2007 08:56:07 -0700
Subject: [Libvirt-cim] [PATCH 5 of 6] Add HostedService support for
VirtualSystemMigrationService
In-Reply-To:
Message-ID:
# HG changeset patch
# User Dan Smith
# Date 1196787355 28800
# Node ID b71790bb1ff44e6cbd8eebf28caee6ce3c21a340
# Parent 058dc68a17d0303c8272f9b2c52916f783ba3ae8
Add HostedService support for VirtualSystemMigrationService
Signed-off-by: Dan Smith
diff -r 058dc68a17d0 -r b71790bb1ff4 src/Makefile.am
--- a/src/Makefile.am Tue Dec 04 08:54:46 2007 -0800
+++ b/src/Makefile.am Tue Dec 04 08:55:55 2007 -0800
@@ -133,9 +133,9 @@ libVirt_ElementAllocatedFromPool_la_SOUR
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_DEPENDENCIES = libVirt_VirtualSystemManagementService.la libVirt_ResourcePoolConfigurationService.la libVirt_VSMigrationService.la
libVirt_HostedService_la_SOURCES = Virt_HostedService.c
-libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService
+libVirt_HostedService_la_LIBADD = -lVirt_VirtualSystemManagementService -lVirt_ResourcePoolConfigurationService -lVirt_VSMigrationService
libVirt_ElementSettingData_la_DEPENDENCIES = libVirt_VSSD.la libVirt_RASD.la
libVirt_ElementSettingData_la_SOURCES = Virt_ElementSettingData.c
diff -r 058dc68a17d0 -r b71790bb1ff4 src/Virt_HostedService.c
--- a/src/Virt_HostedService.c Tue Dec 04 08:54:46 2007 -0800
+++ b/src/Virt_HostedService.c Tue Dec 04 08:55:55 2007 -0800
@@ -33,6 +33,7 @@
#include "Virt_HostSystem.h"
#include "Virt_VirtualSystemManagementService.h"
#include "Virt_ResourcePoolConfigurationService.h"
+#include "Virt_VSMigrationService.h"
const static CMPIBroker *_BROKER;
@@ -72,6 +73,12 @@ static CMPIStatus host_to_service(const
return s;
if (!CMIsNullObject(inst))
inst_list_add(list, inst);
+
+ s = get_migration_service(ref, &inst, _BROKER);
+ if (s.rc != CMPI_RC_OK)
+ return s;
+ if (!CMIsNullObject(inst))
+ inst_list_add(list, inst);
return s;
}
@@ -116,8 +123,10 @@ char* dependent[] = {
char* dependent[] = {
"Xen_ResourcePoolConfigurationService",
"Xen_VirtualSystemManagementService",
+ "Xen_VirtualSystemMigrationService",
"KVM_ResourcePoolConfigurationService",
"KVM_VirtualSystemManagementService",
+ "KVM_VirtualSystemMigrationService",
NULL
};
From kaitlin at linux.vnet.ibm.com Tue Dec 4 23:05:13 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 15:05:13 -0800
Subject: [Libvirt-cim] [PATCH 1 of 2] ELEC cleanup - remove get_fq_devid()
In-Reply-To:
Message-ID:
# HG changeset patch
# User Kaitlin Rupert
# Date 1196470485 28800
# Node ID e69c02e79e40056b1d1a4825c048d70355e9cf85
# Parent e6be7823c8e90c1f4b722ce1b33d6d15db123029
ELEC cleanup - remove get_fq_devid().
Removing get_fq_devid() since it's not necessary for building an InstanceID. Since this change causes error1 to be removed, I also renamed error2 to out, which conforms to the style of the other of the providers. Also, having an error2 without an error1 seemed silly.
Signed-off-by: Kaitlin Rupert
diff -r e6be7823c8e9 -r e69c02e79e40 src/Virt_EnabledLogicalElementCapabilities.c
--- a/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 15:32:26 2007 -0800
+++ b/src/Virt_EnabledLogicalElementCapabilities.c Fri Nov 30 16:54:45 2007 -0800
@@ -30,7 +30,6 @@
#include "std_instance.h"
#include "misc_util.h"
-#include "device_parsing.h"
#include "cs_util.h"
#include "Virt_EnabledLogicalElementCapabilities.h"
@@ -58,24 +57,15 @@ static CMPIStatus set_inst_properties(co
CMPIArray *array;
uint16_t element;
int edit_name = 0;
- 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 error1;
- }
-
- CMSetProperty(inst, "InstanceID", (CMPIValue *)devid, CMPI_chars);
+ CMSetProperty(inst, "InstanceID", (CMPIValue *)sys_name, CMPI_chars);
array = CMNewArray(broker, 5, CMPI_uint16, &s);
if ((s.rc != CMPI_RC_OK) || CMIsNullObject(array))
- goto error2;
+ goto out;
element = (uint16_t)ENABLED;
CMSetArrayElementAt(array, 0, &element, CMPI_uint16);
@@ -97,9 +87,7 @@ static CMPIStatus set_inst_properties(co
CMSetProperty(inst, "ElementNameEditSupported",
(CMPIValue *)&edit_name, CMPI_boolean);
- error2:
- free(devid);
- error1:
+ out:
return s;
}
From kaitlin at linux.vnet.ibm.com Tue Dec 4 23:05:12 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 15:05:12 -0800
Subject: [Libvirt-cim] [PATCH 0 of 2] #2 Remove devid-style InstanceID
support from ELEC and EC.
Message-ID:
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.
From kaitlin at linux.vnet.ibm.com Tue Dec 4 23:05:14 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 15:05:14 -0800
Subject: [Libvirt-cim] [PATCH 2 of 2] Removing support for devid-style
InstanceID from EC
In-Reply-To:
Message-ID:
# HG changeset patch
# User Kaitlin Rupert
# Date 1196788236 28800
# Node ID e9e11611dc975a72237a9653b0a4a07ab9b4b4e1
# Parent e69c02e79e40056b1d1a4825c048d70355e9cf85
Removing support for devid-style InstanceID from EC.
Since ELEC no longer uses devid-style InstanceID, we need to remove the devid-parsing from cap_to_cs().
Signed-off-by: Kaitlin Rupert
diff -r e69c02e79e40 -r e9e11611dc97 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Fri Nov 30 16:54:45 2007 -0800
+++ b/src/Virt_ElementCapabilities.c Tue Dec 04 09:10:36 2007 -0800
@@ -31,7 +31,6 @@
#include "libcmpiutil.h"
#include "misc_util.h"
#include "std_association.h"
-#include "device_parsing.h"
#include "Virt_VirtualSystemManagementCapabilities.h"
#include "Virt_EnabledLogicalElementCapabilities.h"
@@ -119,8 +118,6 @@ static CMPIStatus cap_to_cs(const CMPIOb
struct inst_list *list)
{
const char *inst_id;
- char *host;
- char *device;
CMPIInstance *inst;
virConnectPtr conn;
CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -129,13 +126,6 @@ static CMPIStatus cap_to_cs(const CMPIOb
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
"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");
goto error1;
}
@@ -143,14 +133,12 @@ static CMPIStatus cap_to_cs(const CMPIOb
if (s.rc != CMPI_RC_OK)
goto error1;
- inst = instance_from_name(_BROKER, conn, host, ref);
+ inst = instance_from_name(_BROKER, conn, inst_id, ref);
if (inst)
inst_list_add(list, inst);
virConnectClose(conn);
error1:
- free(host);
- free(device);
return s;
}
From kaitlin at linux.vnet.ibm.com Tue Dec 4 23:09:48 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 15:09:48 -0800
Subject: [Libvirt-cim] [PATCH] VSMC returns extra instances - add
connect_by_classname
Message-ID:
# HG changeset patch
# User Kaitlin Rupert
# 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
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;
}
From kaitlin at linux.vnet.ibm.com Tue Dec 4 23:00:21 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 15:00:21 -0800
Subject: [Libvirt-cim] [PATCH] SD doesn't return instances in all cases
In-Reply-To: <4753CAAB.4050509@linux.vnet.ibm.com>
References: <1776beb36f5cffcfad4e.1196461268@elm3b41.beaverton.ibm.com>
<874pf374rv.fsf@theine.beaverton.ibm.com>
<4753CAAB.4050509@linux.vnet.ibm.com>
Message-ID: <4755DC05.7070805@linux.vnet.ibm.com>
Heidi Eckhart wrote:
>> optimization (correctly) if we decide it's needed.
> Now, that you both pick up the filter_results() function, this is a
> good time to enter this discussion. I agree that the filter_results()
> function is handy and takes away a lot of checking and distinguishing
> from the provider. For tiny numbers of returned instances and fast
> systems, this will not cause any problems. But we should keep in mind,
> that the providers should also scale for a large number of virtual
> machines. As Dan already mentioned - this approach will become an
> performance issue later. On the other hand its more the responsibility
> of the provider - especially for our ones, that handle a lot of
> subclasses at one time - to filter the returned instances, as the
> responsibility of the generic association logic. So I want to follow
> Dan's opinion and keep it for now. But we should add this to our ToDo
> list and fix as time allows. I suppose this will mean to reorganize
> the providers a bit and I do not expect a huge effort.
>
I agree - I was concerned about performance when I wrote the
filter_results() code. =) It would probably be a good idea to test all
of the providers for performance at some point. Since the enum
extrinsic functions don't return until all the instances are generate,
you could potentially run into some performance issues there as well.
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From kaitlin at linux.vnet.ibm.com Tue Dec 4 23:05:23 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 15:05:23 -0800
Subject: [Libvirt-cim] [PATCH] VSMC returns extra instances - add
connect_by_classname
In-Reply-To:
References:
Message-ID: <4755DD33.8010502@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert
> # 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
>
Heidi, I'm not sure this will solve the problem where wbemein
http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities returns
incorrect / invalid instances. I think I hit a race condition today
that caused connect_by_classname(KVM_<>) to pass even though libvirtd
wasn't even running on my test system.
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From kaitlin at linux.vnet.ibm.com Wed Dec 5 00:26:23 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Tue, 04 Dec 2007 16:26:23 -0800
Subject: [Libvirt-cim] [PATCH 0 of 6] #2 Add migration support
In-Reply-To:
References:
Message-ID: <4755F02F.3090005@linux.vnet.ibm.com>
Dan Smith wrote:
> 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.
>
I haven't had a chance to apply this patch and test, but it looks good
from the read through. +1
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:09 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:09 +0200
Subject: [Libvirt-cim] [PATCH 0 of 9] #2 - Reorganized association provider
registration
Message-ID:
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_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 at 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
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:10 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:10 +0200
Subject: [Libvirt-cim] [PATCH 1 of 9] EAFP: Provider registered per subclass
In-Reply-To:
Message-ID: <6500573879debb5d6086.1196847010@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196844139 -3600
# Node ID 6500573879debb5d6086df84e17d4336090d8e92
# Parent 8140438a647cd53017d79b7036702fc053fe9e9c
EAFP: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r 8140438a647c -r 6500573879de schema/ElementAllocatedFromPool.registration
--- a/schema/ElementAllocatedFromPool.registration Fri Nov 30 17:21:33 2007 -0800
+++ b/schema/ElementAllocatedFromPool.registration Wed Dec 05 09:42:19 2007 +0100
@@ -1,4 +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
+Xen_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
+KVM_ElementAllocatedFromPool root/virt Virt_ElementAllocatedFromPoolProvider Virt_ElementAllocatedFromPool association
diff -r 8140438a647c -r 6500573879de src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Fri Nov 30 17:21:33 2007 -0800
+++ b/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 09:42:19 2007 +0100
@@ -61,12 +61,15 @@ static CMPIStatus vdev_to_pool(const CMP
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
uint16_t type;
const char *id = NULL;
char *poolid = NULL;
virConnectPtr conn = NULL;
CMPIInstance *pool = NULL;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
type = class_to_type(ref);
if (type == 0) {
@@ -196,7 +199,10 @@ static CMPIStatus pool_to_vdev(const CMP
struct inst_list *list)
{
const char *poolid;
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -326,8 +332,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ElementAllocatedFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:14 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:14 +0200
Subject: [Libvirt-cim] [PATCH 5 of 9] RAFP: Provider registered per subclass
In-Reply-To:
Message-ID: <9751a165ebca953b720f.1196847014@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196844142 -3600
# Node ID 9751a165ebca953b720faf81c4fdfd5d0748aa6a
# Parent cf48a55a717b1aa79345e95aff6cfec96cbc2d65
RAFP: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r cf48a55a717b -r 9751a165ebca schema/ResourceAllocationFromPool.registration
--- a/schema/ResourceAllocationFromPool.registration Wed Dec 05 09:42:22 2007 +0100
+++ b/schema/ResourceAllocationFromPool.registration Wed Dec 05 09:42:22 2007 +0100
@@ -1,4 +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
+Xen_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association
+KVM_ResourceAllocationFromPool root/virt Virt_ResourceAllocationFromPoolProvider Virt_ResourceAllocationFromPool association
\ No newline at end of file
diff -r cf48a55a717b -r 9751a165ebca src/Virt_ResourceAllocationFromPool.c
--- a/src/Virt_ResourceAllocationFromPool.c Wed Dec 05 09:42:22 2007 +0100
+++ b/src/Virt_ResourceAllocationFromPool.c Wed Dec 05 09:42:22 2007 +0100
@@ -41,13 +41,16 @@ static CMPIStatus rasd_to_pool(const CMP
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
uint16_t type;
const char *id = NULL;
char *poolid = NULL;
virConnectPtr conn = NULL;
struct inst_list _list;
CMPIInstance *pool = NULL;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
inst_list_init(&_list);
@@ -177,8 +180,11 @@ static CMPIStatus pool_to_rasd(const CMP
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
const char *poolid;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &poolid) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -305,8 +311,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ResourceAllocationFromPoolProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:13 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:13 +0200
Subject: [Libvirt-cim] [PATCH 4 of 9] HS: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196844142 -3600
# Node ID cf48a55a717b1aa79345e95aff6cfec96cbc2d65
# Parent bce59cb2dd5054ba4f01bc20d805ed99bd767119
HS: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r bce59cb2dd50 -r cf48a55a717b schema/HostedService.registration
--- a/schema/HostedService.registration Wed Dec 05 09:42:21 2007 +0100
+++ b/schema/HostedService.registration Wed Dec 05 09:42:22 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
-# Classname Namespace ProviderName ProviderModule ProviderTypes ...
-Xen_HostedService root/virt Xen_HostedServiceProvider Virt_HostedService association
-KVM_HostedService root/virt KVM_HostedServiceProvider Virt_HostedService association
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_HostedService root/virt Virt_HostedServiceProvider Virt_HostedService association
+KVM_HostedService root/virt Virt_HostedServiceProvider Virt_HostedService association
diff -r bce59cb2dd50 -r cf48a55a717b src/Virt_HostedService.c
--- a/src/Virt_HostedService.c Wed Dec 05 09:42:21 2007 +0100
+++ b/src/Virt_HostedService.c Wed Dec 05 09:42:22 2007 +0100
@@ -40,10 +40,11 @@ static CMPIStatus service_to_host(const
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *instance;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = get_host_cs(_BROKER, ref, &instance);
if (s.rc == CMPI_RC_OK)
@@ -59,7 +60,8 @@ static CMPIStatus host_to_service(const
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = rpcs_instance(ref, &inst, _BROKER);
if (s.rc != CMPI_RC_OK)
@@ -159,8 +161,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_HostedServiceProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:12 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:12 +0200
Subject: [Libvirt-cim] [PATCH 3 of 9] ESD: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196844141 -3600
# Node ID bce59cb2dd5054ba4f01bc20d805ed99bd767119
# Parent b07a0b1db5d9bb50e80d08a06d8138de3a132c69
ESD: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r b07a0b1db5d9 -r bce59cb2dd50 schema/ElementSettingData.registration
--- a/schema/ElementSettingData.registration Wed Dec 05 09:42:20 2007 +0100
+++ b/schema/ElementSettingData.registration Wed Dec 05 09:42:21 2007 +0100
@@ -1,4 +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
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_ElementSettingData root/virt Virt_ElementSettingDataProvider Virt_ElementSettingData association
+KVM_ElementSettingData root/virt Virt_ElementSettingDataProvider Virt_ElementSettingData association
diff -r b07a0b1db5d9 -r bce59cb2dd50 src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c Wed Dec 05 09:42:20 2007 +0100
+++ b/src/Virt_ElementSettingData.c Wed Dec 05 09:42:21 2007 +0100
@@ -39,13 +39,14 @@ static CMPIStatus vssd_to_vssd(const CMP
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst;
virConnectPtr conn = NULL;
virDomainPtr dom = NULL;
char *host = NULL;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (!parse_instanceid(ref, NULL, &host)) {
cu_statusf(_BROKER, &s,
@@ -93,7 +94,8 @@ static CMPIStatus rasd_to_rasd(const CMP
const char *id = NULL;
uint16_t type;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -227,8 +229,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_ElementSettingDataProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:15 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:15 +0200
Subject: [Libvirt-cim] [PATCH 6 of 9] SDC: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196844143 -3600
# Node ID f67ca8f5c7d74e5b288a7cbf6d9e8a9e3f27f05e
# Parent 9751a165ebca953b720faf81c4fdfd5d0748aa6a
SDC: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r 9751a165ebca -r f67ca8f5c7d7 schema/SettingsDefineCapabilities.registration
--- a/schema/SettingsDefineCapabilities.registration Wed Dec 05 09:42:22 2007 +0100
+++ b/schema/SettingsDefineCapabilities.registration Wed Dec 05 09:42:23 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
+Xen_SettingsDefineCapabilities root/virt Virt_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association
+KVM_SettingsDefineCapabilities root/virt Virt_SettingsDefineCapabilitiesProvider Virt_SettingsDefineCapabilities association
diff -r 9751a165ebca -r f67ca8f5c7d7 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Dec 05 09:42:22 2007 +0100
+++ b/src/Virt_SettingsDefineCapabilities.c Wed Dec 05 09:42:23 2007 +0100
@@ -781,6 +781,9 @@ static CMPIStatus alloc_cap_to_rasd(cons
int ret;
uint16_t type;
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
+
CU_DEBUG("Getting ResourceType");
ret = cu_get_u16_path(ref, "ResourceType", &type);
@@ -900,8 +903,7 @@ struct std_assoc *assoc_handlers[] = {
};
-STDA_AssocMIStub(, Xen_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
-STDA_AssocMIStub(, KVM_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
+STDA_AssocMIStub(, Virt_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:16 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:16 +0200
Subject: [Libvirt-cim] [PATCH 7 of 9] SDS: Provider registered per subclass
In-Reply-To:
Message-ID: <904b939c9b2ae55caf2d.1196847016@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196844144 -3600
# Node ID 904b939c9b2ae55caf2d7e713747fce00b7bcecc
# Parent f67ca8f5c7d74e5b288a7cbf6d9e8a9e3f27f05e
SDS: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r f67ca8f5c7d7 -r 904b939c9b2a schema/SettingsDefineState.registration
--- a/schema/SettingsDefineState.registration Wed Dec 05 09:42:23 2007 +0100
+++ b/schema/SettingsDefineState.registration Wed Dec 05 09:42:24 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_SettingsDefineState root/virt Xen_SettingsDefineStateProvider Virt_SettingsDefineState association
-KVM_SettingsDefineState root/virt KVM_SettingsDefineStateProvider Virt_SettingsDefineState association
+Xen_SettingsDefineState root/virt Virt_SettingsDefineStateProvider Virt_SettingsDefineState association
+KVM_SettingsDefineState root/virt Virt_SettingsDefineStateProvider Virt_SettingsDefineState association
diff -r f67ca8f5c7d7 -r 904b939c9b2a src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Wed Dec 05 09:42:23 2007 +0100
+++ b/src/Virt_SettingsDefineState.c Wed Dec 05 09:42:24 2007 +0100
@@ -66,13 +66,16 @@ static CMPIStatus dev_to_rasd(const CMPI
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *rasd;
struct inst_list rasds;
const char *id = NULL;
char *name = NULL;
char *devid = NULL;
int ret;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
inst_list_init(&rasds);
@@ -153,12 +156,13 @@ static CMPIStatus rasd_to_dev(const CMPI
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *dev = NULL;
const char *id = NULL;
uint16_t type;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -194,7 +198,10 @@ static CMPIStatus vs_to_vssd(const CMPIO
virDomainPtr dom = NULL;
const char *name;
CMPIInstance *vssd;
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
if (conn == NULL)
@@ -238,8 +245,11 @@ static CMPIStatus vssd_to_vs(const CMPIO
char *name = NULL;
int ret;
virConnectPtr conn = NULL;
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *cs;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -399,8 +409,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_SettingsDefineStateProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:17 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:17 +0200
Subject: [Libvirt-cim] [PATCH 8 of 9] SD: Provider registered per subclass
In-Reply-To:
Message-ID: <5b933cf3854176ae75fd.1196847017@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196844145 -3600
# Node ID 5b933cf3854176ae75fd07fe0c518a0aedb19a2b
# Parent 904b939c9b2ae55caf2d7e713747fce00b7bcecc
SD: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r 904b939c9b2a -r 5b933cf38541 schema/SystemDevice.registration
--- a/schema/SystemDevice.registration Wed Dec 05 09:42:24 2007 +0100
+++ b/schema/SystemDevice.registration Wed Dec 05 09:42:25 2007 +0100
@@ -1,4 +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
+Xen_SystemDevice root/virt Virt_SystemDeviceProvider Virt_SystemDevice association
+KVM_SystemDevice root/virt Virt_SystemDeviceProvider Virt_SystemDevice association
diff -r 904b939c9b2a -r 5b933cf38541 src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Wed Dec 05 09:42:24 2007 +0100
+++ b/src/Virt_SystemDevice.c Wed Dec 05 09:42:25 2007 +0100
@@ -162,7 +162,8 @@ static CMPIStatus sys_to_dev(const CMPIO
CMPIStatus s = {CMPI_RC_OK, NULL};
int ret;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "Name", &host) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -196,9 +197,10 @@ static CMPIStatus dev_to_sys(const CMPIO
char *host = NULL;
char *dev = NULL;
CMPIInstance *sys;
- CMPIStatus s;
-
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "DeviceID", &devid) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -288,8 +290,7 @@ static struct std_assoc *assoc_handlers[
NULL
};
-STDA_AssocMIStub(, Xen_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
-STDA_AssocMIStub(, KVM_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
+STDA_AssocMIStub(, Virt_SystemDeviceProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:18 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:18 +0200
Subject: [Libvirt-cim] [PATCH 9 of 9] VSSDC: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196844146 -3600
# Node ID b21fd24be46e086824d309f652b68ebe17eea34b
# Parent 5b933cf3854176ae75fd07fe0c518a0aedb19a2b
VSSDC: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r 5b933cf38541 -r b21fd24be46e schema/VSSDComponent.registration
--- a/schema/VSSDComponent.registration Wed Dec 05 09:42:25 2007 +0100
+++ b/schema/VSSDComponent.registration Wed Dec 05 09:42:26 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_VirtualSystemSettingDataComponent root/virt Xen_VSSDComponentProvider Virt_VSSDComponent association
-KVM_VirtualSystemSettingDataComponent root/virt KVM_VSSDComponentProvider Virt_VSSDComponent association
+Xen_VirtualSystemSettingDataComponent root/virt Virt_VSSDComponentProvider Virt_VSSDComponent association
+KVM_VirtualSystemSettingDataComponent root/virt Virt_VSSDComponentProvider Virt_VSSDComponent association
diff -r 5b933cf38541 -r b21fd24be46e src/Virt_VSSDComponent.c
--- a/src/Virt_VSSDComponent.c Wed Dec 05 09:42:25 2007 +0100
+++ b/src/Virt_VSSDComponent.c Wed Dec 05 09:42:26 2007 +0100
@@ -40,7 +40,7 @@ static CMPIStatus vssd_to_rasd(const CMP
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
char *name = NULL;
int i = 0;
int types[] = {
@@ -51,7 +51,8 @@ static CMPIStatus vssd_to_rasd(const CMP
-1
};
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (!parse_instanceid(ref, NULL, &name)) {
cu_statusf(_BROKER, &s,
@@ -115,14 +116,15 @@ static CMPIStatus rasd_to_vssd(const CMP
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *vssd = NULL;
const char *id = NULL;
char *host = NULL;
char *devid = NULL;
int ret;
- ASSOC_MATCH(info->provider_name, CLASSNAME(ref));
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -230,8 +232,7 @@ static struct std_assoc *handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers);
-STDA_AssocMIStub(, KVM_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers);
+STDA_AssocMIStub(, Virt_VSSDComponentProvider, _BROKER, libvirt_cim_init(), handlers);
/*
* Local Variables:
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:30:11 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:30:11 +0200
Subject: [Libvirt-cim] [PATCH 2 of 9] EC: Provider registered per subclass
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196844140 -3600
# Node ID b07a0b1db5d9bb50e80d08a06d8138de3a132c69
# Parent 6500573879debb5d6086df84e17d4336090d8e92
EC: Provider registered per subclass
The provider registration approach - registering one provider
per subclass (Xen_Provider, KVM_Provider)
caused interoperability issues with Pegasus and sfcb. The same
call returned duplicates with sfcb and worked with Pegasus.
Signed-off-by: Heidi Eckhart
diff -r 6500573879de -r b07a0b1db5d9 schema/ElementCapabilities.registration
--- a/schema/ElementCapabilities.registration Wed Dec 05 09:42:19 2007 +0100
+++ b/schema/ElementCapabilities.registration Wed Dec 05 09:42:20 2007 +0100
@@ -1,4 +1,4 @@
# Copyright IBM Corp. 2007
# Classname Namespace ProviderName ProviderModule ProviderTypes
-Xen_ElementCapabilities root/virt Xen_ElementCapabilitiesProvider Virt_ElementCapabilities association
-KVM_ElementCapabilities root/virt KVM_ElementCapabilitiesProvider Virt_ElementCapabilities association
+Xen_ElementCapabilities root/virt Virt_ElementCapabilitiesProvider Virt_ElementCapabilities association
+KVM_ElementCapabilities root/virt Virt_ElementCapabilitiesProvider Virt_ElementCapabilities association
diff -r 6500573879de -r b07a0b1db5d9 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Wed Dec 05 09:42:19 2007 +0100
+++ b/src/Virt_ElementCapabilities.c Wed Dec 05 09:42:20 2007 +0100
@@ -54,6 +54,9 @@ static CMPIStatus sys_to_cap(const CMPIO
CMPIStatus s = {CMPI_RC_OK, NULL};
const char *prop;
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
+
s = get_host_cs(_BROKER, ref, &inst);
if (s.rc != CMPI_RC_OK)
goto out;
@@ -80,6 +83,9 @@ static CMPIStatus cap_to_sys(const CMPIO
CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
+
s = get_host_cs(_BROKER, ref, &inst);
if (s.rc != CMPI_RC_OK)
goto out;
@@ -98,6 +104,9 @@ static CMPIStatus cs_to_cap(const CMPIOb
CMPIStatus s = {CMPI_RC_OK, NULL};
const char *sys_name = NULL;
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
+
if (cu_get_str_path(ref, "Name", &sys_name) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,
@@ -121,6 +130,9 @@ static CMPIStatus cap_to_cs(const CMPIOb
CMPIInstance *inst;
virConnectPtr conn;
CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -160,6 +172,9 @@ static CMPIStatus pool_to_alloc(const CM
uint16_t type;
CMPIInstance *inst = NULL;
CMPIStatus s = {CMPI_RC_OK};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) {
cu_statusf(_BROKER, &s,
@@ -359,8 +374,7 @@ struct std_assoc *assoc_handlers[] = {
NULL
};
-STDA_AssocMIStub(, Xen_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
-STDA_AssocMIStub(, KVM_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
+STDA_AssocMIStub(, Virt_ElementCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
* Local Variables:
* mode: C
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:40:02 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:40:02 +0200
Subject: [Libvirt-cim] [PATCH 0 of 2] Added match_hypervisor_prefix() to
association's handler functions to avoid wrong results
Message-ID:
A request
wbemain -ac Xen_ http://localhost/root/virt:KVM_ should not return any results, but did so for HD and HRP.
From heidieck at linux.vnet.ibm.com Wed Dec 5 08:40:03 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:40:03 +0200
Subject: [Libvirt-cim] [PATCH 1 of 2] HD: Added match_hypervisor_prefix to
avoid wrong results
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196845867 -3600
# Node ID ce0b042ac7dea58ab7767e5bc74db81c37f99352
# Parent b21fd24be46e086824d309f652b68ebe17eea34b
HD: Added match_hypervisor_prefix to avoid wrong results
The request
wbemain -ac Xen_HostedDependency 'http://localhost/root/virt:KVM_ComputerSystem.CreationClassName="KVM_ComputerSystem",Name="qemu1"'
returned
localhost:5988/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain"
which is wrong, as KVM_ComputerSystem is referenced to
KVM_HostSystem via KVM_HostedDependency instead of
Xen_HostedDependency.
Signed-off-by: Heidi Eckhart
diff -r b21fd24be46e -r ce0b042ac7de src/Virt_HostedDependency.c
--- a/src/Virt_HostedDependency.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_HostedDependency.c Wed Dec 05 10:11:07 2007 +0100
@@ -40,8 +40,11 @@ static CMPIStatus vs_to_host(const CMPIO
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *instance;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = get_host_cs(_BROKER, ref, &instance);
if (s.rc == CMPI_RC_OK)
@@ -56,7 +59,10 @@ static CMPIStatus host_to_vs(const CMPIO
{
int ret;
virConnectPtr conn;
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ 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 Dec 5 08:40:04 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:40:04 +0200
Subject: [Libvirt-cim] [PATCH 2 of 2] HRP: Added match_hypervisor_prefix to
avoid wrong results
In-Reply-To:
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196846065 -3600
# Node ID c3e4344951cef32a2c89e90f5345b20171c5e58d
# Parent ce0b042ac7dea58ab7767e5bc74db81c37f99352
HRP: Added match_hypervisor_prefix to avoid wrong results
The request
wbemain -ac Xen_HostedResourcePool 'http://localhost/root/virt:KVM_HostSystem.CreationClassName="KVM_HostSystem",Name="localhost.localdomain"'
returned
localhost:5988/root/virt:KVM_ProcessorPool.InstanceID="ProcessorPool/0"
localhost:5988/root/virt:KVM_MemoryPool.InstanceID="MemoryPool/0"
localhost:5988/root/virt:KVM_DiskPool.InstanceID="DiskPool/foo"
which is wrong, as KVM_HostSystem is referenced to
KVM_MemoryPool (...) via KVM_HostedResourcePool instead of
Xen_HostedResourcePool.
Signed-off-by: Heidi Eckhart
diff -r ce0b042ac7de -r c3e4344951ce src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c Wed Dec 05 10:11:07 2007 +0100
+++ b/src/Virt_HostedResourcePool.c Wed Dec 05 10:14:25 2007 +0100
@@ -42,7 +42,10 @@ static CMPIStatus pool_to_sys(const CMPI
struct inst_list *list)
{
CMPIInstance *host;
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = get_host_cs(_BROKER, ref, &host);
if (s.rc != CMPI_RC_OK)
@@ -57,11 +60,14 @@ static CMPIStatus sys_to_pool(const CMPI
struct std_assoc_info *info,
struct inst_list *list)
{
- CMPIStatus s;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
int i;
virConnectPtr conn;
CMPIInstance *host;
const char *prop;
+
+ if (!match_hypervisor_prefix(ref, info))
+ return s;
s = get_host_cs(_BROKER, ref, &host);
if (s.rc != CMPI_RC_OK)
From heidieck at linux.vnet.ibm.com Wed Dec 5 09:46:47 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 10:46:47 +0100
Subject: [Libvirt-cim] [PATCH] Fix typos for disk & network classes in
SDC SD & EAFP
In-Reply-To: <7dbad83883a3f5eaeeda.1196763930@zeit.cn.ibm.com>
References: <7dbad83883a3f5eaeeda.1196763930@zeit.cn.ibm.com>
Message-ID: <47567387.8000307@linux.vnet.ibm.com>
lizg at cn.ibm.com wrote:
> # HG changeset patch
> # User Zhengang Li
> # 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
>
Great catch :) ... sorry, this was my inattention.
--
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 Dec 5 11:38:57 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 12:38:57 +0100
Subject: [Libvirt-cim] [PATCH] VSMC returns extra instances - add
connect_by_classname
In-Reply-To: <4755DD33.8010502@linux.vnet.ibm.com>
References:
<4755DD33.8010502@linux.vnet.ibm.com>
Message-ID: <47568DD1.5010706@linux.vnet.ibm.com>
Kaitlin Rupert wrote:
> Kaitlin Rupert wrote:
>> # HG changeset patch
>> # User Kaitlin Rupert
>> # 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
>>
> Heidi, I'm not sure this will solve the problem where wbemein
> http://localhost/root/virt:CIM_EnabledLogicalElementCapabilities
> returns incorrect / invalid instances. I think I hit a race condition
> today that caused connect_by_classname(KVM_<>) to pass even though
> libvirtd wasn't even running on my test system.
That sounds strange. Are you sure, that no libvirt was somehow reachable
? Is in theory an instance of KVM_ valid on your test system, or not ?
I was able to successfully test the patch set against Pegasus and sfcb
... +1 for the complete patch set
--
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 Dec 5 10:57:59 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 12:57:59 +0200
Subject: [Libvirt-cim] [PATCH] [RFC] variable renaming in make_ref() of
associations
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# 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
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[] = {
From heidieck at linux.vnet.ibm.com Wed Dec 5 12:26:19 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 13:26:19 +0100
Subject: [Libvirt-cim] [PATCH] [RFC] variable renaming in make_ref() of
associations
In-Reply-To:
References:
Message-ID: <475698EB.8000807@linux.vnet.ibm.com>
Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart
> # Date 1196855770 -3600
> # Node ID b49cfc1c6e9c3e4669bceea2f518f6c4f8bf3f82
> # Parent 012fc8655c2b443511ba536ef2b425ac86f69f7b
> [RFC] variable renaming in make_ref() of associations
>
>
Please ignore this 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 heidieck at linux.vnet.ibm.com Wed Dec 5 12:27:11 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 13:27:11 +0100
Subject: [Libvirt-cim] [PATCH] [RFC] make_ref() of associations
In-Reply-To: <873auj4eas.fsf@theine.beaverton.ibm.com>
References:
<47547986.2000701@linux.vnet.ibm.com>
<873auj4eas.fsf@theine.beaverton.ibm.com>
Message-ID: <4756991F.9090108@linux.vnet.ibm.com>
Dan Smith wrote:
> JG> I realize it's a more logical abbreviation than "ref", but we use
> JG> "ref" in so many places that I think it's pretty firmly
> JG> established
>
> For the parameter, I think source_ref would be fine. I don't think
> changing it to not include "ref" makes it more clear, since the
> convention (as it seems to me) is that the object path you pass in as
> the "subject" of an operation is called the "reference".
>
> For the "refinst" local variable, I think leaving "ref" in the name
> also makes sense. The goal of the function is to "make a reference",
> so "refinst" seems to be a reasonable name :)
>
> JG> I personally always see "op" and think "operand" or "operation." I
> JG> would recommend a compromise of "source_ref" for that one.
>
> Me too! I'd be okay with "source_ref", but I question how much more
> clarity it will bring given how much patch churn it will produce.
> However, if others want this change, I'm okay with it.
Thanks for the comments. I was resending the patch as "variable renaming
in make_ref() of associations".
Yes, its very good to question this patch. And the more I think about,
the more I find, that there is the possibility to generalize the content
of make_ref() - because at the end most of the association's make_ref()
will look the same, besides the different association class names. I
will send out the patch for this idea.
--
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 Dec 5 12:37:50 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 13:37:50 +0100
Subject: [Libvirt-cim] [PATCH] [RFC] make_ref() of associations
In-Reply-To: <47547986.2000701@linux.vnet.ibm.com>
References:
<47547986.2000701@linux.vnet.ibm.com>
Message-ID: <47569B9E.5080608@linux.vnet.ibm.com>
Jay Gagnon wrote:
> Heidi Eckhart wrote:
>
>> # HG changeset patch
>> # User Heidi Eckhart
>> # 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
>>
<...>
> Second thing, I think I'm missing something in the first paragraph
> of your commit message. I'm not entirely sure I understand the
> explanation that leads up to "So I suggest to update all make_ref()
> functions to use get_typed_instance()," and it also doesn't seem to
> really relate to this patch, which only appears to do some renaming in
> make_ref. It seems like a good point of discussion, and clarification
> would be good, but maybe we should move it to a separate thread and
> limit this patch discussion to the variable naming.
>
>
Sorry for causing this confusion. The renaming was one thing, but as the
patch showed how the code for each make_ref() would look like, I wanted
to also bring up this idea. But not very well described. I will send out
a patch "#2 - variable renaming in make_ref() of associations", which
shows what I meant.
--
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 Dec 5 11:41:46 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 13:41:46 +0200
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref() of
associations
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# 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
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[] = {
From heidieck at linux.vnet.ibm.com Wed Dec 5 12:45:29 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 13:45:29 +0100
Subject: [Libvirt-cim] [PATCH 0 of 6] Add migration support
In-Reply-To:
References:
Message-ID: <47569D69.1050703@linux.vnet.ibm.com>
Dan Smith wrote:
> 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
>
Great work :).
Can we add a check to the configure script for the right libvirt version
? My one seems to be outdated and the compile exits with error.
cc1: warnings being treated as errors
Virt_VSMigrationService.c: In function 'migrate_vs':
Virt_VSMigrationService.c:278: warning: implicit declaration of function
'virDomainMigrate'
Virt_VSMigrationService.c:278: error: 'VIR_MIGRATE_LIVE' undeclared
(first use in this function)
Virt_VSMigrationService.c:278: error: (Each undeclared identifier is
reported only once
Virt_VSMigrationService.c:278: error: for each function it appears in.)
Virt_VSMigrationService.c:278: warning: assignment makes pointer from
integer without a cast
--
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 Dec 5 14:10:14 2007
From: danms at us.ibm.com (Dan Smith)
Date: Wed, 05 Dec 2007 06:10:14 -0800
Subject: [Libvirt-cim] [PATCH 0 of 6] Add migration support
In-Reply-To: <47569D69.1050703@linux.vnet.ibm.com> (Heidi Eckhart's message of
"Wed, 05 Dec 2007 13:45:29 +0100")
References: <47569D69.1050703@linux.vnet.ibm.com>
Message-ID: <87ve7dxmex.fsf@theine.beaverton.ibm.com>
HE> Can we add a check to the configure script for the right libvirt
HE> version ? My one seems to be outdated and the compile exits with
HE> error.
Yeah, absolutely. I actually hit another such error when I first
test-compiled on an older box because I forgot to point it at
/usr/local.
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 Wed Dec 5 14:46:35 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Wed, 05 Dec 2007 09:46:35 -0500
Subject: [Libvirt-cim] [PATCH 0 of 2] Added match_hypervisor_prefix()
to association's handler functions to avoid wrong results
In-Reply-To:
References:
Message-ID: <4756B9CB.4050307@linux.vnet.ibm.com>
Heidi Eckhart wrote:
> A request
> wbemain -ac Xen_ http://localhost/root/virt:KVM_ should not return any results, but did so for HD and HRP.
>
>
Nice job finding this. Looks like match_hypervisor_prefix is working
out nicely. +1
P.S. We've tested match_hypervisor_prefix with both sfcb and pegasus,
right? I'd love to know we finally have this duplicates issue resolved
for both CIMOMs.
--
-Jay
From grendel at linux.vnet.ibm.com Wed Dec 5 14:54:01 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Wed, 05 Dec 2007 09:54:01 -0500
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
In-Reply-To:
References:
Message-ID: <4756BB89.6030805@linux.vnet.ibm.com>
Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart
> # 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
>
I like this. The rename is definitely more worthwhile if we generalize
it, and I agree that it really can be generalized, as this patch shows.
My only question is: would this be better suited to being part of
std_association instead of libxkutil? Seems like anything that will use
std_association will probably want to use make_reference().
--
-Jay
From danms at us.ibm.com Wed Dec 5 17:26:11 2007
From: danms at us.ibm.com (Dan Smith)
Date: Wed, 05 Dec 2007 09:26:11 -0800
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
In-Reply-To: (Heidi
Eckhart's message of "Wed, 05 Dec 2007 13:41:46 +0200")
References:
Message-ID: <87r6i1xdcc.fsf@theine.beaverton.ibm.com>
HE> # HG changeset patch
HE> # User Heidi Eckhart
HE> # Date 1196858495 -3600
HE> # Node ID af64285fa953aca6c4183d0fd6845d110ddd1a1d
HE> # Parent 012fc8655c2b443511ba536ef2b425ac86f69f7b
HE> [RFC] #2 - variable renaming in make_ref() of associations
HE> Suggestion to rename some of the variables in make_ref()
HE> to make the relations clearer.
HE> Also moved the content of make_ref() to make_reference()
HE> in libxkutil to generalize it. This make_reference can
HE> then be used by each association's make_ref().
Sounds good to me.
HE> + CMPIInstance *ref_inst = NULL;
HE> +
HE> + ref_inst = make_reference(_BROKER,
HE> + source_ref,
HE> + target_inst,
HE> + assoc,
HE> + "ElementAllocatedFromPool");
HE> +
HE> + return ref_inst;
HE> }
Why not just pass the make_reference function from libxkutil directly
in the std_assoc block? The function should be able to infer the name
of the reference from the assoc_class field of the std_assoc or info
struct, right?
That would let us cut out even more code from all the providers :)
--
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 Dec 5 17:27:13 2007
From: danms at us.ibm.com (Dan Smith)
Date: Wed, 05 Dec 2007 09:27:13 -0800
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
In-Reply-To: <4756BB89.6030805@linux.vnet.ibm.com> (Jay Gagnon's message of
"Wed, 05 Dec 2007 09:54:01 -0500")
References:
<4756BB89.6030805@linux.vnet.ibm.com>
Message-ID: <87myspxdam.fsf@theine.beaverton.ibm.com>
JG> My only question is: would this be better suited to being part of
JG> std_association instead of libxkutil? Seems like anything that
JG> will use std_association will probably want to use
JG> make_reference().
No, the make_ref behavior is something we need to do in a special way
that others won't. Putting the (Xen_|KVM_) switch into
std_association would pollute libcmpiutil with libvirt-cim behavior.
--
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 Dec 5 19:01:22 2007
From: danms at us.ibm.com (Dan Smith)
Date: Wed, 05 Dec 2007 11:01:22 -0800
Subject: [Libvirt-cim] [PATCH 0 of 9] #2 - Reorganized association
provider registration
In-Reply-To: (Heidi Eckhart's
message of "Wed, 05 Dec 2007 10:30:09 +0200")
References:
Message-ID: <87ir3dx8xp.fsf@theine.beaverton.ibm.com>
HE> The provider registration approach - registering one provider per
HE> subclass (Xen_Provider, KVM_Provider) caused
HE> interoperability issues with Pegasus and sfcb. The same call
HE> returned duplicates with sfcb and worked with Pegasus.
I applied all of these and tested almost all of them.
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 heidieck at linux.vnet.ibm.com Wed Dec 5 19:06:53 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 20:06:53 +0100
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
In-Reply-To: <87myspxdam.fsf@theine.beaverton.ibm.com>
References:
<4756BB89.6030805@linux.vnet.ibm.com>
<87myspxdam.fsf@theine.beaverton.ibm.com>
Message-ID: <4756F6CD.9060505@linux.vnet.ibm.com>
Dan Smith wrote:
> JG> My only question is: would this be better suited to being part of
> JG> std_association instead of libxkutil? Seems like anything that
> JG> will use std_association will probably want to use
> JG> make_reference().
>
Yes, that was my first try, until I had to realize that
get_typed_instance() is that special to our providers as Dan describes
below ;). So I had to move it to libxkutil.
> No, the make_ref behavior is something we need to do in a special way
> that others won't. Putting the (Xen_|KVM_) switch into
> std_association would pollute libcmpiutil with libvirt-cim behavior.
--
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 Dec 5 20:21:20 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Wed, 05 Dec 2007 21:21:20 +0100
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
In-Reply-To: <87r6i1xdcc.fsf@theine.beaverton.ibm.com>
References:
<87r6i1xdcc.fsf@theine.beaverton.ibm.com>
Message-ID: <47570840.7040504@linux.vnet.ibm.com>
Dan Smith wrote:
> HE> + CMPIInstance *ref_inst = NULL;
> HE> +
> HE> + ref_inst = make_reference(_BROKER,
> HE> + source_ref,
> HE> + target_inst,
> HE> + assoc,
> HE> + "ElementAllocatedFromPool");
> HE> +
> HE> + return ref_inst;
> HE> }
>
> Why not just pass the make_reference function from libxkutil directly
> in the std_assoc block? The function should be able to infer the name
> of the reference from the assoc_class field of the std_assoc or info
> struct, right?
>
> That would let us cut out even more code from all the providers :)
That's a ery interesting idea ! Sadly the current input parameter list
of make_ref_t() in struct std_assoc does not include a broker pointer,
which prevents me from reworking it in your suggested way. Maybe you
have an idea how to solve this ? 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 danms at us.ibm.com Wed Dec 5 22:15:00 2007
From: danms at us.ibm.com (Dan Smith)
Date: Wed, 05 Dec 2007 14:15:00 -0800
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
References:
<87r6i1xdcc.fsf@theine.beaverton.ibm.com>
<47570840.7040504@linux.vnet.ibm.com>
Message-ID: <87zlwowzyz.fsf@theine.beaverton.ibm.com>
HE> Sadly the current input parameter list of make_ref_t() in struct
HE> std_assoc does not include a broker pointer, which prevents me
HE> from reworking it in your suggested way.
Ah, right :(
HE> Maybe you have an idea how to solve this ?
Perhaps we could have a macro that dispatches the make_reference()
function with the appropriate broker? Maybe something like the
following:
#define LIBVIRT_CIM_DEFAULT_MAKEREF \
static CMPIInstance make_ref(const CMPIObjectPath *ref, \
const CMPIInstance *inst, \
struct std_assoc_info *info, \
struct std_assoc *assoc) \
{ \
return default_make_ref(_BROKER, ref, inst, info, assoc);\
}
What do you think?
--
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 jfehlig at novell.com Thu Dec 6 01:10:57 2007
From: jfehlig at novell.com (Jim Fehlig)
Date: Wed, 05 Dec 2007 18:10:57 -0700
Subject: [Libvirt-cim] [PATCH 3 of 6] Add build support
forVirtualSystemMigrationService
In-Reply-To: <58bd9f06204f69bbdbe3.1196787365@theine>
References: <58bd9f06204f69bbdbe3.1196787365@theine>
Message-ID: <47574C21.7030907@novell.com>
Hi Dan,
[...]
> +
> +// Placeholder definition until schema is available upstream
> +
> +class CIM_VirtualSystemMigrationService : CIM_Service {
> + uint32 VirtualSystemIsMigratableToHost(
>
That one is called 'CheckVirtualSystemIsMigratableToHost' upstream -
although I like your shorted name better as 'Check' is already implied
by the rest :-). Think I will comment as such to the author of that CR [1].
> + [Out]
> + CIM_ConcreteJob REF Job,
> + [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
> + string NewResourceSettingData[],
> + [In, EmbeddedInstance("CIM_SettingData")]
> + string MigrationSettingData,
> + [In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
> + string NewSystemSettingData,
> + [In]
> + CIM_ComputerSystem REF ComputerSystem,
> + [In]
> + string DestinationHost);
>
Method arguments have a different order in the CR.
> +
> + uint32 MigrateVirtualSystemToHost(
> + [Out]
> + CIM_ConcreteJob REF Job,
> + [In, EmbeddedInstance("CIM_ResourceAllocationSettingData")]
> + string NewResourceSettingData[],
> + [In, EmbeddedInstance("CIM_SettingData")]
> + string MigrationSettingData,
> + [In, EmbeddedInstance("CIM_VirtualSystemSettingData")]
> + string NewSystemSettingData,
> + [In]
> + CIM_ComputerSystem REF ComputerSystem,
> + [In]
> + string DestinationHost);
> +
> +};
>
Same comment.
Cheers,
Jim
[1]
http://www.dmtf.org/apps/org/workgroup/cim-core/download.php/32768/CIMCoreCR00968.003.html
From danms at us.ibm.com Thu Dec 6 02:11:22 2007
From: danms at us.ibm.com (Dan Smith)
Date: Wed, 05 Dec 2007 18:11:22 -0800
Subject: [Libvirt-cim] [PATCH 3 of 6] Add build support
forVirtualSystemMigrationService
In-Reply-To: <47574C21.7030907@novell.com> (Jim Fehlig's message of "Wed, 05
Dec 2007 18:10:57 -0700")
References: <58bd9f06204f69bbdbe3.1196787365@theine>
<47574C21.7030907@novell.com>
Message-ID: <87ve7cwp11.fsf@theine.beaverton.ibm.com>
JF> That one is called 'CheckVirtualSystemIsMigratableToHost' upstream
Ah, thanks Jim. I actually expect we will pull in a recent DMTF MOF
to cover our inheritance here, so I was just putting something in
place temporarily. I'll correct it though so it doesn't get
overlooked.
JF> - although I like your shorted name better as 'Check' is already
JF> implied by the rest :-). Think I will comment as such to the
JF> author of that CR [1].
No complaints here :)
JF> Method arguments have a different order in the CR.
I'll fix this as well when I put together my next round of migration
patches.
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 Thu Dec 6 09:06:54 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Thu, 06 Dec 2007 11:06:54 +0200
Subject: [Libvirt-cim] [PATCH] Introduce generic LIBVIRT_CIM_DEFAULT_MAKEREF
macro
Message-ID: <618509ea5c6089678975.1196935614@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196935598 -3600
# Node ID 618509ea5c6089678975cde7f4b5a687aa1e68f0
# Parent d9af4651f76314647dbda82f5ccf3d926ce9dc05
Introduce generic LIBVIRT_CIM_DEFAULT_MAKEREF macro
Moved the content of association's make_ref() to
make_reference() in libxkutil to generalize it. The
make_reference can be used via
LIBVIRT_CIM_DEFAULT_MAKEREF macro by each association.
Reduces lines of code per provider.
Updated all association providers to make use of
make_reference() and LIBVIRT_CIM_DEFAULT_MAKEREF.
Signed-off-by: Heidi Eckhart
diff -r d9af4651f763 -r 618509ea5c60 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Wed Dec 05 09:42:26 2007 +0100
+++ b/libxkutil/misc_util.c Thu Dec 06 11:06:38 2007 +0100
@@ -342,7 +342,35 @@ 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_info *info,
+ struct std_assoc *assoc)
+{
+ CMPIInstance *ref_inst = NULL;
+ char* assoc_classname;
+
+ assoc_classname = class_base_name(assoc->assoc_class[0]);
+
+ 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);
+ }
+
+ free(assoc_classname);
+
+ return ref_inst;
+}
bool domain_online(virDomainPtr dom)
{
diff -r d9af4651f763 -r 618509ea5c60 libxkutil/misc_util.h
--- a/libxkutil/misc_util.h Wed Dec 05 09:42:26 2007 +0100
+++ b/libxkutil/misc_util.h Thu Dec 06 11:06:38 2007 +0100
@@ -109,6 +109,26 @@ 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_info *info,
+ struct std_assoc *assoc);
+
+
+#define LIBVIRT_CIM_DEFAULT_MAKEREF() \
+ static CMPIInstance* make_ref(const CMPIObjectPath *source_ref, \
+ const CMPIInstance *target_inst, \
+ struct std_assoc_info *info, \
+ struct std_assoc *assoc) \
+ { \
+ return make_reference(_BROKER, \
+ source_ref, \
+ target_inst, \
+ info, \
+ assoc); \
+ }
+
/*
* Local Variables:
* mode: C
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_ElementAllocatedFromPool.c
--- a/src/Virt_ElementAllocatedFromPool.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_ElementAllocatedFromPool.c Thu Dec 06 11:06:38 2007 +0100
@@ -247,28 +247,7 @@ static CMPIStatus pool_to_vdev(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *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;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* antecedent[] = {
"Xen_ProcessorPool",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_ElementCapabilities.c Thu Dec 06 11:06:38 2007 +0100
@@ -210,39 +210,7 @@ static CMPIStatus pool_to_alloc(const CM
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- 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,
- pfx_from_conn(conn),
- "ElementCapabilities",
- 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);
- }
-
- virConnectClose(conn);
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* assoc_classname[] = {
"Xen_ElementCapabilities",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_ElementConformsToProfile.c
--- a/src/Virt_ElementConformsToProfile.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_ElementConformsToProfile.c Thu Dec 06 11:06:38 2007 +0100
@@ -190,38 +190,7 @@ static CMPIStatus elem_to_prof(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *source_op,
- const CMPIInstance *target_inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- 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,
- pfx_from_conn(conn),
- "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);
- }
-
- virConnectClose(conn);
-
- return assoc_inst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* conformant_standard[] = {
"Xen_RegisteredProfile",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_ElementSettingData.c
--- a/src/Virt_ElementSettingData.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_ElementSettingData.c Thu Dec 06 11:06:38 2007 +0100
@@ -126,50 +126,37 @@ static CMPIStatus rasd_to_rasd(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)
{
- CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *refinst = NULL;
- virConnectPtr conn = NULL;
uint16_t prop_value = 1;
- conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
- if (conn == NULL)
- return NULL;
-
- refinst = get_typed_instance(_BROKER,
- pfx_from_conn(conn),
- "ElementSettingData",
- NAMESPACE(ref));
+ refinst = make_reference(_BROKER,
+ source_ref,
+ target_inst,
+ info,
+ assoc);
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);
-
+ (CMPIValue *)&prop_value, CMPI_uint16);
+
CMSetProperty(refinst, "IsNext",
- (CMPIValue *)&prop_value, CMPI_uint16);
+ (CMPIValue *)&prop_value, CMPI_uint16);
CMSetProperty(refinst, "IsMinimum",
- (CMPIValue *)&prop_value, CMPI_uint16);
-
+ (CMPIValue *)&prop_value, CMPI_uint16);
+
CMSetProperty(refinst, "IsMaximum",
- (CMPIValue *)&prop_value, CMPI_uint16);
- }
-
- virConnectClose(conn);
-
+ (CMPIValue *)&prop_value, CMPI_uint16);
+ }
+
return refinst;
}
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_HostedDependency.c
--- a/src/Virt_HostedDependency.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_HostedDependency.c Thu Dec 06 11:06:38 2007 +0100
@@ -82,28 +82,7 @@ static CMPIStatus host_to_vs(const CMPIO
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "HostedDependency",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* antecedent[] = {
"Xen_ComputerSystem",
@@ -149,7 +128,6 @@ static struct std_assoc _host_to_vs = {
.make_ref = make_ref
};
-
static struct std_assoc *handlers[] = {
&_vs_to_host,
&_host_to_vs,
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_HostedResourcePool.c
--- a/src/Virt_HostedResourcePool.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_HostedResourcePool.c Thu Dec 06 11:06:38 2007 +0100
@@ -97,32 +97,7 @@ static CMPIStatus sys_to_pool(const CMPI
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(info->assoc_class);
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- base,
- NAMESPACE(ref));
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- free(base);
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* group_component[] = {
"Xen_HostSystem",
@@ -180,7 +155,6 @@ struct std_assoc *assoc_handlers[] = {
NULL
};
-
STDA_AssocMIStub(, Virt_HostedResourcePoolProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_HostedService.c
--- a/src/Virt_HostedService.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_HostedService.c Thu Dec 06 11:06:38 2007 +0100
@@ -85,36 +85,7 @@ static CMPIStatus host_to_service(const
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- 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,
- pfx_from_conn(conn),
- "HostedService",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- virConnectClose(conn);
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* antecedent[] = {
"Xen_HostSystem",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_ResourceAllocationFromPool.c
--- a/src/Virt_ResourceAllocationFromPool.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_ResourceAllocationFromPool.c Thu Dec 06 11:06:38 2007 +0100
@@ -226,28 +226,7 @@ static CMPIStatus pool_to_rasd(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "ResourceAllocationFromPool",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* antecedent[] = {
"Xen_ProcessorPool",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_SettingsDefineCapabilities.c Thu Dec 06 11:06:38 2007 +0100
@@ -812,39 +812,8 @@ static CMPIStatus rasd_to_alloc_cap(cons
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- 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,
- pfx_from_conn(conn),
- "SettingsDefineCapabilities",
- 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);
- }
-
- virConnectClose(conn);
-
- return refinst;
-}
+
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* group_component[] = {
"Xen_AllocationCapabilities",
@@ -902,7 +871,6 @@ struct std_assoc *assoc_handlers[] = {
NULL
};
-
STDA_AssocMIStub(, Virt_SettingsDefineCapabilitiesProvider, _BROKER, libvirt_cim_init(), assoc_handlers);
/*
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_SettingsDefineState.c
--- a/src/Virt_SettingsDefineState.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_SettingsDefineState.c Thu Dec 06 11:06:38 2007 +0100
@@ -288,28 +288,7 @@ static CMPIStatus vssd_to_vs(const CMPIO
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "SettingsDefineState",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* logical_device[] = {
"Xen_Processor",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_SystemDevice.c
--- a/src/Virt_SystemDevice.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_SystemDevice.c Thu Dec 06 11:06:38 2007 +0100
@@ -130,30 +130,6 @@ static CMPIInstance *host_instance(char
return inst;
}
-
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "SystemDevice",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
-}
-
static CMPIStatus sys_to_dev(const CMPIObjectPath *ref,
struct std_assoc_info *info,
struct inst_list *list)
@@ -233,6 +209,8 @@ static CMPIStatus dev_to_sys(const CMPIO
return s;
}
+
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* group_component[] = {
"Xen_ComputerSystem",
diff -r d9af4651f763 -r 618509ea5c60 src/Virt_VSSDComponent.c
--- a/src/Virt_VSSDComponent.c Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Virt_VSSDComponent.c Thu Dec 06 11:06:38 2007 +0100
@@ -152,28 +152,7 @@ static CMPIStatus rasd_to_vssd(const CMP
return s;
}
-static CMPIInstance *make_ref(const CMPIObjectPath *ref,
- const CMPIInstance *inst,
- struct std_assoc_info *info,
- struct std_assoc *assoc)
-{
- CMPIInstance *refinst = NULL;
-
- refinst = get_typed_instance(_BROKER,
- CLASSNAME(ref),
- "VirtualSystemSettingDataComponent",
- NAMESPACE(ref));
-
- if (refinst != NULL) {
- CMPIObjectPath *instop;
-
- instop = CMGetObjectPath(inst, NULL);
-
- set_reference(assoc, refinst, ref, instop);
- }
-
- return refinst;
-}
+LIBVIRT_CIM_DEFAULT_MAKEREF()
char* group_component[] = {
"Xen_VirtualSystemSettingData",
@@ -199,7 +178,6 @@ char* assoc_classname[] = {
NULL
};
-
static struct std_assoc forward = {
.source_class = (char**)&group_component,
.source_prop = "GroupComponent",
From heidieck at linux.vnet.ibm.com Thu Dec 6 09:07:03 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Thu, 06 Dec 2007 11:07:03 +0200
Subject: [Libvirt-cim] [PATCH] SDS: Fixed segfaulting reference(Names) call
due to missing assoc_classname
Message-ID:
# HG changeset patch
# User Heidi Eckhart
# Date 1196935598 -3600
# Node ID ba4bc35f508573c53e4303ce2e7a9b5299b95f38
# Parent 618509ea5c6089678975cde7f4b5a687aa1e68f0
SDS: Fixed segfaulting reference(Names) call due to missing assoc_classname
Signed-off-by: Heidi Eckhart
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
From heidieck at linux.vnet.ibm.com Thu Dec 6 09:07:16 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Thu, 06 Dec 2007 11:07:16 +0200
Subject: [Libvirt-cim] [PATCH] html: Added additional classes to
cimv216-interop.mof
Message-ID: <30269254841ceed6a250.1196935636@localhost.localdomain>
# HG changeset patch
# User Heidi Eckhart
# Date 1196935599 -3600
# Node ID 30269254841ceed6a250ea2b714c594fa30cc19e
# Parent ba4bc35f508573c53e4303ce2e7a9b5299b95f38
html: Added additional classes to cimv216-interop.mof
These additional classes are necessary to register Xen/KVM
ComputerSystem and HostSystem classes to interop. Otherwise
Pegasus refuses the registration.
Signed-off-by: Heidi Eckhart
diff -r ba4bc35f5085 -r 30269254841c doc/libvirt-cim.html
--- a/doc/libvirt-cim.html Thu Dec 06 11:06:38 2007 +0100
+++ b/doc/libvirt-cim.html Thu Dec 06 11:06:39 2007 +0100
@@ -300,6 +300,11 @@ below:
#pragma include ("qualifiers.mof")
#pragma include ("qualifiers_optional.mof")
#pragma include ("Core/CIM_ManagedElement.mof")
+#pragma include ("Core/CIM_ManagedSystemElement.mof")
+#pragma include ("Core/CIM_LogicalElement.mof")
+#pragma include ("Core/CIM_EnabledLogicalElement.mof")
+#pragma include ("Core/CIM_System.mof")
+#pragma include ("System/CIM_ComputerSystem.mof")
#pragma include ("Interop/CIM_RegisteredProfile.mof")
#pragma include ("Interop/CIM_RegisteredSubProfile.mof")
#pragma include ("Core/CIM_Dependency.mof")
From heidieck at linux.vnet.ibm.com Thu Dec 6 13:05:03 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Thu, 06 Dec 2007 14:05:03 +0100
Subject: [Libvirt-cim] IMPORTANT: configure Pegasus with
"forceProviderProcesses=true"
Message-ID: <4757F37F.3030700@linux.vnet.ibm.com>
Hi all,
due to the changes made to the associations (registering the Virt_
provider for each subclass), it is now very important that Pegasus is
configured for "forceProviderProcesses=true". Otherwise only strange
things are happening ...
... 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 danms at us.ibm.com Thu Dec 6 14:28:48 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 06:28:48 -0800
Subject: [Libvirt-cim] IMPORTANT: configure Pegasus with
"forceProviderProcesses=true"
In-Reply-To: <4757F37F.3030700@linux.vnet.ibm.com> (Heidi Eckhart's message of
"Thu, 06 Dec 2007 14:05:03 +0100")
References: <4757F37F.3030700@linux.vnet.ibm.com>
Message-ID: <87fxyfx5gf.fsf@theine.beaverton.ibm.com>
HE> due to the changes made to the associations (registering the Virt_
HE> provider for each subclass), it is now very important that Pegasus
HE> is configured for "forceProviderProcesses=true". Otherwise only
HE> strange things are happening ...
Can you explain why you think this? I have
forceProviderProcesses=false and I haven't noticed any weird behavior
thus far (aside from the libvirt init race, which is still not fully
resolved).
There's nothing about the std_association approach that should be any
less thread-safe than the "conventional" approach, other than if
Pegasus itself has issues with multiple calls into the broker at
once. If this is the case, we should be able to work around it by
preparing additional context objects as you do when you prepare a
thread to run, or we could provide mutual exclusion at the
std_association layer.
Before I could be convinced that we've got a thread-safety issue, I
would want to know what behavior you're seeing, and hear from someone
familiar with the Pegasus internals on why what we're doing is not
safe.
--
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 Dec 6 16:06:30 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Thu, 06 Dec 2007 08:06:30 -0800
Subject: [Libvirt-cim] [PATCH] [RFC] #2 - variable renaming in make_ref()
of associations
In-Reply-To: <87zlwowzyz.fsf@theine.beaverton.ibm.com>
References:
<87r6i1xdcc.fsf@theine.beaverton.ibm.com>
<47570840.7040504@linux.vnet.ibm.com>
<87zlwowzyz.fsf@theine.beaverton.ibm.com>
Message-ID: <47581E06.7000506@linux.vnet.ibm.com>
Dan Smith wrote:
> HE> Sadly the current input parameter list of make_ref_t() in struct
> HE> std_assoc does not include a broker pointer, which prevents me
> HE> from reworking it in your suggested way.
>
> Ah, right :(
>
> HE> Maybe you have an idea how to solve this ?
>
> Perhaps we could have a macro that dispatches the make_reference()
> function with the appropriate broker? Maybe something like the
> following:
>
> #define LIBVIRT_CIM_DEFAULT_MAKEREF \
> static CMPIInstance make_ref(const CMPIObjectPath *ref, \
> const CMPIInstance *inst, \
> struct std_assoc_info *info, \
> struct std_assoc *assoc) \
> { \
> return default_make_ref(_BROKER, ref, inst, info, assoc);\
> }
>
> What do you think?
>
I think this is a neat idea.
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From grendel at linux.vnet.ibm.com Thu Dec 6 15:38:07 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Thu, 06 Dec 2007 11:38:07 -0400
Subject: [Libvirt-cim] [PATCH] [CU] Several small fixes for
indication_tester.py:
Message-ID: <43172447a69a867b00bd.1196959087@wulfgar.pok.ibm.com>
# HG changeset patch
# User Jay Gagnon
# Date 1196959002 18000
# Node ID 43172447a69a867b00bdf1bf8fbed3c50a199fd5
# Parent 8459ef1378807def1f91addfc6ba54fd16a44cf2
[CU] Several small fixes for indication_tester.py:
Move #! interpreter line to top (otherwise it is ignored).
Add usage message that includes mandatory argument.
Exit cleanly with error message when mandatory arg missing.
Fix default namespace in indication tester to root/virt.
Use OptionParser's way to specify defaults.
Remove itest.c
Signed-off-by: Jay Gagnon
diff -r 8459ef137880 -r 43172447a69a tools/indication_tester.py
--- a/tools/indication_tester.py Fri Nov 30 14:14:41 2007 -0800
+++ b/tools/indication_tester.py Thu Dec 06 11:36:42 2007 -0500
@@ -1,5 +1,5 @@
+#!/usr/bin/python
# Copyright IBM Corp. 2007
-#!/usr/bin/python
#
# indication_tester.py - Tool for testing indication subscription and
# delivery against a CIMOM
@@ -325,22 +325,20 @@ class CIMIndicationSubscription:
self.__do_cimpost(self.conn, delete_inst_xml(self.name, "Filter"))
def main():
- parser = OptionParser()
- parser.add_option("-u", "--url", dest="url",
+ parser = OptionParser(usage="usage: %prog [options] type")
+ parser.add_option("-u", "--url", dest="url", default="localhost:5988",
help="URL of CIMOM to connect to (host:port)")
- parser.add_option("-N", "--ns", dest="ns",
- help="Namespace (default is root/ibmsd)")
- parser.add_option("-n", "--name", dest="name",
+ parser.add_option("-N", "--ns", dest="ns", default="root/virt",
+ help="Namespace (default is root/virt)")
+ parser.add_option("-n", "--name", dest="name", default="Test",
help="Base name for filter, handler, subscription")
(options, args) = parser.parse_args()
- if not options.url:
- options.url = "localhost:5988"
- if not options.ns:
- options.ns = "root/ibmsd"
- if not options.name:
- options.name = "Test"
-
+
+ if len(args) == 0:
+ print "Fatal: no indication type provided."
+ sys.exit(1)
+
sub = CIMIndicationSubscription(options.name, args[0], options.ns)
sub.subscribe(options.url)
print "Watching for %s" % args[0]
diff -r 8459ef137880 -r 43172447a69a tools/itest.c
--- a/tools/itest.c Fri Nov 30 14:14:41 2007 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,609 +0,0 @@
-/*
- * Copyright IBM Corp. 2007
- *
- * Authors:
- * 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
- */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-static int tcp_incoming(int port)
-{
- struct sockaddr_in srvaddr;
- int s = -1;
- int ret;
-
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- perror("socket");
- return -1;
- }
-
- memset(&srvaddr, 0, sizeof(srvaddr));
-
- srvaddr.sin_family = AF_INET;
- srvaddr.sin_addr.s_addr = htonl(INADDR_ANY);
- srvaddr.sin_port = htons(port);
-
- ret = bind(s, (struct sockaddr *)&srvaddr, sizeof(srvaddr));
- if (ret) {
- perror("bind");
- goto err;
- }
-
- ret = listen(s, 1);
- if (ret) {
- perror("listen");
- goto err;
- }
-
- return s;
-
- err:
- close(s);
- return -1;
-}
-
-static int create_filter(FILE *pipe,
- const char *name,
- const char *type,
- const char *ns)
-{
- int ret = 0;
- char *xml = NULL;
- const char *filter_fmt = " \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- localhost.localdomain \
- \
- \
- CIM_IndicationFilter \
- \
- \
- %sFilter \
- \
- \
- SELECT * FROM %s \
- \
- \
- \
- WQL \
- \
- \
- %s \
- \
- \
- \
- \
- \
- \
-";
-
- ret = asprintf(&xml, filter_fmt, name, type, ns);
- if (ret == -1)
- goto out;
-
- ret = fwrite(xml, strlen(xml), 1, pipe);
- ret = (ret == strlen(xml));
-
- out:
- free(xml);
-
- return ret;
-}
-
-static int create_handler(FILE *pipe, int port, const char *name)
-{
- int ret = 0;
- char *xml = NULL;
- const char * handler_fmt = " \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- localhost.localdomain \
- \
- \
- CIM_IndicationHandlerCIMXML \
- \
- \
- %sHandler \
- \
- \
- localhost:%i \
- \
- \
- \
- \
- \
- \
-";
-
- ret = asprintf(&xml, handler_fmt, name, port);
- if (ret == -1)
- return 0;
-
- ret = fwrite(xml, strlen(xml), 1, pipe);
- ret = (ret == strlen(xml));
-
- free(xml);
-
- return ret;
-}
-
-static int create_subscription(FILE *pipe, const char *name)
-{
- int ret = 0;
- char *xml = NULL;
- const char *sub_fmt = " \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- \
- \
- localhost.localdomain \
- \
- \
- \
- \
- CIM_IndicationFilter \
- \
- \
- \
- \
- %sFilter \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- \
- \
- localhost.localdomain \
- \
- \
- \
- \
- CIM_IndicationHandlerCIMXML \
- \
- \
- \
- \
- %sHandler \
- \
- \
- \
- \
- \
- \
- 2 \
- \
- \
- \
- \
- \
- \
-";
-
- ret = asprintf(&xml, sub_fmt, name, name);
- if (ret == -1)
- goto out;
-
- ret = fwrite(xml, strlen(xml), 1, pipe);
- ret = (ret == strlen(xml));
-
- out:
- free(xml);
-
- return ret;
-}
-
-static int delete_inst(FILE *pipe, const char *name, const char *type)
-{
- int ret;
- char *xml = NULL;
- const char *fmt = "\
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- localhost.localdomain \
- \
- \
- CIM_Indication%sCIMXML \
- \
- \
- %s%s \
- \
- \
- \
- \
- \
- \
-";
-
- ret = asprintf(&xml, fmt, type, type, name, type);
- if (ret == -1)
- return 0;
-
- ret = fwrite(xml, strlen(xml), 1, pipe);
- ret = (ret == strlen(xml));
-
- free(xml);
-
- return ret;
-}
-
-static int delete_subscription(FILE *pipe, char *name)
-{
- int ret;
- char *xml = NULL;
- const char *fmt = "\
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- \
- \
- localhost.localdomain \
- \
- \
- \
- \
- CIM_IndicationFilter \
- \
- \
- \
- \
- %sFilter \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- CIM_ComputerSystem \
- \
- \
- \
- \
- localhost.localdomain \
- \
- \
- \
- \
- CIM_IndicationHandlerCIMXML \
- \
- \
- \
- \
- %sHandler \
- \
- \
- \
- \
- \
- \
- \
- \
- \
- \
-";
-
- ret = asprintf(&xml, fmt, name, name);
- if (ret == -1)
- return 0;
-
- ret = fwrite(xml, strlen(xml), 1, pipe);
- ret = (ret == strlen(xml));
-
- free(xml);
-
- return 1;
-}
-
-int interrupted;
-
-static int monitor_indications(int fd, int howmany)
-{
- int i;
- char buf[4096];
- struct sockaddr saddr;
- unsigned int len;
-
- int flags;
-
- flags = fcntl(fd, F_GETFD);
- fcntl(fd, F_SETFD, flags | O_NONBLOCK);
-
- interrupted = 0;
-
- for (i = 0; i < howmany; i++) {
- int ret;
- int s;
- fd_set fds;
-
- if (interrupted)
- break;
-
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
-
- ret = select(fd+1, &fds, NULL, NULL, NULL);
- if (ret <= 0)
- continue;
-
- s = accept(fd, &saddr, &len);
- if (s < 0)
- continue;
-
- ret = read(s, buf, sizeof(buf));
- if (ret > 0)
- printf("Got indication\n");
-
- close(s);
- }
-
- return i;
-}
-
-static void interrupt(int sig)
-{
- interrupted = 1;
-}
-
-struct config {
- char *type;
- int port;
- char *name;
- char *ns;
- int iter;
- int debug;
-};
-
-static void usage(char *name)
-{
- printf("Usage:\n"
- "%s [OPTIONS]\n"
- "\n"
- " -t,--type=class Indication type to watch for\n"
- " -p,--port=1234 TCP port to listen to\n"
- " -n,--name=foo Indication instance name base\n"
- " -N,--ns=foo Namespace\n"
- " -i,--iter=1 Number of instances to receive before exit\n"
- " -d,--debug Enable debugging\n"
- " -h,--help This help text\n",
- name);
-}
-
-static int parse_args(int argc, char **argv, struct config *config)
-{
- int idx;
- static struct option opts[] = {
- {"type", 1, 0, 't'},
- {"port", 1, 0, 'p'},
- {"name", 1, 0, 'n'},
- {"ns", 1, 0, 'N'},
- {"iter", 1, 0, 'i'},
- {"help", 0, 0, 'h'},
- {"debug", 0, 0, 'd'},
- {0, 0, 0, 0}};
-
- config->type = "CIM_InstCreation";
- config->port = 1234;
- config->name = "TestIndication";
- config->ns = "root/ibmsd";
- config->iter = 1;
- config->debug = 0;
-
- while (1) {
- int c;
-
- c = getopt_long(argc, argv, "t:p:n:N:i:hd", opts, &idx);
- if (c == -1)
- break;
-
- switch (c) {
- case 't':
- config->type = optarg;
- break;
-
- case'n':
- config->name = optarg;
- break;
-
- case 'N':
- config->ns = optarg;
- break;
-
- case 'p':
- config->port = atoi(optarg);
- break;
-
- case 'i':
- config->iter = atoi(optarg);
- break;
-
- case 'd':
- config->debug = 1;
- break;
-
- case 'h':
- case '?':
- usage(argv[0]);
- return 0;
- break;
- };
- }
-
- return 1;
-}
-
-#define WBEMCAT(f) \
- if (config.debug) \
- pipe = popen("wbemcat", "w"); \
- else \
- pipe = popen("wbemcat >/dev/null 2>&1", "w"); \
- f; \
- ret = fclose(pipe);
-
-int main(int argc, char **argv)
-{
- int s;
- FILE *pipe;
- int ret;
- struct config config;
-
- if (!parse_args(argc, argv, &config))
- return 1;
-
- signal(SIGINT, interrupt);
- signal(SIGTERM, interrupt);
-
- s = tcp_incoming(config.port);
- if (s < 0) {
- printf("Unable to listen on port %i\n", config.port);
- return 1;
- }
-
- WBEMCAT(create_filter(pipe, config.name, config.type, config.ns));
- if (ret) {
- printf("Failed to create filter\n");
- return 1;
- }
-
- WBEMCAT(create_handler(pipe, config.port, config.name));
- if (ret) {
- printf("Failed to create handler\n");
- goto out1;
- }
-
- WBEMCAT(create_subscription(pipe, config.name));
- if (ret) {
- printf("Failed to create subscription\n");
- goto out2;
- }
-
- monitor_indications(s, config.iter);
-
- WBEMCAT(delete_subscription(pipe, config.name));
- out2:
- WBEMCAT(delete_inst(pipe, config.name, "Handler"));
- out1:
- WBEMCAT(delete_inst(pipe, config.name, "Filter"));
-
- close(s);
-
- return 0;
-}
-
-/*
- * Local Variables:
- * mode: C
- * c-set-style: "K&R"
- * tab-width: 8
- * c-basic-offset: 8
- * indent-tabs-mode: nil
- * End:
- */
From grendel at linux.vnet.ibm.com Thu Dec 6 16:54:29 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Thu, 06 Dec 2007 11:54:29 -0500
Subject: [Libvirt-cim] [PATCH] SDS: Fixed segfaulting reference(Names)
call due to missing assoc_classname
In-Reply-To:
References:
Message-ID: <47582945.5000300@linux.vnet.ibm.com>
Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart
> # Date 1196935598 -3600
> # Node ID ba4bc35f508573c53e4303ce2e7a9b5299b95f38
> # Parent 618509ea5c6089678975cde7f4b5a687aa1e68f0
> SDS: Fixed segfaulting reference(Names) call due to missing assoc_classname
> Signed-off-by: Heidi Eckhart
>
> 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
>
>
>
Well, we certainly don't want segfaults. Nice catch. +1
--
-Jay
From grendel at linux.vnet.ibm.com Thu Dec 6 16:57:05 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Thu, 06 Dec 2007 11:57:05 -0500
Subject: [Libvirt-cim] [PATCH] html: Added additional classes to
cimv216-interop.mof
In-Reply-To: <30269254841ceed6a250.1196935636@localhost.localdomain>
References: <30269254841ceed6a250.1196935636@localhost.localdomain>
Message-ID: <475829E1.7070501@linux.vnet.ibm.com>
Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart
> # Date 1196935599 -3600
> # Node ID 30269254841ceed6a250ea2b714c594fa30cc19e
> # Parent ba4bc35f508573c53e4303ce2e7a9b5299b95f38
> html: Added additional classes to cimv216-interop.mof
>
> These additional classes are necessary to register Xen/KVM
> ComputerSystem and HostSystem classes to interop. Otherwise
> Pegasus refuses the registration.
> Signed-off-by: Heidi Eckhart
>
> diff -r ba4bc35f5085 -r 30269254841c doc/libvirt-cim.html
> --- a/doc/libvirt-cim.html Thu Dec 06 11:06:38 2007 +0100
> +++ b/doc/libvirt-cim.html Thu Dec 06 11:06:39 2007 +0100
> @@ -300,6 +300,11 @@ below:
> #pragma include ("qualifiers.mof")
> #pragma include ("qualifiers_optional.mof")
> #pragma include ("Core/CIM_ManagedElement.mof")
> +#pragma include ("Core/CIM_ManagedSystemElement.mof")
> +#pragma include ("Core/CIM_LogicalElement.mof")
> +#pragma include ("Core/CIM_EnabledLogicalElement.mof")
> +#pragma include ("Core/CIM_System.mof")
> +#pragma include ("System/CIM_ComputerSystem.mof")
> #pragma include ("Interop/CIM_RegisteredProfile.mof")
> #pragma include ("Interop/CIM_RegisteredSubProfile.mof")
> #pragma include ("Core/CIM_Dependency.mof")
>
Looks syntactically sound. I don't recognize a couple of those classes
as dual-namespace ones, but I'm not going to second guess our CIM
Compliance Officer on that. :) +1
--
-Jay
From kaitlin at linux.vnet.ibm.com Thu Dec 6 16:57:38 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Thu, 06 Dec 2007 08:57:38 -0800
Subject: [Libvirt-cim] [PATCH] Introduce generic
LIBVIRT_CIM_DEFAULT_MAKEREF macro
In-Reply-To: <618509ea5c6089678975.1196935614@localhost.localdomain>
References: <618509ea5c6089678975.1196935614@localhost.localdomain>
Message-ID: <47582A02.10306@linux.vnet.ibm.com>
Heidi Eckhart wrote:
> # HG changeset patch
> # User Heidi Eckhart
> # Date 1196935598 -3600
> # Node ID 618509ea5c6089678975cde7f4b5a687aa1e68f0
> # Parent d9af4651f76314647dbda82f5ccf3d926ce9dc05
> Introduce generic LIBVIRT_CIM_DEFAULT_MAKEREF macro
>
> Moved the content of association's make_ref() to
> make_reference() in libxkutil to generalize it. The
> make_reference can be used via
> LIBVIRT_CIM_DEFAULT_MAKEREF macro by each association.
> Reduces lines of code per provider.
>
> Updated all association providers to make use of
> make_reference() and LIBVIRT_CIM_DEFAULT_MAKEREF.
>
I did a quick test of every provider modified. Looks good. +1
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From danms at us.ibm.com Thu Dec 6 17:09:44 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:09:44 -0800
Subject: [Libvirt-cim] [PATCH] html: Added additional classes to
cimv216-interop.mof
In-Reply-To: <30269254841ceed6a250.1196935636@localhost.localdomain> (Heidi
Eckhart's message of "Thu, 06 Dec 2007 11:07:16 +0200")
References: <30269254841ceed6a250.1196935636@localhost.localdomain>
Message-ID: <878x47agx3.fsf@theine.beaverton.ibm.com>
HE> # HG changeset patch
HE> # User Heidi Eckhart
HE> # Date 1196935599 -3600
HE> # Node ID 30269254841ceed6a250ea2b714c594fa30cc19e
HE> # Parent ba4bc35f508573c53e4303ce2e7a9b5299b95f38
HE> html: Added additional classes to cimv216-interop.mof
I'm actually working up a patch to automate installation of the base
schema, which should render the documentation about how to do it
irrelevant. I've incorporated your additional classes below into my
patch and will be sending it out shortly for comments.
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 Thu Dec 6 17:15:42 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Thu, 06 Dec 2007 09:15:42 -0800
Subject: [Libvirt-cim] [PATCH] html: Added additional classes to
cimv216-interop.mof
In-Reply-To: <475829E1.7070501@linux.vnet.ibm.com>
References: <30269254841ceed6a250.1196935636@localhost.localdomain>
<475829E1.7070501@linux.vnet.ibm.com>
Message-ID: <47582E3E.2060800@linux.vnet.ibm.com>
Jay Gagnon wrote:
>> --- a/doc/libvirt-cim.html Thu Dec 06 11:06:38 2007 +0100
>> +++ b/doc/libvirt-cim.html Thu Dec 06 11:06:39 2007 +0100
>> @@ -300,6 +300,11 @@ below:
>> #pragma include ("qualifiers.mof")
>> #pragma include ("qualifiers_optional.mof")
>> #pragma include ("Core/CIM_ManagedElement.mof")
>> +#pragma include ("Core/CIM_ManagedSystemElement.mof")
>> +#pragma include ("Core/CIM_LogicalElement.mof")
>> +#pragma include ("Core/CIM_EnabledLogicalElement.mof")
>> +#pragma include ("Core/CIM_System.mof")
>> +#pragma include ("System/CIM_ComputerSystem.mof")
>> #pragma include ("Interop/CIM_RegisteredProfile.mof")
>> #pragma include ("Interop/CIM_RegisteredSubProfile.mof")
>> #pragma include ("Core/CIM_Dependency.mof")
>>
>>
>
> Looks syntactically sound. I don't recognize a couple of those classes
> as dual-namespace ones, but I'm not going to second guess our CIM
> Compliance Officer on that. :) +1
>
For my own curiosity - I'm not sure why CIM_EnabledLogicalElement.mof
and CIM_Dependency.mof need to be added. I understand the need for the
others though. =)
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From danms at us.ibm.com Thu Dec 6 16:28:16 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:28:16 -0700
Subject: [Libvirt-cim] [PATCH] Fix missing migration header for distribution
Message-ID: <9645be7b079b882978e9.1196962096@theine>
# HG changeset patch
# User Dan Smith
# Date 1196959081 28800
# Node ID 9645be7b079b882978e9ef636c128fef95967497
# Parent d9af4651f76314647dbda82f5ccf3d926ce9dc05
Fix missing migration header for distribution
Signed-off-by: Dan Smith
diff -r d9af4651f763 -r 9645be7b079b src/Makefile.am
--- a/src/Makefile.am Wed Dec 05 09:42:26 2007 +0100
+++ b/src/Makefile.am Thu Dec 06 08:38:01 2007 -0800
@@ -15,7 +15,9 @@ noinst_HEADERS = profiles.h svpc_types.h
Virt_SettingsDefineCapabilities.h \
Virt_VirtualSystemManagementCapabilities.h \
Virt_VirtualSystemManagementService.h \
- Virt_VSSD.h
+ Virt_VSSD.h \
+ Virt_VSMigrationCapabilities.h \
+ Virt_VSMigrationService.h
XKUADD = $(top_builddir)/libxkutil/libxkutil.la
From danms at us.ibm.com Thu Dec 6 16:30:10 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:30:10 -0700
Subject: [Libvirt-cim]
[PATCH] Rpm changes, per Fedora package review process
Message-ID: <84aa3e272c6d8195ce07.1196962210@theine>
# HG changeset patch
# User Dan Smith
# Date 1196962105 28800
# Node ID 84aa3e272c6d8195ce07dd3a54bc8743fd771945
# Parent 9645be7b079b882978e9ef636c128fef95967497
Rpm changes, per Fedora package review process
Signed-off-by: Dan Smith
diff -r 9645be7b079b -r 84aa3e272c6d libvirt-cim.spec.in
--- a/libvirt-cim.spec.in Thu Dec 06 08:38:01 2007 -0800
+++ b/libvirt-cim.spec.in Thu Dec 06 09:28:25 2007 -0800
@@ -4,10 +4,10 @@ Name: libvirt-cim
Name: libvirt-cim
Version: @PACKAGE_VERSION@
Release: 1%{?dist}%{?extra_release}
-License: LGPL
+License: LGPLv2+
Group: Development/Libraries
Source: libvirt-cim-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/CIM/
Requires: libxml2
Requires: libvirt >= 0.2.3
@@ -26,23 +26,23 @@ platforms with a single provider.
%prep
%setup -q
+chmod -x src/* libxkutil/* schema/*
%build
%configure --disable-werror
-make
+make %{?_smp_mflags}
%install
-rm -fr %{buildroot}
+rm -fr $RPM_BUILD_ROOT
-%makeinstall PROVIDERDIR=%{buildroot}%{_libdir}/cmpi
-cp provider-register.sh %{buildroot}%{_datadir}/libvirt-cim/
+make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a
%clean
-rm -fr %{buildroot}
+rm -fr $RPM_BUILD_ROOT
%pre
%define REGISTRATION %{_datadir}/%{name}/*.registration
@@ -64,8 +64,7 @@ rm -fr %{buildroot}
-n /@CIM_VIRT_NS@ \
-r %{REGISTRATION} -m %{SCHEMA} || true
-%postun
-/sbin/ldconfig
+%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
From kaitlin at linux.vnet.ibm.com Thu Dec 6 17:39:51 2007
From: kaitlin at linux.vnet.ibm.com (Kaitlin Rupert)
Date: Thu, 06 Dec 2007 09:39:51 -0800
Subject: [Libvirt-cim] [PATCH] [CU] Several small fixes for
indication_tester.py:
In-Reply-To: <43172447a69a867b00bd.1196959087@wulfgar.pok.ibm.com>
References: <43172447a69a867b00bd.1196959087@wulfgar.pok.ibm.com>
Message-ID: <475833E7.9070502@linux.vnet.ibm.com>
Jay Gagnon wrote:
> # HG changeset patch
> # User Jay Gagnon
> # Date 1196959002 18000
> # Node ID 43172447a69a867b00bdf1bf8fbed3c50a199fd5
> # Parent 8459ef1378807def1f91addfc6ba54fd16a44cf2
> [CU] Several small fixes for indication_tester.py:
>
> Move #! interpreter line to top (otherwise it is ignored).
> Add usage message that includes mandatory argument.
> Exit cleanly with error message when mandatory arg missing.
> Fix default namespace in indication tester to root/virt.
> Use OptionParser's way to specify defaults.
> Remove itest.c
>
I'm not familiar with indication_tester.py, but these changes look
sound. +1
--
Kaitlin Rupert
IBM Linux Technology Center
karupert at us.ibm.com
From danms at us.ibm.com Thu Dec 6 16:40:00 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:40:00 -0700
Subject: [Libvirt-cim] [PATCH 0 of 3] Add automated base schema installation
Message-ID:
This set adds support for automated base schema installation. This will be handy for users of the source tree, as well as required for proper installation via RPM. I have only tested with Pegasus, so sfcb testing would be appreciated.
The first patch adds the schema patch and interop mof.
The second adds the installation script.
The third makes the required changes to the build system to fetch the CIM schema zip during build.
Testing can be easily accomplished by running "make preinstall" after building. Testing of the whole process as part of the RPM install would be good too.
For Pegasus, remove the entire /var/lib/Pegasus/repository/root#virt directory before testing. For SFCB, removing /usr/local/share/sfcb/CIM/* should be sufficient. After preinstall, make sure postinstall works and that the providers load and work.
/
From danms at us.ibm.com Thu Dec 6 16:40:02 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:40:02 -0700
Subject: [Libvirt-cim] [PATCH 2 of 3] Add base schema installation script
In-Reply-To:
Message-ID:
# HG changeset patch
# User Dan Smith
# Date 1196962499 28800
# Node ID f19a5921a4996f3babd6ab3d4cd5b4c523da2bfd
# Parent 0fd998389d0260fd54af8c7b9005f5a0fc402b4d
Add base schema installation script
Signed-off-by: Dan Smith
diff -r 0fd998389d02 -r f19a5921a499 base_schema/install_base_schema.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_schema/install_base_schema.sh Thu Dec 06 09:34:59 2007 -0800
@@ -0,0 +1,89 @@
+#!/bin/bash -x
+
+DATA="$1"
+NS=root/virt
+CIMOM=pegasus
+
+TMPDIR=$(mktemp -d /tmp/cim_schema.XXXXX)
+
+unpack_schema() {
+ (cd ${TMPDIR} && unzip ${DATA}/cimv*-MOFs.zip) >/dev/null 2>&1
+}
+
+fix_schema() {
+ (cd ${TMPDIR} && patch -p0 < ${DATA}/fix_schema.patch) >/dev/null 2>&1
+ cp -a ${DATA}/cimv216-interop.mof ${TMPDIR}
+}
+
+detect_peg_repo() {
+ dirs="$PEGASUS_HOME /var/lib/Pegasus /var/lib/pegasus /usr/local/var/lib/pegasus /var/local/lib/pegasus /var/opt/tog-pegasus"
+
+ for d in $dirs; do
+ if [ -d "$d" ]; then
+ echo $d
+ return
+ fi
+ done
+}
+
+detect_sfcb_dir() {
+ dirs="SFCB_DIR /usr/local/share/sfcb /usr/share/sfcb"
+
+ for d in $dirs; do
+ if [ -d "$d" ]; then
+ echo $d;
+ return
+ fi
+ done
+}
+
+install_schema_pegasus() {
+ local repo=$(detect_peg_repo)
+
+ if [ -z "$repo" ]; then
+ echo "Unable to determine Pegasus repository path"
+ echo "set PEGASUS_HOME"
+ return
+ fi
+
+ cd ${TMPDIR}
+
+ cimmofl -uc -aEV -R$repo -n $NS cimv*.mof
+ cimmofl -uc -aEV -R$repo -n $NS qualifiers.mof
+ cimmofl -uc -aEV -R$repo -n $NS qualifiers_optional.mof
+ cimmofl -uc -aEV -R$repo -n /root/interop cimv*-interop.mof
+}
+
+install_schema_sfcb() {
+ local dir=$(detect_sfcb_dir)
+
+ if [ ! mkdir ${dir}/CIM ]; then
+ echo "Unable to determine SFCB directory"
+ echo "set SFCB_DIR"
+ return
+ fi
+
+ mv ${TMPDIR}/cimv*.mof ${TMPDIR}/CIM_Schema.mof
+ cp -ra ${TMPDIR}/* ${dir}
+ sfcbrepos
+}
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 [source_dir]"
+ exit 1
+fi
+
+(unpack_schema)
+(fix_schema)
+
+case "$CIMOM" in
+ sfcb)
+ (install_schema_sfcb)
+ ;;
+ pegasus)
+ (install_schema_pegasus)
+ ;;
+ *)
+ echo ERROR: Unknown CIMOM: $CIMOM
+ ;;
+esac
From danms at us.ibm.com Thu Dec 6 16:40:03 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:40:03 -0700
Subject: [Libvirt-cim] [PATCH 3 of 3] Build support for base schema
installation
In-Reply-To:
Message-ID: <81aecd2d6a83cacf8e93.1196962803@theine>
# HG changeset patch
# User Dan Smith
# Date 1196962511 28800
# Node ID 81aecd2d6a83cacf8e939b3777fd159cb421ba3f
# Parent f19a5921a4996f3babd6ab3d4cd5b4c523da2bfd
Build support for base schema installation
Signed-off-by: Dan Smith
diff -r f19a5921a499 -r 81aecd2d6a83 Makefile.am
--- a/Makefile.am Thu Dec 06 09:34:59 2007 -0800
+++ b/Makefile.am Thu Dec 06 09:35:11 2007 -0800
@@ -1,5 +1,5 @@
# Copyright IBM Corp. 2007
-SUBDIRS = libxkutil src doc
+SUBDIRS = libxkutil src doc base_schema
MOFS = \
schema/ComputerSystem.mof \
@@ -89,6 +89,9 @@ EXTRA_DIST = schema $(pkgdata_DATA) $(pk
libvirt-cim.spec.in libvirt-cim.spec \
doc/CodingStyle doc/SubmittingPatches
+preinstall:
+ sh -x base_schema/install_base_schema.sh `pwd`/base_schema
+
# Un/Register the providers and class definitions from/to the current CIMOM.
# @CIMSERVER@ is set by the configure script
postinstall:
diff -r f19a5921a499 -r 81aecd2d6a83 base_schema/Makefile.am
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_schema/Makefile.am Thu Dec 06 09:35:11 2007 -0800
@@ -0,0 +1,9 @@
+CIM_SCHEMA_VER = 216
+CIM_SCHEMA_REL = $(CIM_SCHEMA_VER)Experimental
+CIM_SCHEMA_ZIP = cimv$(CIM_SCHEMA_REL)-MOFs.zip
+
+dist_pkgdata_DATA = $(CIM_SCHEMA_ZIP) fix_schema.patch cimv216-interop.mof
+dist_pkgdata_SCRIPTS = install_base_schema.sh
+
+$(CIM_SCHEMA_ZIP):
+ wget http://www.dmtf.org/standards/cim/cim_schema_v$(CIM_SCHEMA_VER)/$(CIM_SCHEMA_ZIP)
\ No newline at end of file
diff -r f19a5921a499 -r 81aecd2d6a83 configure.ac
--- a/configure.ac Thu Dec 06 09:34:59 2007 -0800
+++ b/configure.ac Thu Dec 06 09:35:11 2007 -0800
@@ -87,6 +87,8 @@ AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bi
# Autogenerate the Makefile
AC_CONFIG_FILES([
+ base_schema/install_base_schema.sh
+ base_schema/Makefile
libxkutil/Makefile
libxkutil/tests/Makefile
src/Makefile
diff -r f19a5921a499 -r 81aecd2d6a83 libvirt-cim.spec.in
--- a/libvirt-cim.spec.in Thu Dec 06 09:34:59 2007 -0800
+++ b/libvirt-cim.spec.in Thu Dec 06 09:35:11 2007 -0800
@@ -55,6 +55,8 @@ rm -fr $RPM_BUILD_ROOT
%post
/sbin/ldconfig
+%{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name}
+
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n /@CIM_VIRT_NS@ \
-r %{REGISTRATION} -m %{SCHEMA} || true
@@ -77,6 +79,8 @@ rm -fr $RPM_BUILD_ROOT
%{_datadir}/libvirt-cim/*.sh
%{_datadir}/libvirt-cim/*.mof
%{_datadir}/libvirt-cim/*.registration
+%{_datadir}/libvirt-cim/fix_schema.patch
+%{_datadir}/libvirt-cim/cimv*-MOFs.zip
%changelog
* Fri Oct 26 2007 Daniel Veillard - 0.1-1
From danms at us.ibm.com Thu Dec 6 16:40:01 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:40:01 -0700
Subject: [Libvirt-cim] [PATCH 1 of 3] Add base schema support files for
automated installation
In-Reply-To:
Message-ID: <0fd998389d0260fd54af.1196962801@theine>
# HG changeset patch
# User Dan Smith
# Date 1196962461 28800
# Node ID 0fd998389d0260fd54af8c7b9005f5a0fc402b4d
# Parent 84aa3e272c6d8195ce07dd3a54bc8743fd771945
Add base schema support files for automated installation
Signed-off-by: Dan Smith
diff -r 84aa3e272c6d -r 0fd998389d02 base_schema/cimv216-interop.mof
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_schema/cimv216-interop.mof Thu Dec 06 09:34:21 2007 -0800
@@ -0,0 +1,15 @@
+#pragma locale ("en_US")
+#pragma include ("qualifiers.mof")
+#pragma include ("qualifiers_optional.mof")
+#pragma include ("Core/CIM_ManagedElement.mof")
+#pragma include ("Core/CIM_ManagedSystemElement.mof")
+#pragma include ("Core/CIM_LogicalElement.mof")
+#pragma include ("Core/CIM_EnabledLogicalElement.mof")
+#pragma include ("Core/CIM_System.mof")
+#pragma include ("System/CIM_ComputerSystem.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")
diff -r 84aa3e272c6d -r 0fd998389d02 base_schema/fix_schema.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_schema/fix_schema.patch Thu Dec 06 09:34:21 2007 -0800
@@ -0,0 +1,22 @@
+--- cimv216.mof 2007-08-30 16:19:12.000000000 -0700
++++ cimv216-new.mof 2007-12-05 12:45:56.000000000 -0800
+@@ -505,7 +505,7 @@
+ #pragma include ("Policy/CIM_PolicySetValidityPeriod.mof")
+ #pragma include ("Policy/CIM_PublicPrivateKeyAuthentication.mof")
+ #pragma include ("Policy/CIM_SharedSecretAuthentication.mof")
+-#pragma include ("Security/CIM_SecurityIndication.mof")
++//#pragma include ("Security/CIM_SecurityIndication.mof")
+ #pragma include ("Support/PRS_Activity.mof")
+ #pragma include ("Support/PRS_ActivityResource.mof")
+ #pragma include ("Support/PRS_ActivityTransaction.mof")
+@@ -726,8 +726,8 @@
+ #pragma include ("Policy/CIM_PolicyActionStructure.mof")
+ #pragma include ("Policy/CIM_PolicyConditionInPolicyCondition.mof")
+ #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")
+ #pragma include ("Support/PRS_AdminAssociation.mof")
+ #pragma include ("Support/PRS_AdministrativeContact.mof")
From danms at us.ibm.com Thu Dec 6 17:48:25 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 09:48:25 -0800
Subject: [Libvirt-cim] [PATCH] Introduce generic
LIBVIRT_CIM_DEFAULT_MAKEREF macro
In-Reply-To: <618509ea5c6089678975.1196935614@localhost.localdomain> (Heidi
Eckhart's message of "Thu, 06 Dec 2007 11:06:54 +0200")
References: <618509ea5c6089678975.1196935614@localhost.localdomain>
Message-ID: <874pevaf4m.fsf@theine.beaverton.ibm.com>
HE> 14 files changed, 77 insertions(+), 321 deletions(-)
Can't argue with that!
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 Thu Dec 6 17:18:43 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 10:18:43 -0700
Subject: [Libvirt-cim] [PATCH] Fix missing InstanceID in
ResourcePoolConfigurationCapabilities
Message-ID: <25193cc30daf4db213e9.1196965123@theine>
# HG changeset patch
# User Dan Smith
# Date 1196965106 28800
# Node ID 25193cc30daf4db213e989ee04573b7765785405
# Parent ebc42d00406a9800662470bb47fe5196e34c99a3
Fix missing InstanceID in ResourcePoolConfigurationCapabilities
Signed-off-by: Dan Smith
diff -r ebc42d00406a -r 25193cc30daf src/Virt_ResourcePoolConfigurationCapabilities.c
--- a/src/Virt_ResourcePoolConfigurationCapabilities.c Thu Dec 06 10:15:15 2007 -0800
+++ b/src/Virt_ResourcePoolConfigurationCapabilities.c Thu Dec 06 10:18:26 2007 -0800
@@ -60,6 +60,9 @@ static CMPIStatus get_rpc_cap(const CMPI
if (inst == NULL)
return (CMPIStatus){CMPI_RC_ERR_FAILED, NULL};
+ CMSetProperty(inst, "InstanceID",
+ (CMPIValue *)"RPCC", CMPI_chars);
+
/* No method currently supported */
*_inst = inst;
From grendel at linux.vnet.ibm.com Thu Dec 6 19:03:32 2007
From: grendel at linux.vnet.ibm.com (Jay Gagnon)
Date: Thu, 06 Dec 2007 14:03:32 -0500
Subject: [Libvirt-cim] [PATCH] Rpm changes, per Fedora package review
process
In-Reply-To: <84aa3e272c6d8195ce07.1196962210@theine>
References: <84aa3e272c6d8195ce07.1196962210@theine>
Message-ID: <47584784.6040300@linux.vnet.ibm.com>
Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith
> # Date 1196962105 28800
> # Node ID 84aa3e272c6d8195ce07dd3a54bc8743fd771945
> # Parent 9645be7b079b882978e9ef636c128fef95967497
> Rpm changes, per Fedora package review process
>
> Signed-off-by: Dan Smith
>
>
>
Whatever Fedora, wants Fedora gets. I don't really know my way around
spec files, but nothing seems out of the ordinary here. Maybe Daniel
has an opinion?
--
-Jay
From danms at us.ibm.com Thu Dec 6 18:05:53 2007
From: danms at us.ibm.com (Dan Smith)
Date: Thu, 06 Dec 2007 11:05:53 -0700
Subject: [Libvirt-cim] [PATCH] [RFC] Cleanup libvirt checks in acinclude.m4
Message-ID: <3c54117986d7f346f42e.1196967953@theine>
# HG changeset patch
# User Dan Smith
# Date 1196967953 28800
# Node ID 3c54117986d7f346f42edd1fd3f0d2b90a1c68d7
# Parent 25193cc30daf4db213e989ee04573b7765785405
[RFC] Cleanup libvirt checks in acinclude.m4
This changes the existing (hard to follow, debug, and change) libvirt
detection code with the standard pkg-config method. This gives us an
easy version check, as well as access to the package-specified information
about CPPFLAGS and LDFLAGS. It also makes us obey the system package
search path.
This will require a change to any source file that includes libvirt.h,
to #include , which is the proper way anyway. If
people like this, I'll resubmit with the necessary changes.
Signed-off-by: Dan Smith
diff -r 25193cc30daf -r 3c54117986d7 acinclude.m4
--- a/acinclude.m4 Thu Dec 06 10:18:26 2007 -0800
+++ b/acinclude.m4 Thu Dec 06 11:05:53 2007 -0800
@@ -325,39 +325,10 @@ AC_DEFUN([_CHECK_LIBVIRT],
AC_DEFUN([CHECK_LIBVIRT],
[
- AC_MSG_CHECKING(for libvirt package)
- LIBVIRT_CPP_FLAGS="$CPPFLAGS"
- dnl The standard include paths worked.
- _CHECK_LIBVIRT(standard)
- if test x"$LIBVIRTDIR" == x ; then
- _DIRS_="/usr/include/libvirt \
- /usr/local/include/libvirt"
- else
- _DIRS_="$LIBVIRTDIR/include/libvirt"
- fi
- for _DIR_ in $_DIRS_
- do
- _cppflags=$CPPFLAGS
- _include_LIBVIRT="$_DIR_"
- CPPFLAGS="$CPPFLAGS -I$_include_LIBVIRT"
- _CHECK_LIBVIRT($_DIR_)
- if test "$have_LIBVIRT" == "yes"; then
- dnl Found it
- AC_MSG_RESULT(yes)
- dnl Save the new -I parameter
- LIBVIRT_CPP_FLAGS="$CPPFLAGS"
- LIBLIBVIRT=-lvirt
- break
- fi
- CPPFLAGS=$_cppflags
- done
- CPPFLAGS=$LIBVIRT_CPP_FLAGS
- AC_SUBST(LIBLIBVIRT)
- if test "$have_LIBVIRT" == "no"; then
- AC_MSG_ERROR(no. The required libvirt package is missing.)
- fi
- ]
-)
+ PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.3.2])
+ CPPFLAGS="$CPPFLAGS $LIBVIRT_CFLAGS"
+ LDFLAGS="$LDFLAGS $LIBVIRT_LIBS"
+ ])
dnl
dnl The check for the SBLIM test suite
From heidieck at linux.vnet.ibm.com Fri Dec 7 12:52:34 2007
From: heidieck at linux.vnet.ibm.com (Heidi Eckhart)
Date: Fri, 07 Dec 2007 13:52:34 +0100
Subject: [Libvirt-cim] IMPORTANT: configure Pegasus with
"forceProviderProcesses=true"
In-Reply-To: <87fxyfx5gf.fsf@theine.beaverton.ibm.com>
References: <4757F37F.3030700@linux.vnet.ibm.com>
<87fxyfx5gf.fsf@theine.beaverton.ibm.com>
Message-ID: <47594212.9030209@linux.vnet.ibm.com>
Dan Smith wrote:
> HE> due to the changes made to the associations (registering the Virt_
> HE> provider for each subclass), it is now very important that Pegasus
> HE> is configured for "forceProviderProcesses=true". Otherwise only
> HE> strange things are happening ...
>
> Can you explain why you think this? I have
> forceProviderProcesses=false and I haven't noticed any weird behavior
> thus far (aside from the libvirt init race, which is still not fully
> resolved).
>
These are good news :).
> There's nothing about the std_association approach that should be any
> less thread-safe than the "conventional" approach, other than if
> Pegasus itself has issues with multiple calls into the broker at
> once. If this is the case, we should be able to work around it by
> preparing additional context objects as you do when you prepare a
> thread to run, or we could provide mutual exclusion at the
> std_association layer.
>
> Before I could be convinced that we've got a thread-safety issue, I
> would want to know what behavior you're seeing, and hear from someone
> familiar with the Pegasus internals on why what we're doing is not
> safe.
>
I was experiencing different behavior with Pegasus between setting
forceProviderProcesses to false or true. With set to false, a provider
request took around 5 seconds until a first output was printed out on
stdout (CU_DEBUG) and none of the association calls have been
successful. All request returned with "Handler not found" (CU_DEBUG),
which was really strange, as all request have been valid ones. With
forceProviderProcesses set to true this behavior disappeared. But after
some more extensively testing it returned and also occurred with this
setup :(.
So if no one else noticed such strange things, its more reasonable that
something in my local machine setup is completely broken. I will
investigate further into it and hopefully find some explanation for it.
Thank you for your feedback. I'm extremely happy to hear, that you
haven't encountered similar issues.
--
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 Dec 7 14:32:14 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 07 Dec 2007 06:32:14 -0800
Subject: [Libvirt-cim] IMPORTANT: configure Pegasus with
"forceProviderProcesses=true"
In-Reply-To: <47594212.9030209@linux.vnet.ibm.com> (Heidi Eckhart's message of
"Fri, 07 Dec 2007 13:52:34 +0100")
References: <4757F37F.3030700@linux.vnet.ibm.com>
<87fxyfx5gf.fsf@theine.beaverton.ibm.com>
<47594212.9030209@linux.vnet.ibm.com>
Message-ID: <87ejdymv81.fsf@theine.beaverton.ibm.com>
HE> I was experiencing different behavior with Pegasus between setting
HE> forceProviderProcesses to false or true. With set to false, a
HE> provider request took around 5 seconds until a first output was
HE> printed out on stdout (CU_DEBUG)
I am *definitely* not seeing that kind of behavior :)
HE> and none of the association calls have been successful. All
HE> request returned with "Handler not found" (CU_DEBUG), which was
HE> really strange, as all request have been valid ones.
Actually, both Zhengang and I have seen this behavior, but it was
related to all of the association and registration changes that have
been flying around recently. A full preuninstall, uninstall, restart
the CIMOM, build, install, postinstall, restart CIMOM seemed to clear
it up for both of us right away. I'm guessing that Pegasus may have
been caching some stale information somewhere.
Let us know if the above procedure clears things up.
I might also point out that we still appear to have a bit of a libvirt
initialization race when forceProviderProcesses=false. I had assumed
that Pegasus was loading the providers serially, which does not seem
to be the case. Thus, we will probably need to provide a mutex for
the thread case in the initialization routine.
--
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 Dec 7 17:01:04 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 07 Dec 2007 10:01:04 -0700
Subject: [Libvirt-cim] [PATCH 2 of 5] Change libcmpiutil check in configure
to use pkg-config
In-Reply-To:
Message-ID: <19fe21b48ba3b5841b80.1197050464@theine>
# HG changeset patch
# User Dan Smith
# Date 1196982077 28800
# Node ID 19fe21b48ba3b5841b80a3a6cccdefd6f3ea5e8d
# Parent 0a1c811ef3bdc9651166a6259562b7b95f4f7838
Change libcmpiutil check in configure to use pkg-config
Signed-off-by: Dan Smith
diff -r 0a1c811ef3bd -r 19fe21b48ba3 acinclude.m4
--- a/acinclude.m4 Thu Dec 06 11:52:09 2007 -0800
+++ b/acinclude.m4 Thu Dec 06 15:01:17 2007 -0800
@@ -259,43 +259,12 @@ AC_DEFUN([CHECK_LIBXML2],
]
)
-AC_DEFUN([_CHECK_LIBCU_PC],
- [
- if pkg-config --exists libcmpiutil; then
- CPPFLAGS="$CPPFLAGS `pkg-config --cflags libcmpiutil`"
- LDFLAGS="$LDFLAGS `pkg-config --libs libcmpiutil`"
- found_libcu=yes
- fi
- ]
-)
-
-AC_DEFUN([_CHECK_LIBCU_NOPC],
- [
- DIRS="/usr /usr/local"
- for dir in $DIRS; do
- if test -f "${dir}/include/libcmpiutil/libcmpiutil.h"; then
- CPPFLAGS="$CPPFLAGS -I${dir}/include/libcmpiutil"
- LDFLAGS="$LDFLAGS -lcmpiutil -L${dir}/lib"
- found_libcu=yes
- fi
- done
- ]
-)
-
AC_DEFUN([CHECK_LIBCU],
[
- _CHECK_LIBCU_PC
- if test "x$found_libcu" != "xyes"; then
- _CHECK_LIBCU_NOPC
- fi
- AC_CHECK_LIB(cmpiutil, cu_check_args, [], [
- AC_MSG_ERROR(libcmpiutil not found)
- ])
- AC_CHECK_HEADER([libcmpiutil.h], [], [
- AC_MSG_ERROR([libcmpiutil.h not found])
- ])
- ]
-)
+ PKG_CHECK_MODULES([LIBCU], [libcmpiutil >= 0.1])
+ CPPFLAGS="$CPPFLAGS $LIBCU_CFLAGS"
+ LDFLAGS="$LDFLAGS $LIBCU_LIBS"
+ ])
AC_DEFUN([CHECK_LIBVIRT],
[
From danms at us.ibm.com Fri Dec 7 17:01:05 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 07 Dec 2007 10:01:05 -0700
Subject: [Libvirt-cim] [PATCH 3 of 5] Make libxml2 check use pkg-config as
well
In-Reply-To:
Message-ID:
# HG changeset patch
# User Dan Smith
# Date 1196982080 28800
# Node ID d54e71e6c9e2729d8ce7a5074a1ac50dc0dddb40
# Parent 19fe21b48ba3b5841b80a3a6cccdefd6f3ea5e8d
Make libxml2 check use pkg-config as well
Signed-off-by: Dan Smith
diff -r 19fe21b48ba3 -r d54e71e6c9e2 acinclude.m4
--- a/acinclude.m4 Thu Dec 06 15:01:17 2007 -0800
+++ b/acinclude.m4 Thu Dec 06 15:01:20 2007 -0800
@@ -221,43 +221,12 @@ AC_DEFUN([CHECK_CIMSERVER],
]
)
-dnl
-dnl The check for the libxml2 library
-dnl Sets the LIBXML2DIR variable
-dnl
-
-AC_DEFUN([_CHECK_LIBXML2],
-[
- AC_MSG_CHECKING($1)
- AC_TRY_LINK(
- [
- #include
- ],
- [
- xmlNodePtr nodeptr;
- ],
- [
- have_LIBXML2=yes
- dnl AC_MSG_RESULT(yes)
- ],
- [
- have_LIBXML2=no
- dnl AC_MSG_RESULT(no)
- ])
-])
-
AC_DEFUN([CHECK_LIBXML2],
[
- AC_MSG_CHECKING(for libxml2 package)
- CPPFLAGS="$CPPFLAGS `xml2-config --cflags` "
- LDFLAGS="$LDFLAGS `xml2-config --libs` "
- dnl The standard include paths worked.
- _CHECK_LIBXML2(standard)
- if test "$have_LIBXML2" == "no"; then
- AC_MSG_ERROR(no. The required libxml2 package is missing.)
- fi
- ]
-)
+ PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
+ CPPFLAGS="$CPPFLAGS $LIBXML_CFLAGS"
+ LDFLAGS="$LDFLAGS $LIBXML_LDFLAGS"
+ ])
AC_DEFUN([CHECK_LIBCU],
[
From danms at us.ibm.com Fri Dec 7 17:01:03 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 07 Dec 2007 10:01:03 -0700
Subject: [Libvirt-cim] [PATCH 1 of 5] [RFC] Cleanup libvirt checks in
acinclude.m4
In-Reply-To:
Message-ID: <0a1c811ef3bdc9651166.1197050463@theine>
# HG changeset patch
# User Dan Smith
# Date 1196970729 28800
# Node ID 0a1c811ef3bdc9651166a6259562b7b95f4f7838
# Parent 25193cc30daf4db213e989ee04573b7765785405
[RFC] Cleanup libvirt checks in acinclude.m4
This changes the existing (hard to follow, debug, and change) libvirt
detection code with the standard pkg-config method. This gives us an
easy version check, as well as access to the package-specified information
about CPPFLAGS and LDFLAGS. It also makes us obey the system package
search path.
Signed-off-by: Dan Smith
diff -r 25193cc30daf -r 0a1c811ef3bd acinclude.m4
--- a/acinclude.m4 Thu Dec 06 10:18:26 2007 -0800
+++ b/acinclude.m4 Thu Dec 06 11:52:09 2007 -0800
@@ -297,67 +297,12 @@ AC_DEFUN([CHECK_LIBCU],
]
)
-dnl
-dnl The check for the libvirt library
-dnl Sets the LIBVIRTDIR variable
-dnl
-
-AC_DEFUN([_CHECK_LIBVIRT],
-[
- AC_MSG_CHECKING($1)
- AC_TRY_LINK(
- [
- #include
- #include
- ],
- [
- virConnectPtr connectPtr;
- ],
- [
- have_LIBVIRT=yes
- dnl AC_MSG_RESULT(yes)
- ],
- [
- have_LIBVIRT=no
- dnl AC_MSG_RESULT(no)
- ])
-])
-
AC_DEFUN([CHECK_LIBVIRT],
[
- AC_MSG_CHECKING(for libvirt package)
- LIBVIRT_CPP_FLAGS="$CPPFLAGS"
- dnl The standard include paths worked.
- _CHECK_LIBVIRT(standard)
- if test x"$LIBVIRTDIR" == x ; then
- _DIRS_="/usr/include/libvirt \
- /usr/local/include/libvirt"
- else
- _DIRS_="$LIBVIRTDIR/include/libvirt"
- fi
- for _DIR_ in $_DIRS_
- do
- _cppflags=$CPPFLAGS
- _include_LIBVIRT="$_DIR_"
- CPPFLAGS="$CPPFLAGS -I$_include_LIBVIRT"
- _CHECK_LIBVIRT($_DIR_)
- if test "$have_LIBVIRT" == "yes"; then
- dnl Found it
- AC_MSG_RESULT(yes)
- dnl Save the new -I parameter
- LIBVIRT_CPP_FLAGS="$CPPFLAGS"
- LIBLIBVIRT=-lvirt
- break
- fi
- CPPFLAGS=$_cppflags
- done
- CPPFLAGS=$LIBVIRT_CPP_FLAGS
- AC_SUBST(LIBLIBVIRT)
- if test "$have_LIBVIRT" == "no"; then
- AC_MSG_ERROR(no. The required libvirt package is missing.)
- fi
- ]
-)
+ PKG_CHECK_MODULES([LIBVIRT], [libvirt >= 0.3.2])
+ CPPFLAGS="$CPPFLAGS $LIBVIRT_CFLAGS"
+ LDFLAGS="$LDFLAGS $LIBVIRT_LIBS"
+ ])
dnl
dnl The check for the SBLIM test suite
diff -r 25193cc30daf -r 0a1c811ef3bd autoconfiscate.sh
--- a/autoconfiscate.sh Thu Dec 06 10:18:26 2007 -0800
+++ b/autoconfiscate.sh Thu Dec 06 11:52:09 2007 -0800
@@ -18,5 +18,3 @@ autoconf --force &&
autoconf --force &&
echo "You may now run ./configure"
-echo "You may now run ./configure LIBVIRTDIR=/usr/local"
-
diff -r 25193cc30daf -r 0a1c811ef3bd configure.ac
--- a/configure.ac Thu Dec 06 10:18:26 2007 -0800
+++ b/configure.ac Thu Dec 06 11:52:09 2007 -0800
@@ -31,7 +31,6 @@ AC_ARG_VAR([CIMSERVER],[the target CIM s
])
AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be install
ed.])
-AC_ARG_VAR([LIBVIRTDIR],[the directory where the libvirt package is installed.])
AC_ARG_VAR([TESTSUITEDIR],[the directory where the SBLIM testsuite is installed.
])
@@ -179,7 +178,6 @@ echo "The following configuration option
echo "The following configuration options have been selected:"
echo " CIMSERVER: " $CIMSERVER
echo " PROVIDERDIR: " $PROVIDERDIR
-echo " LIBVIRTDIR: " $LIBVIRTDIR
echo " TESTSUITE_SUPPORT: " $TESTSUITE_SUPPORT
if test x"$TESTSUITEDIR" != x; then
echo " TESTSUITEDIR: " $TESTSUITEDIR
From danms at us.ibm.com Fri Dec 7 17:01:02 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 07 Dec 2007 10:01:02 -0700
Subject: [Libvirt-cim] [PATCH 0 of 5] Build and configure cleanups
Message-ID:
This patch set started out as just a change to check for a new-enough
version of libvirt on the installed system. It evolved into cleaning up
a bunch of the package checks in aclocal.m4, a couple of configure
cleanups, and a bunch of changes #include statements to account for
changes in how we include package directories (which is correct, as of
this set, IMHO).
Comments and testing on a variety of platforms would be appreciated.
From danms at us.ibm.com Fri Dec 7 17:01:07 2007
From: danms at us.ibm.com (Dan Smith)
Date: Fri, 07 Dec 2007 10:01:07 -0700
Subject: [Libvirt-cim] [PATCH 5 of 5] Fixes to header includes for configure
changes
In-Reply-To:
Message-ID:
# HG changeset patch
# User Dan Smith
# Date 1196982085 28800
# Node ID b748848e59942b5c47e1a288ee9070306b138a89
# Parent 2b0424012e491d751198cd590b03fcf99c0d6978
Fixes to header includes for configure changes
Signed-off-by: Dan Smith
diff -r 2b0424012e49 -r b748848e5994 libxkutil/cs_util_instance.c
--- a/libxkutil/cs_util_instance.c Thu Dec 06 15:01:23 2007 -0800
+++ b/libxkutil/cs_util_instance.c Thu Dec 06 15:01:25 2007 -0800
@@ -31,7 +31,7 @@
#include
#include "cs_util.h"
-#include "libcmpiutil.h"
+#include
int get_domain_list(virConnectPtr conn, virDomainPtr **_list)
{
diff -r 2b0424012e49 -r b748848e5994 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Thu Dec 06 15:01:23 2007 -0800
+++ b/libxkutil/device_parsing.c Thu Dec 06 15:01:25 2007 -0800
@@ -28,7 +28,7 @@
#include
#include
-#include
+#include
#include "device_parsing.h"
#include "xmlgen.h"
diff -r 2b0424012e49 -r b748848e5994 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Thu Dec 06 15:01:23 2007 -0800
+++ b/libxkutil/misc_util.c Thu Dec 06 15:01:25 2007 -0800
@@ -32,8 +32,8 @@
#include "cmpift.h"
#include "cmpimacs.h"
-#include "libcmpiutil.h"
-#include "std_association.h"
+#include
+#include