tools/kvm_stat: remove regex filter on empty input
authorStefan Raspl <raspl@linux.vnet.ibm.com>
Fri, 10 Mar 2017 12:40:12 +0000 (13:40 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 Mar 2017 10:01:30 +0000 (12:01 +0200)
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>
tools/kvm/kvm_stat/kvm_stat

index af7071778a0c0ae4cc4d97ee4eefbd91edcd50bb..f2a868b696a8cd9898c210db09337392083ff0c7 100755 (executable)
@@ -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: