summaryrefslogtreecommitdiffstats
path: root/tools/kvm/kvm_stat
diff options
context:
space:
mode:
authorStefan Raspl <raspl@linux.vnet.ibm.com>2017-03-10 13:40:09 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-03-29 12:01:29 +0200
commitbe03ea3b77387db36617d71d60ee182a866fb9cd (patch)
tree08218d9b4795c61e093e67c46a2eb86520ad91ba /tools/kvm/kvm_stat
parenta24e85f6a69f09a9d09a86110a6bb168c60610ef (diff)
downloadlinux-be03ea3b77387db36617d71d60ee182a866fb9cd.tar.bz2
tools/kvm_stat: remove pid filter on empty input
Improve consistency in the interactive dialogue for pid filtering by removing any filters on empty input (in addition to entering 0). Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Diffstat (limited to 'tools/kvm/kvm_stat')
-rwxr-xr-xtools/kvm/kvm_stat/kvm_stat11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index 95ffa9a4b044..9e9eb983f6fe 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -991,10 +991,13 @@ class Tui(object):
curses.noecho()
try:
- pid = int(pid)
- if pid != 0 and not os.path.isdir(os.path.join('/proc/',
- str(pid))):
- continue
+ if len(pid) > 0:
+ pid = int(pid)
+ if pid != 0 and not os.path.isdir(os.path.join('/proc/',
+ str(pid))):
+ continue
+ else:
+ pid = 0
self.refresh_header(pid)
self.update_pid(pid)
break