rpms/libvirt-cim/F-9 uuidbuflen.patch, NONE, 1.1 uuidcompare.patch, NONE, 1.1 libvirt-cim.spec, 1.16, 1.17 poolconf.patch, 1.1, NONE poolmember.patch, 1.1, NONE procfix.patch, 1.1, NONE rasdns.patch, 1.1, NONE vcpufix.patch, 1.1, NONE

Dan Smith (danms) fedora-extras-commits at redhat.com
Tue Aug 5 14:33:56 UTC 2008


Author: danms

Update of /cvs/pkgs/rpms/libvirt-cim/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1899

Modified Files:
	libvirt-cim.spec 
Added Files:
	uuidbuflen.patch uuidcompare.patch 
Removed Files:
	poolconf.patch poolmember.patch procfix.patch rasdns.patch 
	vcpufix.patch 
Log Message:
Add a few upstream bugfix patches


uuidbuflen.patch:

--- NEW FILE uuidbuflen.patch ---
# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1217870910 25200
# Node ID 3386917656ad569e226a846eea28793ecd852d0b
# Parent  fed521ebbf7d0b64a90036252f9e6c765d8b3105
Fix UUID string buffer length in a couple of spots

Thanks to Jim Fehlig for pointing this out.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r fed521ebbf7d -r 3386917656ad src/Virt_VSMigrationService.c
--- a/src/Virt_VSMigrationService.c	Thu Jul 31 07:25:33 2008 -0700
+++ b/src/Virt_VSMigrationService.c	Mon Aug 04 10:28:30 2008 -0700
@@ -78,7 +78,7 @@
         char *ref_ns;
         char *host;
         uint16_t type;
-        char uuid[33];
+        char uuid[VIR_UUID_STRING_BUFLEN];
 };
 
 static CMPIStatus get_msd(const CMPIObjectPath *ref,
diff -r fed521ebbf7d -r 3386917656ad src/Virt_VirtualSystemSnapshotService.c
--- a/src/Virt_VirtualSystemSnapshotService.c	Thu Jul 31 07:25:33 2008 -0700
+++ b/src/Virt_VirtualSystemSnapshotService.c	Mon Aug 04 10:28:30 2008 -0700
@@ -51,7 +51,7 @@
 struct snap_context {
         CMPIContext *context;
         char *domain;
-        char uuid[33];
+        char uuid[VIR_UUID_STRING_BUFLEN];
         char *save_path;
         char *ref_ns;
         char *ref_cn;

uuidcompare.patch:

--- NEW FILE uuidcompare.patch ---
# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1217871367 25200
# Node ID 91cffef5e2cbb19f956e2969aacfd3fdab0d30b7
# Parent  3386917656ad569e226a846eea28793ecd852d0b
Make infostore compare the UUID of the domain to the one stored in the
store file, and if different, ignore all the information therein.

This should make sure that if a domain is undefined and redefined with
the same name, using other libvirt tools, the settings previously persisted
by the providers will not be used for the new domain.

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r 3386917656ad -r 91cffef5e2cb libxkutil/infostore.c
--- a/libxkutil/infostore.c	Mon Aug 04 10:28:30 2008 -0700
+++ b/libxkutil/infostore.c	Mon Aug 04 10:36:07 2008 -0700
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 #include <sys/file.h>
+#include <string.h>
 
 #include <libvirt/libvirt.h>
 #include <libxml/parser.h>
@@ -164,7 +165,7 @@
         return size >= 0;
 }
 
-struct infostore_ctx *infostore_open(virDomainPtr dom)
+static struct infostore_ctx *_infostore_open(virDomainPtr dom)
 {
         struct infostore_ctx *isc;
         struct stat s;
@@ -228,6 +229,58 @@
         free(filename);
 
         return NULL;
+}
+
+static struct infostore_ctx *delete_and_open(virDomainPtr dom)
+{
+        char *filename = NULL;
+
+        filename = make_filename(dom);
+        if (filename == NULL) {
+                CU_DEBUG("Failed to make filename for domain");
+                return NULL;
+        }
+
+        if (unlink(filename) != 0) {
+                CU_DEBUG("Unable to delete %s: %m", filename);
+        } else {
+                CU_DEBUG("Deleted %s", filename);
+        }
+
+        free(filename);
+
+        return _infostore_open(dom);
+}
+
+struct infostore_ctx *infostore_open(virDomainPtr dom)
+{
+        struct infostore_ctx *isc;
+        char uuid[VIR_UUID_STRING_BUFLEN];
+        char *_uuid = NULL;
+
+        isc = _infostore_open(dom);
+        if (isc == NULL)
+                return NULL;
+
+        if (virDomainGetUUIDString(dom, uuid) != 0) {
+                CU_DEBUG("Failed to get UUID string for comparison");
+                infostore_close(isc);
+                isc = delete_and_open(dom);
+                return isc;
+        }
+
+        _uuid = infostore_get_str(isc, "uuid");
+        if (_uuid == NULL)
+                goto out;
+
+        if (!STREQ(uuid, _uuid)) {
+                infostore_close(isc);
+                isc = delete_and_open(dom);
+        }
+ out:
+        free(_uuid);
+        infostore_set_str(isc, "uuid", uuid);
+        return isc;
 }
 
 void infostore_close(struct infostore_ctx *ctx)


Index: libvirt-cim.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libvirt-cim/F-9/libvirt-cim.spec,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- libvirt-cim.spec	31 Jul 2008 21:57:21 -0000	1.16
+++ libvirt-cim.spec	5 Aug 2008 14:33:25 -0000	1.17
@@ -3,7 +3,7 @@
 Summary: A CIM provider for libvirt
 Name: libvirt-cim
 Version: 0.5.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: LGPLv2+
 Group: Development/Libraries
 Source: libvirt-cim-%{version}.tar.gz
@@ -18,6 +18,8 @@
 BuildRequires: libcmpiutil-devel
 BuildConflicts: sblim-cmpi-devel
 Patch0: parse.patch
+Patch1: uuidbuflen.patch
+Patch2: uuidcompare.patch
 
 %description
 Libvirt-cim is a CMPI CIM provider that implements the DMTF SVPC
@@ -30,6 +32,8 @@
 chmod -f -x src/* libxkutil/* schema/* README doc/* #base_schema/README*
 chmod +X src/* libxkutil/* schema/*
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %configure --disable-werror


--- poolconf.patch DELETED ---


--- poolmember.patch DELETED ---


--- procfix.patch DELETED ---


--- rasdns.patch DELETED ---


--- vcpufix.patch DELETED ---




More information about the fedora-extras-commits mailing list