Repost - xm lists display and formatting
PATCH 1/1 Repost - xm lists display and formatting
This patch displays the network-list/block-list/vtpm-list using the 'xm' command. It supports the '--long' option.
xen-unstable.hg/tools/python/xen/xm/main.py +122 -18
@@ -90,18 +90,18 @@ block_detach_help = """block-detach <Do where <DevId> may either be the device ID or the device name as mounted in the guest""" -block_list_help = "block-list <DomId> List virtual block devices for a domain" +block_list_help = "block-list <DomId> [--long] List virtual block devices for a domain" network_attach_help = """network-attach <DomID> [script=<script>] [ip=<ip>] [mac=<mac>] [bridge=<bridge>] [backend=<backDomID>] Create a new virtual network device """ network_detach_help = """network-detach <DomId> <DevId> Destroy a domain's virtual network device, where <DevId> is the device ID.""" -network_list_help = "network-list <DomId> List virtual network interfaces for a domain" +network_list_help = "network-list <DomId> [--long] List virtual network interfaces for a domain" vnet_list_help = "vnet-list [-l|--long] list vnets" vnet_create_help = "vnet-create <config> create a vnet from a config file" vnet_delete_help = "vnet-delete <vnetid> delete a vnet" -vtpm_list_help = "vtpm-list <DomId> list virtual TPM devices" +vtpm_list_help = "vtpm-list <DomId> [--long] list virtual TPM devices" short_command_list = [ "console",
@@ -684,29 +684,133 @@ def xm_log(args): from xen.xend.XendClient import server print server.xend_node_log() +def parse_dev_info(info): + def get_info(n, t, d): + i = 0 + while i < len(info): + if (info[i][0] == n): + return t(info[i][1]) + i = i + 1 + return t(d) + return { + #common + 'backend-id' : get_info('backend-id', int, -1), + 'handle' : get_info('handle', int, 0), + 'state' : get_info('state', int, -1), + 'be-path' : get_info('backend', str, '??'), + 'event-ch' : get_info('event-channel',int, -1), + #network specific + 'virtual-device' : get_info('virtual-device', str, '??'), + 'tx-ring-ref': get_info('tx-ring-ref', int, -1), + 'rx-ring-ref': get_info('rx-ring-ref', int, -1), + 'mac' : get_info('mac', str, '??'), + #block-device specific + 'ring-ref' : get_info('ring-ref', int, -1), + } + +def has_long_option(args): + use_long = 0 + try: + (options, params) = getopt.gnu_getopt(args, 'l', ['long']) + except getopt.GetoptError, opterr: + err(opterr) + sys.exit(1) + + for (k, v) in options: + if k in ['-l', '--long']: + use_long = 1 + return (use_long, params) + def xm_network_list(args): - arg_check(args, "network-list", 1) - dom = args[0] + arg_check(args, "network-list", 1, 2) + + (use_long, params) = has_long_option(args) + + if len(params) == 0: + print 'No domain parameter given' + sys.exit(1) + dom = params[0] from xen.xend.XendClient import server - for x in server.xend_domain_devices(dom, 'vif'): - sxp.show(x) - print + if use_long: + devs = server.xend_domain_devices(dom, 'vif') + map(PrettyPrint.prettyprint, devs) + else: + hdr = 0 + for x in server.xend_domain_devices(dom, 'vif'): + if hdr == 0: + print 'Idx BE MAC Addr. handle state evt-ch tx-/rx-ring-ref BE-path' + hdr = 1 + ni = parse_dev_info(x[1]) + ni['idx'] = int(x[0]) + print ("%(idx)-3d " + "%(backend-id)-3d" + "%(mac)-17s " + "%(handle)-3d " + "%(state)-3d " + "%(event-ch)-3d " + "%(tx-ring-ref)-5d/%(rx-ring-ref)-5d " + "%(be-path)-30s " + % ni) def xm_block_list(args): - arg_check(args, "block-list", 1) - dom = args[0] + arg_check(args, "block-list", 1, 2) + + (use_long, params) = has_long_option(args) + + if len(params) == 0: + print 'No domain parameter given' + sys.exit(1) + dom = params[0] from xen.xend.XendClient import server - for x in server.xend_domain_devices(dom, 'vbd'): - sxp.show(x) - print + if use_long: + devs = server.xend_domain_devices(dom, 'vbd') + map(PrettyPrint.prettyprint, devs) + else: + hdr = 0 + for x in server.xend_domain_devices(dom, 'vbd'): + if hdr == 0: + print 'Vdev BE handle state evt-ch ring-ref BE-path' + hdr = 1 + ni = parse_dev_info(x[1]) + ni['idx'] = int(x[0]) + print ("%(idx)-3d " + "%(backend-id)-3d " + "%(handle)-3d " + "%(state)-3d " + "%(event-ch)-3d " + "%(ring-ref)-5d " + "%(be-path)-30s " + % ni) def xm_vtpm_list(args): - arg_check(args, "vtpm-list", 1) - dom = args[0] + arg_check(args, "vtpm-list", 1, 2) + + (use_long, params) = has_long_option(args) + + if len(params) == 0: + print 'No domain parameter given' + sys.exit(1) + dom = params[0] from xen.xend.XendClient import server - for x in server.xend_domain_devices(dom, 'vtpm'): - sxp.show(x) - print + if use_long: + devs = server.xend_domain_devices(dom, 'vtpm') + map(PrettyPrint.prettyprint, devs) + else: + hdr = 0 + for x in server.xend_domain_devices(dom, 'vtpm'): + if hdr == 0: + print 'Idx BE handle state evt-ch ring-ref BE-path' + hdr = 1 + ni = parse_dev_info(x[1]) + ni['idx'] = int(x[0]) + print ("%(idx)-3d " + "%(backend-id)-3d " + "%(handle)-3d " + "%(state)-3d " + "%(event-ch)-3d " + "%(ring-ref)-5d " + "%(be-path)-30s " + % ni) def xm_block_attach(args): arg_check(args, 'block-attach', 4, 5)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ewan Mellor
AppliedQuoted 4 lines · Stefan Berger
This patch displays the network-list/block-list/vtpm-list using the 'xm' command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>
Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list and network-list to become block-list --long and network-list --long, but it would be better if we fixed the eyecatchers (where necessary) to work with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
And of course it would be nice to have tests for vtpm-list (after detecting the presence of appropriate hardware, I guess).
Any volunteers?
Ewan.
Quoted 16 lines · Ewan Mellor
Quoted 4 lines · Stefan Berger
This patch displays the network-list/block-list/vtpm-list using the 'xm' command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list and network-list to become block-list --long and network-list --long, but it would be better if we fixed the eyecatchers (where necessary) to work with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
Quoted 4 lines
And of course it would be nice to have tests for vtpm-list (after detecting the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted with corresponding tests in xm-test. We want to continue to use xm-test to verify functionality.
2) The documentation - like man pages - should be updated along with the new functionality.
3) xm-test should be used to verify patches prior to submitting and applying.
Thanks,
Dan
[email protected] wrote on 02/17/2006 02:00:15 PM:
Quoted 4 lines · Ewan Mellor
Quoted 3 lines · Stefan Berger
Quoted 2 lines
This patch displays the network-list/block-list/vtpm-list using the
'xm'
Quoted 10 lines
Quoted 10 lines
Quoted 3 lines
command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list and network-list to become block-list --long and network-list --long, but it would be better if we fixed the eyecatchers (where necessary) to
work
Quoted 4 lines
Quoted 4 lines
with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
And of course it would be nice to have tests for vtpm-list (after
detecting
Quoted 13 lines
Quoted 3 lines
the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted with corresponding tests in xm-test. We want to continue to use xm-test to verify functionality.
Quoted 5 lines
2) The documentation - like man pages - should be updated along with the new functionality.
3) xm-test should be used to verify patches prior to submitting and applying.
Sorry, I did not know about the dependency of this tool on the output of this command.
Stefan
Quoted 5 lines
Thanks,
Dan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Stefan
But you still want the feature in xm-test?
wm
================
Quoted 61 lines · Stefan Berger
[email protected] wrote on 02/17/2006 02:00:15 PM:
Quoted 4 lines · Ewan Mellor
Quoted 3 lines · Stefan Berger
Quoted 2 lines
This patch displays the network-list/block-list/vtpm-list using
the 'xm'
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list
and
Quoted 1 line
Quoted 1 line
network-list to become block-list --long and network-list --long,
but
Quoted 1 line
Quoted 1 line
it would be better if we fixed the eyecatchers (where necessary)
to work
Quoted 4 lines
Quoted 4 lines
with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
And of course it would be nice to have tests for vtpm-list (after
detecting
Quoted 10 lines
Quoted 3 lines
the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted
with
Quoted 1 line
corresponding tests in xm-test. We want to continue to use xm-test
to
Quoted 3 lines
verify functionality.
2) The documentation - like man pages - should be updated along with
the
Quoted 4 lines
new functionality.
3) xm-test should be used to verify patches prior to submitting and applying.
Sorry, I did not know about the dependency of this tool on the output of this command.
Stefan
Quoted 5 lines
Thanks,
Dan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 6 lines
Sincerely, Woody Marvel IBM Linux Technology Center Open Source Virtualization email: [email protected] 503-578-3833 Beaverton, OR 97006 **********************************
Stefan
Hi
Thanks for the xm-text initiative.
Did you test with xm-test (the whole suite of testx) on i386 and/or x86_64 and/or VMX, before submitting the patches? Did they all work?
Dan is right, the doc also needs work.
woody
==============
Quoted 47 lines · Daniel Stekloff
Quoted 16 lines · Ewan Mellor
Quoted 4 lines · Stefan Berger
This patch displays the network-list/block-list/vtpm-list using the 'xm' command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list and network-list to become block-list --long and network-list --long, but it would be better if we fixed the eyecatchers (where necessary) to work with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
Quoted 4 lines
And of course it would be nice to have tests for vtpm-list (after detecting the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted with corresponding tests in xm-test. We want to continue to use xm-test to verify functionality.
2) The documentation - like man pages - should be updated along with the new functionality.
3) xm-test should be used to verify patches prior to submitting and applying.
Thanks,
Dan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Signature · 6 lines
Sincerely, Woody Marvel IBM Linux Technology Center Open Source Virtualization email: [email protected] 503-578-3833 Beaverton, OR 97006 **********************************
[email protected] wrote on 02/17/2006 02:54:21 PM:
Quoted 6 lines
Stefan
Hi
Thanks for the xm-text initiative.Did you test with xm-test (the whole suite of testx) on i386 and/or
x86_64and/or VMX, before submitting the patches? Did they all work?
I had tested it with xm-test 'block-list' on x86. There were no failures on those block-device related test, but 8 PASSes. This time it got stuck in one of the test.
Quoted 2 lines
Dan is right, the doc also needs work.
I have just adapted the man page and will submit that later.
Stefan
Quoted 8 lines
woody
==============Quoted 4 lines · Daniel Stekloff
Quoted 3 lines · Ewan Mellor
Quoted 1 line · Stefan Berger
This patch displays the network-list/block-list/vtpm-list using
the 'xm'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list
and
Quoted 1 line
Quoted 1 line
Quoted 1 line
network-list to become block-list --long and network-list --long,
but
Quoted 1 line
Quoted 1 line
Quoted 1 line
it would be better if we fixed the eyecatchers (where necessary) to
work
Quoted 15 lines
Quoted 4 lines
Quoted 4 lines
with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
And of course it would be nice to have tests for vtpm-list
(after detecting
Quoted 10 lines
Quoted 3 lines
the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted
with
Quoted 4 lines
Quoted 4 lines
corresponding tests in xm-test. We want to continue to use xm-test to verify functionality.
2) The documentation - like man pages - should be updated along with
the
Quoted 7 lines
Quoted 7 lines
new functionality.
3) xm-test should be used to verify patches prior to submitting and applying.
Thanks,
Quoted 21 lines
Quoted 8 lines
Dan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develSignature · 12 lines
Sincerely, Woody Marvel IBM Linux Technology Center Open Source Virtualization email: [email protected] 503-578-3833 Beaverton, OR 97006 ********************************** _______________________________________________ Xen-devel mailing list [email protected] http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
[email protected] wrote on 02/17/2006 02:54:21 PM:
Quoted 7 lines
Stefan
Hi
Thanks for the xm-text initiative.Did you test with xm-test (the whole suite of testx) on i386 and/or
x86_64and/or VMX, before submitting the patches? Did they all work?
Here's now the output of a testrun on x86:
REASON: (7 nics) Console didn't respond: probably crashed!
FAIL: 13_create_multinic_pos.test
REASON: ping loopback failed for size 65507. ping eth0 failed for size 65507.
XFAIL: 02_network_local_ping_pos.test
REASON: Ping to dom0 failed for size 32767 65507.
XFAIL: 05_network_dom0_ping_pos.test
REASON: Ping failed for size 32767 65507.
XFAIL: 11_network_domU_ping_pos.test
REASON: /proc/cpuinfo says xend didn't enforce dom0_cpus (2 != 1)
FAIL: 01_enforce_dom0_cpus_basic_pos.test
REASON: xm migrate returned invalid 256 != 0
FAIL: 01_migrate_localhost_pos.test
I think none of these errors is related to the xm changes regarding network-list or block-list.
I expect the consequences of the xm changes NOT to influence the test results on x86_64 or VMX - other challenges might be lurking there.
Stefan
Quoted 11 lines
Dan is right, the doc also needs work.
woody
==============Quoted 4 lines · Daniel Stekloff
Quoted 3 lines · Ewan Mellor
Quoted 1 line · Stefan Berger
This patch displays the network-list/block-list/vtpm-list using
the 'xm'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to block-list
and
Quoted 1 line
Quoted 1 line
Quoted 1 line
network-list to become block-list --long and network-list --long,
but
Quoted 1 line
Quoted 1 line
Quoted 1 line
it would be better if we fixed the eyecatchers (where necessary) to
work
Quoted 15 lines
Quoted 4 lines
Quoted 4 lines
with the new, formatted commands, and maybe added a few tests for xyz-list --long as well.
And of course it would be nice to have tests for vtpm-list
(after detecting
Quoted 10 lines
Quoted 3 lines
the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted
with
Quoted 4 lines
Quoted 4 lines
corresponding tests in xm-test. We want to continue to use xm-test to verify functionality.
2) The documentation - like man pages - should be updated along with
the
Quoted 7 lines
Quoted 7 lines
new functionality.
3) xm-test should be used to verify patches prior to submitting and applying.
Thanks,
Quoted 21 lines
Quoted 8 lines
Dan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develSignature · 12 lines
Sincerely, Woody Marvel IBM Linux Technology Center Open Source Virtualization email: [email protected] 503-578-3833 Beaverton, OR 97006 ********************************** _______________________________________________ Xen-devel mailing list [email protected] http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 10 lines · Stefan Berger
[email protected] wrote on 02/17/2006 02:54:21 PM:
Quoted 7 lines
Stefan
Hi
Thanks for the xm-text initiative.Did you test with xm-test (the whole suite of testx) on i386 and/or
x86_64and/or VMX, before submitting the patches? Did they all work?
Ewan, are you still running xm-test as part of your pre-commit regression testing? Also, have you started running on hvm hw? IIRC, Ian had mentioned that you were soon going to introduce these in your testbed.
We'd like to see more of these bugs caught prior to commit, and hoping to encourage all the developers out there to please run as well...
thanks,
Nivedita
Quoted 17 lines
Here's now the output of a testrun on x86:
REASON: (7 nics) Console didn't respond: probably crashed!
FAIL: 13_create_multinic_pos.test
REASON: ping loopback failed for size 65507. ping eth0 failed for size 65507.
XFAIL: 02_network_local_ping_pos.test
REASON: Ping to dom0 failed for size 32767 65507.
XFAIL: 05_network_dom0_ping_pos.test
REASON: Ping failed for size 32767 65507.
XFAIL: 11_network_domU_ping_pos.test
REASON:/proc/cpuinfosays xend didn't enforcedom0_cpus(2 != 1)
FAIL: 01_enforce_dom0_cpus_basic_pos.test
REASON: xm migrate returned invalid 256 != 0
FAIL: 01_migrate_localhost_pos.testI think none of these errors is related to the xm changes regarding network-list or block-list.
I expect the consequences of the xm changes NOT to influence the test results onx86_64or VMX - other challenges might be lurking there.
Quoted 2 lines · Nivedita Singhvi
Ewan, are you still running xm-test as part of your pre-commit regression testing?
Yes, we run the xm-test quick run before the change gets pushed from our staging tree to xen-unstable, and the xm-test full run overnight (on many machines).
Quoted 1 line
Also, have you started running on hvm hw?
James has been working on that recently. It looks from the XenRT matrix that it's not there yet, but it certainly will be soon.
Quoted 3 lines
We'd like to see more of these bugs caught prior to commit, and hoping to encourage all the developers out there to please run as well...
That's what the staging tree is for -- if there was any breakage (which it turns out that there wasn't) then the change would never have been pushed to the public unstable tree. My email was a plea for someone to improve the comprehensiveness of xm-test, now that we have a new feature.
Ewan.
Quoted 5 lines · Ewan Mellor
That's what the staging tree is for -- if there was any breakage (which it turns out that there wasn't) then the change would never have been pushed to the public unstable tree. My email was a plea for someone to improve the comprehensiveness of xm-test, now that we have a new feature.
Yep, not sure if there is a page on the Wiki for xm-test work to be done, tests wanted, but would be handy..
We're taking a look at cleaning up network tests, hoping to get to enhancing hvm support, but have not yet got to anything else..
thanks,
Nivedita
Stefan
Thanks Stephan.
Quoted 112 lines · Stefan Berger
[email protected] wrote on 02/17/2006 02:54:21 PM:
Quoted 7 lines
Stefan
Hi
Thanks for the xm-text initiative.Did you test with xm-test (the whole suite of testx) on i386 and/or
x86_64and/or VMX, before submitting the patches? Did they all work?Here's now the output of a testrun on x86:
REASON: (7 nics) Console didn't respond: probably crashed!
FAIL: 13_create_multinic_pos.test
REASON: ping loopback failed for size 65507. ping eth0 failed for size 65507.
XFAIL: 02_network_local_ping_pos.test
REASON: Ping to dom0 failed for size 32767 65507.
XFAIL: 05_network_dom0_ping_pos.test
REASON: Ping failed for size 32767 65507.
XFAIL: 11_network_domU_ping_pos.test
REASON:/proc/cpuinfosays xend didn't enforcedom0_cpus(2 != 1)
FAIL: 01_enforce_dom0_cpus_basic_pos.test
REASON: xm migrate returned invalid 256 != 0
FAIL: 01_migrate_localhost_pos.testI think none of these errors is related to the xm changes regarding network-list or block-list.
I expect the consequences of the xm changes NOT to influence the test results onx86_64or VMX - other challenges might be lurking there.Stefan
Quoted 11 lines
Dan is right, the doc also needs work.
woody
==============Quoted 4 lines · Daniel Stekloff
Quoted 3 lines · Ewan Mellor
Quoted 1 line · Stefan Berger
This patch displays the network-list/block-list/vtpm-list
using the 'xm'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
command. It supports the '--long' option.
Signed-off-by Stefan Berger <[email protected]>Applied, thank you.
This will break xm-test. Does anyone fancy fixing it up? The least-effort thing to do is change all of the calls to
block-list and
Quoted 1 line
Quoted 1 line
Quoted 1 line
network-list to become block-list --long and network-list
--long, but
Quoted 1 line
Quoted 1 line
Quoted 1 line
it would be better if we fixed the eyecatchers (where necessary)
to work
Quoted 1 line
Quoted 1 line
Quoted 1 line
with the new, formatted commands, and maybe added a few tests
for
Quoted 14 lines
Quoted 3 lines
Quoted 3 lines
xyz-list --long as well.
And of course it would be nice to have tests for vtpm-list
(after detecting
Quoted 10 lines
Quoted 3 lines
the presence of appropriate hardware, I guess).
Any volunteers?
Hi,
Three comments:
1) Changes like those introduced by this patch should be submitted
with
Quoted 1 line
Quoted 1 line
corresponding tests in xm-test. We want to continue to use xm-test
to
Quoted 3 lines
Quoted 3 lines
verify functionality.
2) The documentation - like man pages - should be updated along
with the
Quoted 3 lines
Quoted 3 lines
new functionality.
3) xm-test should be used to verify patches prior to submitting
and
Quoted 25 lines
Quoted 12 lines
applying.
Thanks,
Dan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-develSignature · 12 lines
Sincerely, Woody Marvel IBM Linux Technology Center Open Source Virtualization email: [email protected] 503-578-3833 Beaverton, OR 97006 ********************************** _______________________________________________ Xen-devel mailing list [email protected] http://lists.xensource.com/xen-devel
Signature · 6 lines
Sincerely, Woody Marvel IBM Linux Technology Center Open Source Virtualization email: [email protected] 503-578-3833 Beaverton, OR 97006 **********************************