diff options
| -rwxr-xr-x | tools/kvm/kvm_stat/kvm_stat | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat index 29c56f3a05dc..bf65531570f5 100755 --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat | |||
| @@ -1453,16 +1453,13 @@ Press any other key to refresh statistics immediately. | |||
| 1453 | try: | 1453 | try: |
| 1454 | pids = Tui.get_pid_from_gname(val) | 1454 | pids = Tui.get_pid_from_gname(val) |
| 1455 | except: | 1455 | except: |
| 1456 | raise optparse.OptionValueError('Error while searching for guest ' | 1456 | sys.exit('Error while searching for guest "{}". Use "-p" to ' |
| 1457 | '"{}", use "-p" to specify a pid ' | 1457 | 'specify a pid instead?'.format(val)) |
| 1458 | 'instead'.format(val)) | ||
| 1459 | if len(pids) == 0: | 1458 | if len(pids) == 0: |
| 1460 | raise optparse.OptionValueError('No guest by the name "{}" ' | 1459 | sys.exit('Error: No guest by the name "{}" found'.format(val)) |
| 1461 | 'found'.format(val)) | ||
| 1462 | if len(pids) > 1: | 1460 | if len(pids) > 1: |
| 1463 | raise optparse.OptionValueError('Multiple processes found (pids: ' | 1461 | sys.exit('Error: Multiple processes found (pids: {}). Use "-p" ' |
| 1464 | '{}) - use "-p" to specify a pid ' | 1462 | 'to specify the desired pid'.format(" ".join(pids))) |
| 1465 | 'instead'.format(" ".join(pids))) | ||
| 1466 | parser.values.pid = pids[0] | 1463 | parser.values.pid = pids[0] |
| 1467 | 1464 | ||
| 1468 | optparser = optparse.OptionParser(description=description_text, | 1465 | optparser = optparse.OptionParser(description=description_text, |
