Skip to contentSkip to conversation

XendOptionsSMF, missing get_config_value method on Solaris

PATCH In review Juergen Keil 2 participants 2 messages Jun 6, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 XendOptionsSMF, missing get_config_value method on Solaris

Hi,

On Solaris, xend XendOptions.py uses an additional interface XendOptionsSMF. This allows xend configuration via Solaris SMF as well as the config file. (Added by changeset 13407).

Problem: XendOptionsSMF doesn't define a get_config_value; but these is get_config_string. The code in XendOptions.py needs both; get_keymap() needs get_config_value.

The attached patch adds the missing get_config_value to interface XendOptionsSMF.

get_config_value missing in XendOptionsSMF instance, breaks xend on Solaris

On Solaris, interface XendOptionsSMF doesn't define a get_config_value method. We only have XendOptionsSMF.get_config_string.

Class XendOptionsFile has both: get_config_value and get_config_string. And get_config_string is an alias for get_config_value.

This breaks the original code for get_keymap() on a solaris dom0:

def get_keymap(self):
return self.get_config_value('keymap', None)

[2008-06-06 14:12:18 1350] ERROR (SrvDaemon:347) Exception starting xend (XendOp tionsSMF instance has no attribute 'get_config_value')

tools/python/xen/xend/XendOptions.py +4 -1
@@ -448,7 +448,7 @@
                 else:
                     raise XendError("option %s: %s:%s" % (name, e[1], e[2]))
 
-        def get_config_string(self, name, val=None):
+        def get_config_value(self, name, val=None):
             try:
                 return scf.get_string(name)
             except scf.error, e:
@@ -456,6 +456,9 @@
                     return val
                 else:
                     raise XendError("option %s: %s:%s" % (name, e[1], e[2]))
+
+	def get_config_string(self, name, val=None):
+	    return self.get_config_value(name, val)
 
         def get_xen_api_server(self):
             # When the new server is a supported configuration, we should

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 7 lines · Juergen Keil

On Solaris, xend XendOptions.py uses an additional interface XendOptionsSMF. This allows xend configuration via Solaris SMF as well as the config file. (Added by changeset 13407).

Problem: XendOptionsSMF doesn't define a get_config_value; but these is get_config_string. The code in XendOptions.py needs both; get_keymap() needs get_config_value.

I'm not sure about this: SMF values are always typed and there's really no such thing as just a value. Instead, I think get_keymap() needs to use get_config_string(). Note it's the only base class routine that does this.

regards
john