tools/kvm_stat: remove regex filter on empty input

Behavior on empty/0 input for regex and pid filtering was inconsistent, as
the former would keep the current filter, while the latter would (naturally)
remove any pid filtering.
Make things consistent by falling back to the default filter on empty input
for the regex filter dialogue.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:
Stefan Raspl 2017-03-10 13:40:12 +01:00 committed by Paolo Bonzini
parent 72187dfa8e
commit 645c1728a9
1 changed files with 1 additions and 0 deletions

View File

@ -966,6 +966,7 @@ class Tui(object):
regex = self.screen.getstr()
curses.noecho()
if len(regex) == 0:
self.stats.fields_filter = r'^[^\(]*$'
self.refresh_header()
return
try: