[Libvirt-cim] [PATCH] Return VSSD reference from CreateSnapshot

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon May 11 23:05:53 UTC 2009


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1241805181 25200
# Node ID a8438f4413a007f0ae427072d1c9a603cc911341
# Parent  9a16c7a7963cebddd145212e57ccc9defa5e0a0c
Return VSSD reference from CreateSnapshot

This method has two outputs - Job and ResultingSnapshot.  The provider was
returning a value for ResultingSnapshot.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 9a16c7a7963c -r a8438f4413a0 src/Makefile.am
--- a/src/Makefile.am	Fri May 08 10:53:01 2009 -0700
+++ b/src/Makefile.am	Fri May 08 10:53:01 2009 -0700
@@ -197,9 +197,9 @@
 
 libVirt_VSMigrationSettingData_la_SOURCES = Virt_VSMigrationSettingData.c
 
-libVirt_VirtualSystemSnapshotService_la_DEPENDENCIES = libVirt_HostSystem.la
+libVirt_VirtualSystemSnapshotService_la_DEPENDENCIES = libVirt_HostSystem.la libVirt_VSSD.la
 libVirt_VirtualSystemSnapshotService_la_SOURCES = Virt_VirtualSystemSnapshotService.c
-libVirt_VirtualSystemSnapshotService_la_LIBADD = -lVirt_HostSystem
+libVirt_VirtualSystemSnapshotService_la_LIBADD = -lVirt_HostSystem -lVirt_VSSD
 
 libVirt_VirtualSystemSnapshotServiceCapabilities_la_DEPENDENCIES = 
 libVirt_VirtualSystemSnapshotServiceCapabilities_la_SOURCES = Virt_VirtualSystemSnapshotServiceCapabilities.c
diff -r 9a16c7a7963c -r a8438f4413a0 src/Virt_VirtualSystemSnapshotService.c
--- a/src/Virt_VirtualSystemSnapshotService.c	Fri May 08 10:53:01 2009 -0700
+++ b/src/Virt_VirtualSystemSnapshotService.c	Fri May 08 10:53:01 2009 -0700
@@ -38,6 +38,7 @@
 
 #include "Virt_VirtualSystemSnapshotService.h"
 #include "Virt_HostSystem.h"
+#include "Virt_VSSD.h"
 
 #define CIM_JOBSTATE_STARTING 3
 #define CIM_JOBSTATE_RUNNING 4
@@ -388,6 +389,8 @@
         struct snap_context *ctx;
         CMPIStatus s;
         CMPIObjectPath *job;
+        CMPIObjectPath *vssd;
+        CMPIInstance *inst;
 
         ctx = new_context(name, &s);
         if (ctx == NULL) {
@@ -401,7 +404,21 @@
         ctx->restore = (type != VIR_VSSS_SNAPSHOT_MEMT);
 
         s = create_job(context, ref, ctx, &job);
+
+        s = get_vssd_by_name(_BROKER, ref, name, &inst);
+        if (s.rc != CMPI_RC_OK) {
+                CU_DEBUG("Unable to get guest VSSD in start_snapshot_job()");
+                goto out;
+        }
+
+        vssd = CMGetObjectPath(inst, &s);
+        if (s.rc != CMPI_RC_OK) {
+                CU_DEBUG("Unable to get VSSD ref from instance");
+                goto out;
+        }
+
         CMAddArg(argsout, "Job", (CMPIValue *)&job, CMPI_ref);
+        CMAddArg(argsout, "ResultingSnapshot", (CMPIValue *)&vssd, CMPI_ref);
 
  out:
         return s;




More information about the Libvirt-cim mailing list