Blame SOURCES/kvm-tools-kvm_stat-remove-pid-filter-on-empty-input.patch

4a2fec
From 66f2e8203e1d29f8ec656f5e333dbc1f13229f9f Mon Sep 17 00:00:00 2001
4a2fec
From: David Hildenbrand <david@redhat.com>
4a2fec
Date: Tue, 17 Oct 2017 19:15:36 +0200
4a2fec
Subject: [PATCH 31/69] tools/kvm_stat: remove pid filter on empty input
4a2fec
MIME-Version: 1.0
4a2fec
Content-Type: text/plain; charset=UTF-8
4a2fec
Content-Transfer-Encoding: 8bit
4a2fec
4a2fec
RH-Author: David Hildenbrand <david@redhat.com>
4a2fec
Message-id: <20171017191605.2378-11-david@redhat.com>
4a2fec
Patchwork-id: 77320
4a2fec
O-Subject: [RHEL-7.5 qemu-kvm-rhev PATCH 10/39] tools/kvm_stat: remove pid filter on empty input
4a2fec
Bugzilla: 1497137
4a2fec
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
4a2fec
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
4a2fec
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
4a2fec
Upstream-status: linux.git be03ea3b77387db36617d71d60ee182a866fb9cd
4a2fec
4a2fec
commit be03ea3b77387db36617d71d60ee182a866fb9cd
4a2fec
Author: Stefan Raspl <raspl@linux.vnet.ibm.com>
4a2fec
Date:   Fri Mar 10 13:40:09 2017 +0100
4a2fec
4a2fec
    tools/kvm_stat: remove pid filter on empty input
4a2fec
4a2fec
    Improve consistency in the interactive dialogue for pid filtering by
4a2fec
    removing any filters on empty input (in addition to entering 0).
4a2fec
4a2fec
    Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
4a2fec
    Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com>
4a2fec
    Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
4a2fec
    Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
4a2fec
4a2fec
Signed-off-by: David Hildenbrand <david@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 scripts/kvm/kvm_stat | 11 +++++++----
4a2fec
 1 file changed, 7 insertions(+), 4 deletions(-)
4a2fec
4a2fec
diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
4a2fec
index 95ffa9a..9e9eb98 100755
4a2fec
--- a/scripts/kvm/kvm_stat
4a2fec
+++ b/scripts/kvm/kvm_stat
4a2fec
@@ -991,10 +991,13 @@ class Tui(object):
4a2fec
             curses.noecho()
4a2fec
 
4a2fec
             try:
4a2fec
-                pid = int(pid)
4a2fec
-                if pid != 0 and not os.path.isdir(os.path.join('/proc/',
4a2fec
-                                                               str(pid))):
4a2fec
-                    continue
4a2fec
+                if len(pid) > 0:
4a2fec
+                    pid = int(pid)
4a2fec
+                    if pid != 0 and not os.path.isdir(os.path.join('/proc/',
4a2fec
+                                                                   str(pid))):
4a2fec
+                        continue
4a2fec
+                else:
4a2fec
+                    pid = 0
4a2fec
                 self.refresh_header(pid)
4a2fec
                 self.update_pid(pid)
4a2fec
                 break
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec