[Libvirt-cim] [PATCH] Fix CRS MaxConcurrentEnabledSAPs value

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Tue Oct 21 22:33:30 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1224628392 25200
# Node ID 6b7e629b8ca10658d31b1148403a0424af0a2985
# Parent  e7ffee5deb372f73fa3f315bffca69e6b21fe5b8
Fix CRS MaxConcurrentEnabledSAPs value.

The current calculation isn't valid.  The profile says that the number of
enabled sessions cannot exeed the MaxConcurrentEnabledSAPs value. So anytime
you create a new guest (after the initial start), then you are exeeding this
value.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r e7ffee5deb37 -r 6b7e629b8ca1 src/Virt_ConsoleRedirectionService.c
--- a/src/Virt_ConsoleRedirectionService.c	Tue Oct 21 09:22:28 2008 -0700
+++ b/src/Virt_ConsoleRedirectionService.c	Tue Oct 21 15:33:12 2008 -0700
@@ -38,12 +38,13 @@
 #include "Virt_HostSystem.h"
 #include "Virt_ConsoleRedirectionService.h"
 
+#define MAX_SAP_SESSIONS 65535
+
 const static CMPIBroker *_BROKER;
 
 static CMPIStatus set_inst_properties(const CMPIBroker *broker,
                                       const CMPIContext *context,
                                       const CMPIObjectPath *ref,
-                                      virConnectPtr conn,
                                       CMPIInstance *inst)
 {
         CMPIStatus s = {CMPI_RC_OK, NULL};
@@ -51,8 +52,6 @@
         const char *name = NULL;
         const char *ccname = NULL;
         uint16_t prop_val;
-        int num_defined_dom;
-        int num_dom;
 
         s = get_host_system_properties(&name, &ccname, ref, broker, context);
         if (s.rc != CMPI_RC_OK) {
@@ -84,16 +83,7 @@
         CMSetProperty(inst, "RedirectionServiceType",
                       (CMPIValue *)&array, CMPI_uint16A);
 
-        num_dom = virConnectNumOfDomains(conn);
-        num_defined_dom = virConnectNumOfDefinedDomains(conn);
-
-        if (num_dom < 0)
-            num_dom = 0;
-
-        if (num_defined_dom < 0)
-            num_defined_dom = 0;
-
-        prop_val = (uint16_t) num_defined_dom + (uint16_t) num_defined_dom;
+        prop_val = (uint16_t)MAX_SAP_SESSIONS;
         CMSetProperty(inst, "MaxConcurrentEnabledSAPs",
                       (CMPIValue *)&prop_val, CMPI_uint16);
 
@@ -147,7 +137,7 @@
                 goto out;
         }
 
-        s = set_inst_properties(broker, context, reference, conn, inst);
+        s = set_inst_properties(broker, context, reference, inst);
         if (s.rc != CMPI_RC_OK)
                 goto out;
 




More information about the Libvirt-cim mailing list