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

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