# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1224267128 25200
# Node ID 945715d70d43a432adcd46b8eb8146564d473fc7
# Parent ef98854352d7c0e7abbe2d77ba9d885ef61629e6
* Patch #2: 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
* Fixed whitespace issues
* Removed not useful CU_DEBUG calls from ElementCapabilities.c file (those were added in
the first patch)
Signed-off-by: Richard Maciel <richardm(a)br.ibm.com>
diff -r ef98854352d7 -r 945715d70d43 src/Makefile.am
--- a/src/Makefile.am Thu Oct 16 13:28:42 2008 -0700
+++ b/src/Makefile.am Fri Oct 17 11:12:08 2008 -0700
@@ -132,7 +132,7 @@
-lVirt_VSMigrationService \
-lVirt_DevicePool \
-lVirt_ConsoleRedirectionService \
- -lVirt_ConsoleRedirectionServiceCapabilities
+ -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 ef98854352d7 -r 945715d70d43 src/Virt_ConsoleRedirectionServiceCapabilities.c
--- a/src/Virt_ConsoleRedirectionServiceCapabilities.c Thu Oct 16 13:28:42 2008 -0700
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.c Fri Oct 17 11:12:08 2008 -0700
@@ -70,12 +70,10 @@
return s;
}
-/* 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)
+ const CMPIObjectPath *ref,
+ CMPIInstance **_inst,
+ bool is_get_inst)
{
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
diff -r ef98854352d7 -r 945715d70d43 src/Virt_ConsoleRedirectionServiceCapabilities.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Virt_ConsoleRedirectionServiceCapabilities.h Fri Oct 17 11:12:08 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 ef98854352d7 -r 945715d70d43 src/Virt_ElementCapabilities.c
--- a/src/Virt_ElementCapabilities.c Thu Oct 16 13:28:42 2008 -0700
+++ b/src/Virt_ElementCapabilities.c Fri Oct 17 11:12:08 2008 -0700
@@ -78,14 +78,13 @@
s = get_migration_service(ref, &_inst, _BROKER, context, false);
} else if (STREQC(classname, "ConsoleRedirectionServiceCapabilities"))
{
- s = get_console_rs_caps(_BROKER, ref, &_inst, true);
+ s = get_console_rs_caps(_BROKER, ref, &_inst, true);
- if((s.rc != CMPI_RC_OK) || (_inst == NULL))
+ if((s.rc != CMPI_RC_OK) || (_inst == NULL))
goto out;
-
- s = get_console_rs(ref, &_inst, _BROKER, context, false);
- } else
+ s = get_console_rs(ref, &_inst, _BROKER, context, false);
+ } else
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
"Not found");
@@ -110,7 +109,6 @@
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))
@@ -123,18 +121,15 @@
goto out;
s = get_migration_caps(ref, &_inst, _BROKER, false);
- } 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;
+ } else if (STREQC(classname, "ConsoleRedirectionService")) {
+ 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
+ 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,
"");
@@ -211,8 +206,6 @@
{
CMPIInstance *inst = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
-
- CU_DEBUG("service_to_cap\n");
if (!match_hypervisor_prefix(ref, info))
goto out;