
# HG changeset patch # User Jay Gagnon <grendel@linux.vnet.ibm.com> # Date 1202224717 18000 # Node ID fdce6fa993b5a9dce654b3e0cf527599f86b9f67 # Parent c2ff6825e25f513417f395ea334f4f7963f2729c (#2) ComputerSystemMigrationIndication Indication to keep clients up to date on CS migrations, along with relevant makefile and schema work. Changes from #1 to #2: Fix author field Signed-off-by: Jay Gagnon <grendel@linux.vnet.ibm.com> diff -r c2ff6825e25f -r fdce6fa993b5 Makefile.am --- a/Makefile.am Mon Feb 04 09:53:29 2008 -0800 +++ b/Makefile.am Tue Feb 05 10:18:37 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 c2ff6825e25f -r fdce6fa993b5 schema/ComputerSystemMigrationIndication.mof --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ComputerSystemMigrationIndication.mof Tue Feb 05 10:18:37 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 c2ff6825e25f -r fdce6fa993b5 schema/ComputerSystemMigrationIndication.registration --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schema/ComputerSystemMigrationIndication.registration Tue Feb 05 10:18:37 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 c2ff6825e25f -r fdce6fa993b5 src/Makefile.am --- a/src/Makefile.am Mon Feb 04 09:53:29 2008 -0800 +++ b/src/Makefile.am Tue Feb 05 10:18:37 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 c2ff6825e25f -r fdce6fa993b5 src/Virt_ComputerSystemMigrationIndication.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_ComputerSystemMigrationIndication.c Tue Feb 05 10:18:37 2008 -0500 @@ -0,0 +1,120 @@ +/* + * Copyright IBM Corp. 2007 + * + * Authors: + * Jay Gagnon <grendel@linux.vnet.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: + */