Commit be03ea3b authored by Stefan Raspl's avatar Stefan Raspl Committed by Paolo Bonzini

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: default avatarStefan Raspl <raspl@linux.vnet.ibm.com>
Reviewed-by: default avatarJanosch Frank <frankja@linux.vnet.ibm.com>
Reviewed-by: default avatarMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent a24e85f6
...@@ -991,10 +991,13 @@ class Tui(object): ...@@ -991,10 +991,13 @@ class Tui(object):
curses.noecho() curses.noecho()
try: try:
pid = int(pid) if len(pid) > 0:
if pid != 0 and not os.path.isdir(os.path.join('/proc/', pid = int(pid)
str(pid))): if pid != 0 and not os.path.isdir(os.path.join('/proc/',
continue str(pid))):
continue
else:
pid = 0
self.refresh_header(pid) self.refresh_header(pid)
self.update_pid(pid) self.update_pid(pid)
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment