# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1224109379 25200
# Node ID e71c0941849da4338ed56d784a6c3966b73ffaf7
# Parent 5f835a32ab3aa0dc26718371c3f4a0a0abe879ae
Signed-off-by: Richard Maciel <richardm(a)br.ibm.com>
* 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
diff -r 5f835a32ab3a -r e71c0941849d src/Makefile.am
--- a/src/Makefile.am Wed Oct 15 14:14:09 2008 -0700
+++ b/src/Makefile.am Wed Oct 15 15:22:59 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 5f835a32ab3a -r e71c0941849d src/Virt_ConsoleRedirectionServiceCapabilities.c
--- a/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 15 14:14:09 2008 -0700
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.c Wed Oct 15 15:22:59 2008 -0700
@@ -32,6 +32,7 @@
#include "svpc_types.h"
#include "Virt_ConsoleRedirectionService.h"
+#include "Virt_ConsoleRedirectionServiceCapabilities.h"
const static CMPIBroker *_BROKER;
@@ -69,7 +70,9 @@
return s;
}
-static CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
+/* Removed the static keyword from the function declaration to
+ * make it available for other modules */
+CMPIStatus get_console_rs_caps(const CMPIBroker *broker,
const CMPIObjectPath *ref,
CMPIInstance **_inst,
bool is_get_inst)
diff -r 5f835a32ab3a -r e71c0941849d src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Wed Oct 15 14:14:09 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Wed Oct 15 15:22:59 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,15 @@
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 +110,7 @@
char* classname;
classname = class_base_name(CLASSNAME(ref));
-
+ CU_DEBUG("After class_base_name\n: %s", classname);
if (STREQC(classname, "VirtualSystemManagementService")) {
s = get_vsms(ref, &_inst, _BROKER, context, true);
if ((s.rc != CMPI_RC_OK) || (_inst == NULL))
@@ -113,7 +123,18 @@
goto out;
s = get_migration_caps(ref, &_inst, _BROKER, false);
- } else
+ } else if(STREQC(classname, "ConsoleRedirectionService")) {
+ CU_DEBUG("before console_rs\n");
+ s = get_console_rs(ref, &_inst, _BROKER, context, true);
+ if((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+
+ CU_DEBUG("before console_rs_caps\n");
+ s = get_console_rs_caps(_BROKER, ref, &_inst, false);
+ if((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ goto out;
+ CU_DEBUG("after console_rs_Caps\n");
+ } else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
"");
@@ -190,6 +211,8 @@
{
CMPIInstance *inst = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
+
+ CU_DEBUG("service_to_cap\n");
if (!match_hypervisor_prefix(ref, info))
goto out;
@@ -382,22 +405,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 +463,9 @@
"Xen_VirtualSystemMigrationService",
"KVM_VirtualSystemMigrationService",
"LXC_VirtualSystemMigrationService",
+ "Xen_ConsoleRedirectionService",
+ "KVM_ConsoleRedirectionService",
+ "LXC_ConsoleRedirectionService",
NULL
};