[Libvirt-cim] [PATCH] Override CreateSnapshot extrinsic to include vendor-defined values

Jim Fehlig jfehlig at novell.com
Fri Aug 8 18:14:28 UTC 2008


# HG changeset patch
# User Jim Fehlig <jfehlig at novell.com>
# Date 1218219221 21600
# Node ID 5db4666a13d97ef7b64837f3b9de20fb712e927f
# Parent  f1a672f33772c5a6314f1d5a5fd0f701b1564673
Override CreateSnapshot extrinsic to include vendor-defined values

Some tools will parse the class info and format gui based on qualifiers
it finds.  In the case of CreateSnapshot, such tools will not display
the vendor additions unless the method is overridden to describe the
additions.

This patch introduces a new class Virt_VirtualSystemSnapshotService
where CreateSnapshot is overridden.  The various virtualizer flavors
then inherit from that.

     Signed-off-by: Jim Fehlig <jfehlig at novell.com>

diff -r f1a672f33772 -r 5db4666a13d9 schema/VirtualSystemSnapshotService.mof
--- a/schema/VirtualSystemSnapshotService.mof	Wed Aug 06 21:35:12 2008 -0600
+++ b/schema/VirtualSystemSnapshotService.mof	Fri Aug 08 12:13:41 2008 -0600
@@ -1,8 +1,59 @@
 // Copyright IBM Corp. 2008
 
-[Description ( "Snapshot types are as follows: "
-	       "32768: Memory-only snapshot (suspend, resume, keep image)"
-	       "32769: Memory-only, terminal (domain is offline after op)")]
-class Xen_VirtualSystemSnapshotService : CIM_VirtualSystemSnapshotService { };
-class KVM_VirtualSystemSnapshotService : CIM_VirtualSystemSnapshotService { };
-class LXC_VirtualSystemSnapshotService : CIM_VirtualSystemSnapshotService { };
+[Description (
+       "Service to create, apply and destroy snapshots of virtual systems."
+        )]
+class Virt_VirtualSystemSnapshotService: CIM_VirtualSystemSnapshotService {
+      [Override, Description ( "Creates a snapshot of a virtual system." ),
+       ValueMap { "0", "1", "2", "3", "4", "5", "6", "..", "4096",
+          "4097..32767", "32768..65535" },
+       Values { "Completed with No Error", "Not Supported",
+          "Failed", "Timeout", "Invalid Parameter", "Invalid State",
+          "Invalid Type", "DMTF Reserved",
+          "Method Parameters Checked - Job Started",
+          "Method Reserved", "Vendor Specific" }]
+   uint32 CreateSnapshot(
+         [In, Description (
+             "Reference to the affected virtual system." )]
+      CIM_ComputerSystem REF AffectedSystem,
+         [In, Description ( "Parameter settings." ),
+          EmbeddedInstance ( "CIM_SettingData" )]
+      string SnapshotSettings,
+         [In, Description (
+             "Requested snapshot type:\n"
+             "Full Snapshot: Complete snapshot of the virtual system.\n"
+             "Disk Snapshot: Snapshot of virtual system disks.\n"
+             "Memory Snapshot: Snapshot of virtual system memory only. "
+             "The virtual system remains active after memory snapshot "
+             "is complete.\n"
+             "Memory Snapshot Terminal: Snapshot of virtual system "
+             "memory only.  The virtual system is transitioned to "
+             "disabled state after the memory snapshot is complete.\n" ),
+          ValueMap { "2", "3", "..", "32768", "32769", "32770..65535" },
+          Values { "Full Snapshot", "Disk Snapshot",
+             "DMTF Reserved", "Memory Snapshot", "Memory Snapshot Terminal",
+             "Vendor Specific" },
+          ModelCorrespondence {
+             "CIM_VirtualSystemSnapshotCapabilities.SnapshotTypesEnabled",
+             "CIM_VirtualSystemSnapshotServiceCapabilities.SnapshotTypesSupported" }]
+      uint16 SnapshotType,
+         [In, Out, Description (
+             "Resulting virtual system snapshot" )]
+      CIM_VirtualSystemSettingData REF ResultingSnapshot,
+         [In, Out, Description (
+             "If the operation is long running, then optionally "
+             "a job may be returned. In this case, the instance "
+             "of the CIM_VirtualSystemSettingData class "
+             "representing the new virtual system snapshot is "
+             "presented via the CIM_AffectedJobElement "
+             "association with the value of the AffectedElement "
+             "property referring to the new instance of the "
+             "CIM_VirtualSystemSettingData class representing "
+             "the virtual system snapshot and and the value of "
+             "the ElementEffects set to 5 (Create)." )]
+      CIM_ConcreteJob REF Job);
+};
+
+class Xen_VirtualSystemSnapshotService : Virt_VirtualSystemSnapshotService { };
+class KVM_VirtualSystemSnapshotService : Virt_VirtualSystemSnapshotService { };
+class LXC_VirtualSystemSnapshotService : Virt_VirtualSystemSnapshotService { };




More information about the Libvirt-cim mailing list