xend_config_list take2
PATCH 1/1 xend_config_list take2
Hi,
This is the patch to show xend config.
We can see the members of xoptions.
# xm info --config __doc__ : Default path to the config file. __module__ : xen.xend.XendOptions block_script_dir : /etc/xen/scripts xend-relocation-server : yes xend-relocation-hosts-allow : ^localhost$ ^localhost\.localdomain$ network-script : network-bridge vif-script : vif-bridge dom0-min-mem : 196 dom0-cpus : 0 vncpasswd : config_default : /etc/xen/xend-config.sxp config_path : /etc/xen/xend-config.sxp config_var : XEND_CONFIG dom0_min_mem_default : 0 dom0_vcpus_default : 0 external_migration_tool_default : logfile_default : /var/log/xen/xend.log loglevel_default : DEBUG netback_type : netfront network_script_dir : /etc/xen/scripts vif_script : vif-bridge vncpasswd_default : None xen_api_server_default : [['unix']] xend_address_default : xend_domains_path_default : /var/lib/xend/domains xend_http_server_default : no xend_port_default : 8000 xend_relocation_address_default : xend_relocation_hosts_allow_default : xend_relocation_port_default : 8002 xend_relocation_server_default : no xend_state_path_default : /var/lib/xend/state xend_storage_path_default : /var/lib/xend/storage xend_tcp_xmlrpc_server_address_default: localhost xend_tcp_xmlrpc_server_default : no xend_tcp_xmlrpc_server_port_default : 8006 xend_unix_path_default : /var/lib/xend/xend-socket xend_unix_server_default : no xend_unix_xmlrpc_server_default : yes xend_vnc_listen_default : 127.0.0.1
FYI. last patch is the below.
http://lists.xensource.com/archives/html/xen-devel/2007-09/msg00311.html
Best Regards,
Akio Takebe
tools/python/xen/xm/main.py +28 -1
@@ -55,6 +55,9 @@ from xen.util.acmpolicy import ACM_LABEL import XenAPI +import inspect +from xen.xend import XendOptions +xoptions = XendOptions.instance() # getopt.gnu_getopt is better, but only exists in Python 2.3+. Use # getopt.getopt if gnu_getopt is not available. This will mean that options
@@ -1595,7 +1598,31 @@ def xm_sched_credit(args): err(str(result)) def xm_info(args): - arg_check(args, "info", 0) + arg_check(args, "info", 0, 1) + + try: + (options, params) = getopt.gnu_getopt(args, 'c', ['config']) + except getopt.GetoptError, opterr: + err(opterr) + usage('info') + + show_xend_config = 0 + for (k, v) in options: + if k in ['-c', '--config']: + show_xend_config = 1 + + if show_xend_config: + for name, obj in inspect.getmembers(xoptions): + if not inspect.ismethod(obj): + if name == "config": + for x in obj[1:]: + if len(x) < 2: + print "%-38s: (none)" % x[0] + else: + print "%-38s:" % x[0], x[1] + else: + print "%-38s:" % name, obj + return if serverType == SERVER_XEN_API:
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel