# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1201882406 18000
# Node ID 6d86529bbdce9eb68b26a7fc5339fd66a1f2fdd2
# Parent 2920e184226248f7885dd87a28e30eb1a90005c9
ComputerSystemMigrationIndication
Indication to keep clients up to date on CS migrations, along with relevant makefile and
schema work.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r 2920e1842262 -r 6d86529bbdce Makefile.am
--- a/Makefile.am Wed Jan 30 10:52:58 2008 -0800
+++ b/Makefile.am Fri Feb 01 11:13:26 2008 -0500
@@ -24,6 +24,7 @@ MOFS = \
schema/RegisteredProfile.mof \
schema/ElementConformsToProfile.mof \
schema/ComputerSystemIndication.mof \
+ schema/ComputerSystemMigrationIndication.mof \
schema/ResourceAllocationSettingData.mof \
schema/ResourcePoolConfigurationService.mof \
schema/ResourcePoolConfigurationCapabilities.mof \
@@ -65,6 +66,7 @@ REGS = \
schema/DiskPool.registration \
schema/HostedResourcePool.registration \
schema/ComputerSystemIndication.registration \
+ schema/ComputerSystemMigrationIndication.registration \
schema/ResourceAllocationSettingData.registration \
schema/ResourcePoolConfigurationService.registration \
schema/ResourcePoolConfigurationCapabilities.registration \
@@ -109,4 +111,4 @@ clean-local:
clean-local:
rm -f $(find . -name "*.orig")
rm -f $(find . -name "*.rej")
- rm -f $(find . -name "*~")
\ No newline at end of file
+ rm -f $(find . -name "*~")
diff -r 2920e1842262 -r 6d86529bbdce schema/ComputerSystemMigrationIndication.mof
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/ComputerSystemMigrationIndication.mof Fri Feb 01 11:13:26 2008 -0500
@@ -0,0 +1,15 @@
+// Copyright IBM Corp. 2007
+
+[Description ("Xen_ComputerSystem migration status"),
+ Provider("cmpi::Virt_ComputerSystemModificationIndication")
+]
+class Xen_ComputerSystemMigrationIndication : CIM_InstModification
+{
+};
+
+[Description ("KVM_ComputerSystem migration status"),
+ Provider("cmpi::Virt_ComputerSystemModificationIndication")
+]
+class KVM_ComputerSystemMigrationIndication : CIM_InstModification
+{
+};
diff -r 2920e1842262 -r 6d86529bbdce
schema/ComputerSystemMigrationIndication.registration
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/schema/ComputerSystemMigrationIndication.registration Fri Feb 01 11:13:26 2008
-0500
@@ -0,0 +1,4 @@
+# Copyright IBM Corp. 2007
+# Classname Namespace ProviderName ProviderModule ProviderTypes
+Xen_ComputerSystemMigrationIndication root/virt Virt_ComputerSystemMigrationIndication
Virt_ComputerSystemMigrationIndication indication method
+KVM_ComputerSystemMigrationIndication root/virt Virt_ComputerSystemMigrationIndication
Virt_ComputerSystemMigrationIndication indication method
diff -r 2920e1842262 -r 6d86529bbdce src/Makefile.am
--- a/src/Makefile.am Wed Jan 30 10:52:58 2008 -0800
+++ b/src/Makefile.am Fri Feb 01 11:13:26 2008 -0500
@@ -30,6 +30,7 @@ provider_LTLIBRARIES = libVirt_ComputerS
libVirt_Device.la \
libVirt_SystemDevice.la \
libVirt_ComputerSystemIndication.la \
+ libVirt_ComputerSystemMigrationIndication.la \
libVirt_RASD.la \
libVirt_HostSystem.la \
libVirt_VirtualSystemManagementService.la \
@@ -61,6 +62,10 @@ libVirt_ComputerSystemIndication_la_DEPE
libVirt_ComputerSystemIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la
libVirt_ComputerSystemIndication_la_SOURCES = Virt_ComputerSystemIndication.c
libVirt_ComputerSystemIndication_la_LIBADD = -lVirt_ComputerSystem -lpthread -lrt
+
+libVirt_ComputerSystemMigrationIndication_la_DEPENDENCIES = libVirt_ComputerSystem.la
+libVirt_ComputerSystemMigrationIndication_la_SOURCES =
Virt_ComputerSystemMigrationIndication.c
+libVirt_ComputerSystemMigrationIndication_la_LIBADD = -lVirt_ComputerSystem
libVirt_VirtualSystemManagementService_la_DEPENDENCIES = libVirt_ComputerSystem.la
libVirt_ComputerSystemIndication.la libVirt_RASD.la libVirt_HostSystem.la
libVirt_VirtualSystemManagementService_la_SOURCES =
Virt_VirtualSystemManagementService.c
diff -r 2920e1842262 -r 6d86529bbdce src/Virt_ComputerSystemMigrationIndication.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_ComputerSystemMigrationIndication.c Fri Feb 01 11:13:26 2008 -0500
@@ -0,0 +1,120 @@
+/*
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ * Dan Smith <danms(a)us.ibm.com>
+ *
+ * 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 <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include <cmpidt.h>
+#include <cmpift.h>
+#include <cmpimacs.h>
+
+#include <libvirt/libvirt.h>
+
+#include <libcmpiutil/libcmpiutil.h>
+#include <misc_util.h>
+#include <libcmpiutil/std_indication.h>
+#include <cs_util.h>
+
+#include "config.h"
+
+#include "Virt_ComputerSystem.h"
+
+static const CMPIBroker *_BROKER;
+
+#ifdef CMPI_EI_VOID
+# define _EI_RTYPE void
+# define _EI_RET() return
+#else
+# define _EI_RTYPE CMPIStatus
+# define _EI_RET() return (CMPIStatus){CMPI_RC_OK, NULL}
+#endif
+
+static CMPIStatus ActivateFilter(CMPIIndicationMI* mi,
+ const CMPIContext* ctx,
+ const CMPISelectExp* se,
+ const char *ns,
+ const CMPIObjectPath* op,
+ CMPIBoolean first)
+{
+ CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ return s;
+}
+
+static CMPIStatus DeActivateFilter(CMPIIndicationMI* mi,
+ const CMPIContext* ctx,
+ const CMPISelectExp* se,
+ const char *ns,
+ const CMPIObjectPath* op,
+ CMPIBoolean last)
+{
+ return (CMPIStatus){CMPI_RC_OK, NULL};
+}
+
+static _EI_RTYPE EnableIndications(CMPIIndicationMI* mi,
+ const CMPIContext *ctx)
+{
+ struct std_indication_ctx *_ctx;
+ _ctx = (struct std_indication_ctx *)mi->hdl;
+ _ctx->enabled = true;
+ CU_DEBUG("ComputerSystemModifiedIndication enabled");
+
+ _EI_RET();
+}
+
+static _EI_RTYPE DisableIndications(CMPIIndicationMI* mi,
+ const CMPIContext *ctx)
+{
+ struct std_indication_ctx *_ctx;
+ _ctx = (struct std_indication_ctx *)mi->hdl;
+ _ctx->enabled = false;
+ CU_DEBUG("ComputerSystemModifiedIndication disabled");
+
+ _EI_RET();
+}
+
+static struct std_indication_handler csi = {
+ .raise_fn = NULL,
+ .trigger_fn = NULL,
+};
+
+DEFAULT_IND_CLEANUP();
+DEFAULT_AF();
+DEFAULT_MP();
+
+STDI_IndicationMIStub(,
+ Virt_ComputerSystemMigrationIndication,
+ _BROKER,
+ libvirt_cim_init(),
+ &csi);
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-set-style: "K&R"
+ * tab-width: 8
+ * c-basic-offset: 8
+ * indent-tabs-mode: nil
+ * End:
+ */