# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1224286653 25200
# Node ID b1da9a0f3b05f631aef5df5494c94fa57491e46d
# Parent f7b995404a9c6a4c55374155b9d6826ad6fb2f3a
* 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(a)br.ibm.com>
diff -r f7b995404a9c -r b1da9a0f3b05 src/Makefile.am
--- a/src/Makefile.am Mon Oct 06 08:37:42 2008 -0700
+++ b/src/Makefile.am Fri Oct 17 16:37:33 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
@@ -119,7 +120,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_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_ConsoleRedirectionService.la
libVirt_ConsoleRedirectionServiceCapabilities.la
libVirt_ElementCapabilities_la_SOURCES = Virt_ElementCapabilities.c
libVirt_ElementCapabilities_la_LIBADD = -lVirt_VirtualSystemManagementCapabilities \
-lVirt_EnabledLogicalElementCapabilities \
@@ -129,7 +130,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_SettingsDefineCapabilities_la_SOURCES = Virt_SettingsDefineCapabilities.c
diff -r f7b995404a9c -r b1da9a0f3b05 src/Virt_ConsoleRedirectionServiceCapabilities.c
--- a/src/Virt_ConsoleRedirectionServiceCapabilities.c Mon Oct 06 08:37:42 2008 -0700
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.c Fri Oct 17 16:37:33 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 f7b995404a9c -r b1da9a0f3b05 src/Virt_ConsoleRedirectionServiceCapabilities.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.h Fri Oct 17 16:37:33 2008 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright IBM Corp. 2008
+ *
+ * Authors:
+ * Richard Maciel <richardm(a)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 f7b995404a9c -r b1da9a0f3b05 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Mon Oct 06 08:37:42 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Fri Oct 17 16:37:33 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,14 @@
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");
@@ -100,7 +109,6 @@
char* classname;
classname = class_base_name(CLASSNAME(ref));
-
if (STREQC(classname, "VirtualSystemManagementService")) {
s = get_vsms(ref, &_inst, _BROKER, context, true);
if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
@@ -113,6 +121,14 @@
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);
+ if((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
} else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
@@ -382,22 +398,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",
NULL,
};
@@ -434,6 +456,9 @@
"Xen_VirtualSystemMigrationService",
"KVM_VirtualSystemMigrationService",
"LXC_VirtualSystemMigrationService",
+ "Xen_ConsoleRedirectionService",
+ "KVM_ConsoleRedirectionService",
+ "LXC_ConsoleRedirectionService",
NULL
};