提交 be03ea3b 编写于 作者: S Stefan Raspl 提交者: 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: NStefan Raspl <raspl@linux.vnet.ibm.com>
Reviewed-by: NJanosch Frank <frankja@linux.vnet.ibm.com>
Reviewed-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册