]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tools/kvm_stat: fix extra handling of 'help' with fields filter
authorStefan Raspl <stefan.raspl@de.ibm.com>
Mon, 11 Dec 2017 11:25:22 +0000 (12:25 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 14 Dec 2017 08:25:43 +0000 (09:25 +0100)
Commit 67fbcd62f54d ("tools/kvm_stat: add '-f help' to get the available
event list") added support for '-f help'. However, the extra handling of
'help' will also take effect when 'help' is specified as a regex in
interactive mode via 'f'. This results in display of all events while
only those matching this regex should be shown.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/kvm/kvm_stat/kvm_stat

index f133755fdde259ea15f73afc1bf78ba646a8d692..4faf9f85a00e19c7f1e5f6ace6b1e94868a84976 100755 (executable)
@@ -478,7 +478,7 @@ class Provider(object):
     @staticmethod
     def is_field_wanted(fields_filter, field):
         """Indicate whether field is valid according to fields_filter."""
-        if not fields_filter or fields_filter == "help":
+        if not fields_filter:
             return True
         return re.match(fields_filter, field) is not None
 
@@ -1567,6 +1567,7 @@ def main():
     stats = Stats(options)
 
     if options.fields == "help":
+        stats.fields_filter = None
         event_list = "\n"
         s = stats.get()
         for key in s.keys():