[PATCH] * Added association Console Redirections Service <-> Console Redirection

# HG changeset patch # User Richard Maciel <richardm@br.ibm.com> # Date 1224700352 25200 # Node ID 35c5cab8577f353d4c4bbb7daf74fa667bcdc3cd # Parent ec6d265c6536f88a81c5336fa97028cffd6068ad * Added association Console Redirections Service <-> Console Redirection Service Capabilities into the ElementCapabilities.c file * Added ConsoleRedirectionServiceCapabilities.h to export the get_console_rs_caps function get_console_rs_caps is not static anymore * Added ConsoleRedirectionServiceCapabilities.h to export the get_console_rs_caps function * get_console_rs_caps is not static anymore * Fixed whitespace issues * Removed not useful CU_DEBUG calls from ElementCapabilities.c file Signed-off-by: Richard Maciel <richardm@br.ibm.com> diff -r ec6d265c6536 -r 35c5cab8577f src/Makefile.am --- a/src/Makefile.am Wed Oct 22 09:17:23 2008 -0700 +++ b/src/Makefile.am Wed Oct 22 11:32:32 2008 -0700 @@ -21,7 +21,8 @@ Virt_VirtualSystemSnapshotService.h \ Virt_VirtualSystemSnapshotServiceCapabilities.h \ Virt_VSMigrationSettingData.h \ - Virt_ConsoleRedirectionService.h + Virt_ConsoleRedirectionService.h \ + Virt_ConsoleRedirectionServiceCapabilities.h XKUADD = $(top_builddir)/libxkutil/libxkutil.la @@ -120,7 +121,7 @@ libVirt_AllocationCapabilities_la_SOURCES = Virt_AllocationCapabilities.c libVirt_AllocationCapabilities_la_LIBADD = -lVirt_DevicePool -libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la libVirt_VirtualSystemManagementService.la libVirt_VSMigrationService.la libVirt_DevicePool.la libVirt_AllocationCapabilities.la +libVirt_ElementCapabilities_la_DEPENDENCIES = libVirt_VirtualSystemManagementCapabilities.la libVirt_EnabledLogicalElementCapabilities.la libVirt_ComputerSystem.la libVirt_HostSystem.la libVirt_VSMigrationCapabilities.la libVirt_VirtualSystemManagementService.la libVirt_VSMigrationService.la libVirt_DevicePool.la libVirt_AllocationCapabilities.la libVirt_ConsoleRedirectionService.la libVirt_ConsoleRedirectionServiceCapabilities.la libVirt_ElementCapabilities_la_SOURCES = Virt_ElementCapabilities.c libVirt_ElementCapabilities_la_LIBADD = -lVirt_VirtualSystemManagementCapabilities \ -lVirt_EnabledLogicalElementCapabilities \ @@ -130,7 +131,9 @@ -lVirt_AllocationCapabilities \ -lVirt_VirtualSystemManagementService \ -lVirt_VSMigrationService \ - -lVirt_DevicePool + -lVirt_DevicePool \ + -lVirt_ConsoleRedirectionService \ + -lVirt_ConsoleRedirectionServiceCapabilities libVirt_SettingsDefineCapabilities_la_DEPENDENCIES = libVirt_RASD.la libVirt_DevicePool.la libVirt_VSMigrationCapabilities.la libVirt_VSMigrationSettingData.la libVirt_AllocationCapabilities.la libVirt_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c diff -r ec6d265c6536 -r 35c5cab8577f src/Virt_ConsoleRedirectionServiceCapabilities.c --- a/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 22 09:17:23 2008 -0700 +++ b/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 22 11:32:32 2008 -0700 @@ -32,6 +32,7 @@ #include "svpc_types.h" #include "Virt_ConsoleRedirectionService.h" +#include "Virt_ConsoleRedirectionServiceCapabilities.h" const static CMPIBroker *_BROKER; @@ -69,10 +70,10 @@ return s; } -static CMPIStatus get_console_rs_caps(const CMPIBroker *broker, - const CMPIObjectPath *ref, - CMPIInstance **_inst, - bool is_get_inst) +CMPIStatus get_console_rs_caps(const CMPIBroker *broker, + const CMPIObjectPath *ref, + CMPIInstance **_inst, + bool is_get_inst) { CMPIStatus s = {CMPI_RC_OK, NULL}; CMPIInstance *inst = NULL; diff -r ec6d265c6536 -r 35c5cab8577f src/Virt_ConsoleRedirectionServiceCapabilities.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Virt_ConsoleRedirectionServiceCapabilities.h Wed Oct 22 11:32:32 2008 -0700 @@ -0,0 +1,35 @@ +/* + * Copyright IBM Corp. 2008 + * + * Authors: + * Richard Maciel <richardm@br.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 + */ + +CMPIStatus get_console_rs_caps(const CMPIBroker *broker, + const CMPIObjectPath *ref, + CMPIInstance **_inst, + bool is_get_inst); + + /* + * Local Variables: + * mode: C + * c-set-style: "K&R" + * tab-width: 8 + * c-basic-offset: 8 + * indent-tabs-mode: nil + * End: + */ diff -r ec6d265c6536 -r 35c5cab8577f src/Virt_ElementCapabilities.c --- a/src/Virt_ElementCapabilities.c Wed Oct 22 09:17:23 2008 -0700 +++ b/src/Virt_ElementCapabilities.c Wed Oct 22 11:32:32 2008 -0700 @@ -41,6 +41,8 @@ #include "Virt_VSMigrationCapabilities.h" #include "Virt_AllocationCapabilities.h" #include "Virt_DevicePool.h" +#include "Virt_ConsoleRedirectionService.h" +#include "Virt_ConsoleRedirectionServiceCapabilities.h" #include "svpc_types.h" @@ -75,7 +77,13 @@ goto out; s = get_migration_service(ref, &_inst, _BROKER, context, false); - } else + } else if (STREQC(classname, "ConsoleRedirectionServiceCapabilities")) { + s = get_console_rs_caps(_BROKER, ref, &_inst, true); + if ((s.rc != CMPI_RC_OK) || (_inst == NULL)) + goto out; + + s = get_console_rs(ref, &_inst, _BROKER, context, false); + } else cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, "Not found"); @@ -113,6 +121,12 @@ goto out; s = get_migration_caps(ref, &_inst, _BROKER, false); + } else if (STREQC(classname, "ConsoleRedirectionService")) { + s = get_console_rs(ref, &_inst, _BROKER, context, true); + if ((s.rc != CMPI_RC_OK) || (_inst == NULL)) + goto out; + + s = get_console_rs_caps(_BROKER, ref, &_inst, false); } else cu_statusf(_BROKER, &s, CMPI_RC_ERR_NOT_FOUND, @@ -382,22 +396,28 @@ "Xen_HostSystem", "Xen_VirtualSystemManagementService", "Xen_VirtualSystemMigrationService", + "Xen_ConsoleRedirectionService", "KVM_HostSystem", "KVM_VirtualSystemManagementService", "KVM_VirtualSystemMigrationService", + "KVM_ConsoleRedirectionService", "LXC_HostSystem", "LXC_VirtualSystemManagementService", "LXC_VirtualSystemMigrationService", + "LXC_ConsoleRedirectionService", NULL }; static char *host_caps[] = { "Xen_VirtualSystemManagementCapabilities", "Xen_VirtualSystemMigrationCapabilities", + "Xen_ConsoleRedirectionServiceCapabilities", "KVM_VirtualSystemManagementCapabilities", "KVM_VirtualSystemMigrationCapabilities", + "KVM_ConsoleRedirectionServiceCapabilities", "LXC_VirtualSystemManagementCapabilities", "LXC_VirtualSystemMigrationCapabilities", + "LXC_ConsoleRedirectionServiceCapabilities", "Xen_AllocationCapabilities", "KVM_AllocationCapabilities", "LXC_AllocationCapabilities", @@ -437,6 +457,9 @@ "Xen_VirtualSystemMigrationService", "KVM_VirtualSystemMigrationService", "LXC_VirtualSystemMigrationService", + "Xen_ConsoleRedirectionService", + "KVM_ConsoleRedirectionService", + "LXC_ConsoleRedirectionService", NULL };

Richard Maciel wrote:
# HG changeset patch # User Richard Maciel <richardm@br.ibm.com> # Date 1224700352 25200 # Node ID 35c5cab8577f353d4c4bbb7daf74fa667bcdc3cd # Parent ec6d265c6536f88a81c5336fa97028cffd6068ad * Added association Console Redirections Service <-> Console Redirection Service Capabilities into the ElementCapabilities.c file
+1 -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com
participants (2)
-
Kaitlin Rupert
-
Richard Maciel