From 3c7dae7507abb6ebe8c2dd9a4ef76e55135c8acd Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Tue, 17 Oct 2017 19:15:39 +0200
Subject: [PATCH 34/69] tools/kvm_stat: remove regex filter on empty input
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
RH-Author: David Hildenbrand <david@redhat.com>
Message-id: <20171017191605.2378-14-david@redhat.com>
Patchwork-id: 77322
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH 13/39] tools/kvm_stat: remove regex filter on empty input
Bugzilla: 1497137
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Upstream-status: linux.git 645c1728a9d33d78028d93a2ed770f51df0a92c6
commit 645c1728a9d33d78028d93a2ed770f51df0a92c6
Author: Stefan Raspl <raspl@linux.vnet.ibm.com>
Date: Fri Mar 10 13:40:12 2017 +0100
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>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
scripts/kvm/kvm_stat | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index af70717..f2a868b 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -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:
--
1.8.3.1