compiling/linking under debian/ubuntu
by Ancoron Luciferis
Hi *,
I'm currently trying to figure out how to build and install libvirt-cim
on one of my Ubuntu boxes.
I have all requirements met but during 'make install' I get this:
/usr/bin/ld: cannot find -lVirt_VirtualSystemSnapshotService
collect2: ld returned 1 exit status
libtool: install: error: relink `libVirt_ComputerSystem.la' with the
above command before installing it
make[3]: *** [install-providerLTLIBRARIES] Error 1
Well, the mentioned library is there:
src/.libs/libVirt_VirtualSystemSnapshotService.a
src/.libs/libVirt_VirtualSystemSnapshotService.la
src/.libs/libVirt_VirtualSystemSnapshotService.lai
src/.libs/libVirt_VirtualSystemSnapshotService.so
src/.libs/libVirt_VirtualSystemSnapshotService.so.0
src/.libs/libVirt_VirtualSystemSnapshotService.so.0.0.0
Could someone help me with that as I'm not that familiar with the
details of shared library linking yet.
I attached a full output of:
make preinstall
make
sudo make install
Thanx in advance,
Ancoron
13 years, 8 months
[PATCH] Fix to support domain name with space
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1292363991 28800
# Node ID 35396e5b805193c024b6d4f065136d7b57a0b03d
# Parent 8c322e30cabbf9e62cbae06e5566fc1662ad539c
Fix to support domain name with space.
Libvirt-cim was failing to correctly parse domain names that had whitespace in between.
For example, domain "test domain", would get parsed as just "test".
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r 8c322e30cabb -r 35396e5b8051 libxkutil/misc_util.c
--- a/libxkutil/misc_util.c Wed Dec 08 12:20:26 2010 -0800
+++ b/libxkutil/misc_util.c Tue Dec 14 13:59:51 2010 -0800
@@ -448,7 +448,7 @@
char *tmp_pfx = NULL;
char *tmp_name = NULL;
- ret = sscanf(id, "%a[^:]:%as", &tmp_pfx, &tmp_name);
+ ret = sscanf(id, "%a[^:]:%a[^\n]", &tmp_pfx, &tmp_name);
if (ret != 2) {
ret = 0;
goto out;
13 years, 9 months
Re: [Libvirt-cim] dormant vs suspended operating status
by Sharad Mishra
Hi,
Libvirt-cim marks a VM suspended if it is either shutoff
(VIR_DOMAIN_SHUTOFF) or crashed (VIR_DOMAIN_CRASHED) and a snapshot image
is saved. A domain is marked dormant when it is blocked
(VIR_DOMAIN_BLOCKED) or paused (VIR_DOMAIN_PAUSED).
Regards,
Sharad Mishra
> -------- Original Message --------
> Subject: [Libvirt-cim] dormant vs suspended operating status
> Date: Fri, 24 Sep 2010 16:10:35 -0500
> From: Yee Ja <yja(a)us.ibm.com>
> Reply-To: List for discussion and development of libvirt CIM
> <libvirt-cim(a)redhat.com>
> To: libvirt-cim(a)redhat.com
>
>
>
> For KVM, is there any difference between a virtual machine with an
> operating status of dormant vs suspended, in terms of what functionality
> is available to run against the virtual machine? It seems as if dormant
> is the same as suspended, but I haven't read any documentation which
> specifically indicates such....
>
> Thanks
>
>
> --
> Chip Vincent
> Open Virtualization, Linux Technology Center
> IBM Systems & Technology Group
> phone: 919-254-4482, T/L 444-4482
> email: cvincent(a)us.ibm.com
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
13 years, 9 months
[PATCH] Patch to allow cdrom media change
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1291839626 28800
# Node ID b52f1a92d324cb63a942e56ea99c6984c043e2a8
# Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab
Patch to allow cdrom media change.
This patch allows VMs with cdrom to change media from one iso to another.
This is equivalent to virsh command "virsh attach-disk <vm> <path to iso file> hdc --type cdrom --mode readonly
--driver file"
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r e82f482d4bd2 -r b52f1a92d324 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c Tue Nov 30 13:33:45 2010 -0500
+++ b/libxkutil/device_parsing.c Wed Dec 08 12:20:26 2010 -0800
@@ -1179,6 +1179,28 @@
}
+static int change_disk(virDomainPtr dom,
+ struct virt_device *dev)
+{
+
+ char *xml = NULL;
+ int ret = 0;
+
+ xml = device_to_xml(dev);
+
+ CU_DEBUG("New XML is %s", xml);
+
+ if (virDomainAttachDevice(dom, xml) != 0) {
+ goto out;
+ }
+
+ ret = 1;
+ out:
+ free(xml);
+
+ return ret;
+}
+
static int change_memory(virDomainPtr dom,
struct virt_device *dev)
{
@@ -1246,8 +1268,10 @@
{
if (dev->type == CIM_RES_TYPE_MEM)
return change_memory(dom, dev);
- else if (dev->type == CIM_RES_TYPE_PROC)
+ if (dev->type == CIM_RES_TYPE_PROC)
return change_vcpus(dom, dev);
+ if (dev->type == CIM_RES_TYPE_DISK)
+ return change_disk(dom, dev) ;
CU_DEBUG("Unhandled device type %i", dev->type);
diff -r e82f482d4bd2 -r b52f1a92d324 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Tue Nov 30 13:33:45 2010 -0500
+++ b/src/Virt_VirtualSystemManagementService.c Wed Dec 08 12:20:26 2010 -0800
@@ -836,6 +836,7 @@
const char *val = NULL;
uint16_t type;
+ CU_DEBUG("Enter disk_rasd_to_vdev");
if (cu_get_str_prop(inst, "VirtualDevice", &val) != CMPI_RC_OK)
return "Missing `VirtualDevice' property";
@@ -863,6 +864,8 @@
dev->dev.disk.device = strdup("floppy");
else
return "Invalid value for EmulatedType";
+
+ CU_DEBUG("device type is %s", dev->dev.disk.device);
free(dev->dev.disk.bus_type);
if (cu_get_str_prop(inst, "BusType", &val) != CMPI_RC_OK)
@@ -1411,6 +1414,7 @@
virConnectPtr conn = NULL;
virDomainPtr dom = NULL;
+ CU_DEBUG("Enter update_dominfo");
if (dominfo->dev_vcpu_ct != 1) {
/* Right now, we only have extra info for processors */
CU_DEBUG("Domain has no vcpu devices!");
@@ -1444,10 +1448,12 @@
infostore_set_u64(ctx, "limit", dev->dev.vcpu.limit);
dev = dominfo->dev_graphics;
- if (dev->dev.graphics.passwd != NULL)
- infostore_set_bool(ctx, "has_vnc_passwd", true);
- else
- infostore_set_bool(ctx, "has_vnc_passwd", false);
+ if(dev != NULL){
+ if (dev->dev.graphics.passwd != NULL)
+ infostore_set_bool(ctx, "has_vnc_passwd", true);
+ else
+ infostore_set_bool(ctx, "has_vnc_passwd", false);
+ }
out:
infostore_close(ctx);
@@ -2068,6 +2074,7 @@
virDomainPtr dom;
int (*func)(virDomainPtr, struct virt_device *);
+ CU_DEBUG("Enter _resource_dynamic");
if (action == RESOURCE_ADD)
func = attach_device;
else if (action == RESOURCE_DEL)
@@ -2292,6 +2299,7 @@
int i;
const char *msg = NULL;
+ CU_DEBUG("Enter resource_mod");
if (devid == NULL) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_INVALID_PARAMETER,
@@ -2361,8 +2369,10 @@
const char *indication;
CMPIObjectPath *op;
struct inst_list list;
- CMPIInstance *prev_inst = NULL;
+ CMPIInstance *prev_inst = NULL;
+ CMPIInstance *orig_inst = NULL;
+ CU_DEBUG("Enter _update_resources_for");
inst_list_init(&list);
if (!get_dominfo(dom, &dominfo)) {
virt_set_status(_BROKER, &s,
@@ -2406,14 +2416,23 @@
dummy_name,
type,
NULL,
- &prev_inst);
+ &orig_inst);
free(dummy_name);
if (s.rc != CMPI_RC_OK) {
CU_DEBUG("Failed to get Previous Instance");
goto out;
}
- }
+
+ s = cu_merge_instances(rasd, orig_inst);
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Failed to merge Instances");
+ goto out;
+ }
+ prev_inst = orig_inst;
+ rasd = orig_inst;
+
+ }
s = func(dominfo, rasd, type, devid, NAMESPACE(ref));
if (s.rc != CMPI_RC_OK) {
@@ -2487,6 +2506,7 @@
int count;
uint32_t rc = CIM_SVPC_RETURN_FAILED;
+ CU_DEBUG("Enter _update_resource_settings");
conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
if (conn == NULL) {
cu_statusf(_BROKER, &s,
@@ -2731,6 +2751,7 @@
CMPIArray *res = NULL;
struct inst_list list;
+ CU_DEBUG("Enter mod_resource_settings");
inst_list_init(&list);
if (cu_get_array_arg(argsin, "ResourceSettings", &arr) != CMPI_RC_OK) {
13 years, 9 months
[PATCH] Add method to merge RASDs
by Sharad Mishra
# HG changeset patch
# User Sharad Mishra <snmishra(a)us.ibm.com>
# Date 1291841067 28800
# Node ID 531f151df659f030fe4fab1f6663572af356935f
# Parent f967d9432f317685981a5b8552f049a9b644a33f
Add method to merge RASDs.
This method will take two RASDs, src and dest, and merge the two into dest.
Signed-off-by: Sharad Mishra <snmishra(a)us.ibm.com>
diff -r f967d9432f31 -r 531f151df659 instance_util.c
--- a/instance_util.c Wed Oct 06 09:31:05 2010 -0700
+++ b/instance_util.c Wed Dec 08 12:44:27 2010 -0800
@@ -253,6 +253,46 @@
return dest;
}
+
+CMPIStatus cu_merge_instances(CMPIInstance *src,
+ CMPIInstance *dest)
+{
+
+ int i;
+ int prop_count;
+ CMPIData data;
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ CU_DEBUG("Merging instances");
+ prop_count = CMGetPropertyCount(src, &s);
+ if (s.rc != CMPI_RC_OK) {
+ CU_DEBUG("Could not get property count for merge");
+ goto out;
+ }
+
+ CU_DEBUG("Property count is %d", prop_count);
+ for (i = 0; i < prop_count; i++) {
+ CMPIString *prop;
+ const char *prop_name;
+
+ data = CMGetPropertyAt(src, i, &prop, &s);
+ if (s.rc != CMPI_RC_OK) {
+ goto out;
+ }
+
+ prop_name = CMGetCharPtr(prop);
+
+ if(data.state == 0 ) {
+ CU_DEBUG("setting prop %s", prop_name);
+ CMSetProperty(dest, prop_name,
+ &(data.value), data.type);
+ }
+ }
+
+ out:
+ return s;
+}
+
const char *cu_classname_from_inst(CMPIInstance *inst)
{
const char *ret = NULL;
diff -r f967d9432f31 -r 531f151df659 libcmpiutil.h
--- a/libcmpiutil.h Wed Oct 06 09:31:05 2010 -0700
+++ b/libcmpiutil.h Wed Dec 08 12:44:27 2010 -0800
@@ -167,6 +167,17 @@
uint16_t *target);
/**
+ * Merge src and dest instances to dest.
+ *
+ * @param src Source instance
+ * @param dest Destination instance
+ * @returns {CMPI_RC_OK, NULL} if success, CMPI_RC ERR_FAILED and
+ * error message otherwise
+ */
+CMPIStatus cu_merge_instances(CMPIInstance *src,
+ CMPIInstance *dest);
+
+/**
* Create a copy of an instance
*
* @param src Source instance
13 years, 9 months
[PATCH] Add domain UUID and timestamp ComputerSystem and MigrationJob indications
by Chip Vincent
# HG changeset patch
# User Chip Vincent <cvincent(a)us.ibm.com>
# Date 1291832982 18000
# Node ID 00c3b5396d9cd7c4396b8b72fdb09257a0328116
# Parent e82f482d4bd2eae19970f9b9a42caecaf46ebeab
Add domain UUID and timestamp to ComputerSystem and MigrationJob Indications
This patch allows clients to better correlate indications by domain and
enables
sequencing using the indication datetime.
Signed-off-by: Chip Vincent <cvincent(a)us.ibm.com>
diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_ComputerSystemIndication.c
--- a/src/Virt_ComputerSystemIndication.c Tue Nov 30 13:33:45 2010
-0500
+++ b/src/Virt_ComputerSystemIndication.c Wed Dec 08 13:29:42 2010
-0500
@@ -232,6 +232,8 @@
CMPIObjectPath *affected_op;
CMPIObjectPath *ind_op;
CMPIInstance *ind;
+ CMPIData uuid;
+ CMPIDateTime *timestamp;
CMPIStatus s;
bool ret = true;
@@ -278,7 +280,15 @@
}
CMSetNameSpace(affected_op, args->ns);
- if (ind_type == CS_MODIFIED) {
+ uuid = CMGetProperty(affected_inst, "UUID", &s);
+ CMSetProperty(ind, "IndicationIdentifier",
+ (CMPIValue *)&uuid, CMPI_string);
+
+ timestamp = CMNewDateTime(broker, &s);
+ CMSetProperty(ind, "IndicationTime",
+ (CMPIValue *)timestamp, CMPI_dateTime);
+
+ if (ind_type == CS_MODIFIED) {
CMSetProperty(ind, "PreviousInstance",
(CMPIValue *)&prev_inst, CMPI_instance);
}
diff -r e82f482d4bd2 -r 00c3b5396d9c src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c Tue Nov 30 13:33:45 2010 -0500
+++ b/src/Virt_VSMigrationService.c Wed Dec 08 13:29:42 2010 -0500
@@ -811,8 +811,11 @@
CMPIInstance *ind = NULL;
CMPIInstance *prev_inst = NULL;
const char *pfx = NULL;
-
- ind_name = ind_type_to_name(ind_type);
+ virDomainPtr dom = NULL;
+ char uuid[VIR_UUID_STRING_BUFLEN];
+ CMPIDateTime *timestamp = NULL;
+
+ ind_name = ind_type_to_name(ind_type);
CU_DEBUG("Creating indication.");
@@ -827,6 +830,24 @@
job->ref_ns, pfx, ind_name);
goto out;
}
+
+ dom = virDomainLookupByName(job->conn, job->domain);
+ if(dom == NULL) {
+ CU_DEBUG("Failed to connect to domain %s", job->domain);
+ goto out;
+ }
+
+ if(virDomainGetUUIDString(dom, uuid) != 0) {
+ CU_DEBUG("Failed to get UUID from domain name");
+ goto out;
+ }
+
+ CMSetProperty(ind, "IndicationIdentifier",
+ (CMPIValue *)uuid, CMPI_chars);
+
+ timestamp = CMNewDateTime(broker, s);
+ CMSetProperty(ind, "IndicationTime",
+ (CMPIValue *)timestamp, CMPI_dateTime);
if (ind_type == MIG_MODIFIED) {
/* Need to copy job inst before attaching as
PreviousInstance
@@ -844,6 +865,7 @@
}
out:
+ virDomainFree(dom);
return ind;
}
--
Chip Vincent
Open Virtualization, Linux Technology Center
IBM Systems & Technology Group
phone: 919-254-4482, T/L 444-4482
email: cvincent(a)us.ibm.com
13 years, 9 months