xend config list
RFC PATCH 1/1 xend config list
Hi, all
I made the patch to show xoptions.
We can get infomation of xend configuration with my patch. How about this?
# xm list --x
config_default : /etc/xen/xend-config.sxp
xoptions.config_path : /etc/xen/xend-config.sxp
xoptions.config_var : XEND_CONFIG
xoptions.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
config:
xend-config
['loglevel', 'DEBUG']
['xen-api-server', [['9363', 'pam']]]
['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']
['enable-dump', 'yes']
['vnc-listen', '0.0.0.0']
['vncpasswd', '']Best Regards,
Akio Takebe
tools/python/xen/xm/main.py +45 -2
@@ -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
@@ -807,11 +810,12 @@ def xm_list(args): def xm_list(args): use_long = 0 show_vcpus = 0 + show_xend = 0 show_labels = 0 state = 'all' try: - (options, params) = getopt.gnu_getopt(args, 'lv', - ['long','vcpus','label', + (options, params) = getopt.gnu_getopt(args, 'lvx', + ['long','vcpus','xend','label', 'state=']) except getopt.GetoptError, opterr: err(opterr)
@@ -822,10 +826,49 @@ def xm_list(args): use_long = 1 if k in ['-v', '--vcpus']: show_vcpus = 1 + if k in ['-x', '--xend']: + show_xend = 1 if k in ['--label']: show_labels = 1 if k in ['--state']: state = v + + if show_xend: + print 'config_default\t\t\t\t: ',xoptions.config_default + print 'xoptions.config_path\t\t\t: ',xoptions.config_path + print 'xoptions.config_var\t\t\t: ',xoptions.config_var + print 'xoptions.dom0_min_mem_default\t\t: ',xoptions.dom0_min_mem_default + print 'dom0_vcpus_default\t\t\t: ',xoptions.dom0_vcpus_default + print 'external_migration_tool_default\t\t: ',xoptions.external_migration_tool_default + print 'logfile_default\t\t\t\t: ',xoptions.logfile_default + print 'loglevel_default\t\t\t: ',xoptions.loglevel_default + print 'netback_type\t\t\t\t: ',xoptions.netback_type + print 'network_script_dir\t\t\t: ',xoptions.network_script_dir + print 'vif_script\t\t\t\t: ',xoptions.vif_script + print 'vncpasswd_default\t\t\t: ',xoptions.vncpasswd_default + print 'xen_api_server_default\t\t\t: ',xoptions.xen_api_server_default + print 'xend_address_default\t\t\t: ',xoptions.xend_address_default + print 'xend_domains_path_default\t\t: ',xoptions.xend_domains_path_default + print 'xend_http_server_default\t\t: ',xoptions.xend_http_server_default + print 'xend_port_default\t\t\t: ',xoptions.xend_port_default + print 'xend_relocation_address_default\t\t: ',xoptions.xend_relocation_address_default + print 'xend_relocation_hosts_allow_default\t: ',xoptions.xend_relocation_hosts_allow_default + print 'xend_relocation_port_default\t\t: ',xoptions.xend_relocation_port_default + print 'xend_relocation_server_default\t\t: ',xoptions.xend_relocation_server_default + print 'xend_state_path_default\t\t\t: ',xoptions.xend_state_path_default + print 'xend_storage_path_default\t\t: ',xoptions.xend_storage_path_default + print 'xend_tcp_xmlrpc_server_address_default\t: ',xoptions.xend_tcp_xmlrpc_server_address_default + print 'xend_tcp_xmlrpc_server_default\t\t: ',xoptions.xend_tcp_xmlrpc_server_default + print 'xend_tcp_xmlrpc_server_port_default\t: ',xoptions.xend_tcp_xmlrpc_server_port_default + print 'xend_unix_path_default\t\t\t: ',xoptions.xend_unix_path_default + print 'xend_unix_server_default\t\t: ',xoptions.xend_unix_server_default + print 'xend_unix_xmlrpc_server_default\t\t: ',xoptions.xend_unix_xmlrpc_server_default + print 'xend_vnc_listen_default\t\t\t: ',xoptions.xend_vnc_listen_default + print 'config:' + for i in xoptions.config: + print " ",i + + return if state != 'all' and len(params) > 0: raise OptionError(
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 7 lines · Akio Takebe
I made the patch to show xoptions.
We can get infomation of xend configuration with my patch. How about this?Signed-off-by Akio Takebe <[email protected]># xm list --x
xm list is for showing domains, please don't subvert it to do something different. Add a new command or something...
john
Hi, John and all
Quoted 10 lines
Quoted 7 lines
I made the patch to show xoptions.
We can get infomation of xend configuration with my patch. How about this?Signed-off-by Akio Takebe <[email protected]># xm list --xxm list is for showing domains, please don't subvert it to do something different. Add a new command or something...
Thank you for you comment.
How about "xm info"?
Best Regards,
Akio Takebe
Hi Akio,
Akio Takebe wrote: [Fri Sep 14 2007, 03:27:40AM EDT]
Quoted 24 lines
tools/python/xen/xm/main.py +24
-0+ if show_xend: + print 'config_default\t\t\t\t: ',xoptions.config_default + print 'xoptions.config_path\t\t\t: ',xoptions.config_path + print 'xoptions.config_var\t\t\t: ',xoptions.config_var + print 'xoptions.dom0_min_mem_default\t\t: ',xoptions.dom0_min_mem_default + print 'dom0_vcpus_default\t\t\t: ',xoptions.dom0_vcpus_default + print 'external_migration_tool_default\t\t: ',xoptions.external_migration_tool_default + print 'logfile_default\t\t\t\t: ',xoptions.logfile_default + print 'loglevel_default\t\t\t: ',xoptions.loglevel_default + print 'netback_type\t\t\t\t: ',xoptions.netback_type + print 'network_script_dir\t\t\t: ',xoptions.network_script_dir + print 'vif_script\t\t\t\t: ',xoptions.vif_script + print 'vncpasswd_default\t\t\t: ',xoptions.vncpasswd_default + print 'xen_api_server_default\t\t\t: ',xoptions.xen_api_server_default + print 'xend_address_default\t\t\t: ',xoptions.xend_address_default + print 'xend_domains_path_default\t\t: ',xoptions.xend_domains_path_default + print 'xend_http_server_default\t\t: ',xoptions.xend_http_server_default + print 'xend_port_default\t\t\t: ',xoptions.xend_port_default + print 'xend_relocation_address_default\t\t: ',xoptions.xend_relocation_address_default + print 'xend_relocation_hosts_allow_default\t: ',xoptions.xend_relocation_hosts_allow_default + print 'xend_relocation_port_default\t\t: ',xoptions.xend_relocation_port_default + print 'xend_relocation_server_default\t\t: ',xoptions.xend_relocation_server_default + print 'xend_state_path_default\t\t\t: ',xoptions.xend_state_path_default + print 'xend_storage_path_default\t\t: ',xoptions.xend_storage_path_default
tools/python/xen/xm/main.py def xm_list(args): · line 869
Quoted 10 lines
tools/python/xen/xm/main.py +10
-0+ print 'xend_tcp_xmlrpc_server_address_default\t: ',xoptions.xend_tcp_xmlrpc_server_address_default + print 'xend_tcp_xmlrpc_server_default\t\t: ',xoptions.xend_tcp_xmlrpc_server_default + print 'xend_tcp_xmlrpc_server_port_default\t: ',xoptions.xend_tcp_xmlrpc_server_port_default + print 'xend_unix_path_default\t\t\t: ',xoptions.xend_unix_path_default + print 'xend_unix_server_default\t\t: ',xoptions.xend_unix_server_default + print 'xend_unix_xmlrpc_server_default\t\t: ',xoptions.xend_unix_xmlrpc_server_default + print 'xend_vnc_listen_default\t\t\t: ',xoptions.xend_vnc_listen_default + print 'config:' + for i in xoptions.config: + print " ",i
This long list is bound to go stale pretty quickly. I'm not a python expert but surely there's a way to loop through the values you want to show?
Thanks,
Aron
Hi, Aron
Quoted 5 lines
Akio Takebe wrote: [Fri Sep 14 2007, 03:27:40AM EDT]
Quoted 4 lines
tools/python/xen/xm/main.py +4
-0+ if show_xend: + print 'config_default\t\t\t\t: ',xoptions.config_default + print 'xoptions.config_path\t\t\t: ',xoptions.config_path + print 'xoptions.config_var\t\t\t: ',xoptions.config_var
[snip..]
Quoted 9 lines
tools/python/xen/xm/main.py def xm_list(args): · line 869
Quoted 8 lines
xend_unix_server_default
+ print 'xend_unix_xmlrpc_server_default\t\t: ',xoptions.xend_unix_xmlrpc_server_default
+ print 'xend_vnc_listen_default\t\t\t: ',xoptions.xend_vnc_listen_defaulttools/python/xen/xm/main.py +3
-0+ print 'config:' + for i in xoptions.config: + print " ",i
Quoted 3 lines
This long list is bound to go stale pretty quickly. I'm not a python expert but surely there's a way to loop through the values you want to show?
Thank you for your comment.
It's good idea, I'll try to find the way.
If anybody know that, please tell me.
Best Regards,
Akio Takebe
Quoted 7 lines · Akio Takebe
Quoted 3 lines
This long list is bound to go stale pretty quickly. I'm not a python expert but surely there's a way to loop through the values you want to show?
Thank you for your comment.
It's good idea, I'll try to find the way.
If anybody know that, please tell me.
Searching for "python introspection" would be a good place to start I think.
I think 'xm info' is still a little too generic. How about 'xm config-list' ? Anyone?
regards
john
John Levon wrote: [Tue Sep 18 2007, 02:05:12AM EDT]
Quoted 2 lines
I think 'xm info' is still a little too generic. How about 'xm config-list' ? Anyone?
Actually I was thinking "xm info --config" might work. "xm info --help" says "Get information about Xen host." This seems to fit under that heading.
Aron
Quoted 4 lines · Aron Griffis
Quoted 2 lines
I think 'xm info' is still a little too generic. How about 'xm config-list' ? Anyone?
Actually I was thinking "xm info --config" might work. "xm info
Sounds good.
regards
john