Skip to contentSkip to conversation

scripts/kvm/kvm_stat: Fix missing right parantheses and ".format(...)"

PATCH In review Fam Zheng 4 participants 6 messages Feb 19, 2016 – Feb 25, 2016

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH v2 1/1 scripts/kvm/kvm_stat: Fix missing right parantheses and ".format(...)"

They seem to have snuck in when applying Janosch Frank <[email protected]>'s previous patch.

---
v2: Also fix .format. [Janosch]

---
 scripts/kvm/kvm_stat | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/kvm/kvm_stat +3 -2
index 3cf1181..769d884 100755
@@ -796,11 +796,12 @@ def check_access(options):
         sys.stderr.write("Please enable CONFIG_TRACING in your kernel "
                          "when using the option -t (default).\n"
                          "If it is enabled, make {0} readable by the "
-                         "current user.\n")
+                         "current user.\n"
+                         .format(PATH_DEBUGFS_TRACING))
         if options.tracepoints:
             sys.exit(1)
 
-        sys.stderr.write("Falling back to debugfs statistics!\n"
+        sys.stderr.write("Falling back to debugfs statistics!\n")
         options.debugfs = True
         sleep(5)
 
Signature · 1 line
2.4.3
Reviewed-by Tested-by on v2 1/1
#1 lore raw
Quoted 20 lines · Fam Zheng

They seem to have snuck in when applying Janosch Frank <[email protected]>'s previous patch.

---
v2: Also fix .format. [Janosch]

---
 scripts/kvm/kvm_stat | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/kvm/kvm_stat +0 -1
index 3cf1181..769d884 100755
@@ -796,11 +796,12 @@ def check_access(options):
         sys.stderr.write("Please enable CONFIG_TRACING in your kernel "
                          "when using the option -t (default).\n"
                          "If it is enabled, make {0} readable by the "
-                         "current user.\n")

scripts/kvm/kvm_stat def check_access(options): · line 807

Quoted 10 lines
scripts/kvm/kvm_stat +3 -1
+                         "current user.\n"
+                         .format(PATH_DEBUGFS_TRACING))
         if options.tracepoints:
             sys.exit(1)
 
-        sys.stderr.write("Falling back to debugfs statistics!\n"
+        sys.stderr.write("Falling back to debugfs statistics!\n")
         options.debugfs = True
         sleep(5)
 

Thanks

#2 lore raw
In reply to Fam Zheng
Quoted 16 lines · Fam Zheng

They seem to have snuck in when applying Janosch Frank <[email protected]>'s previous patch.

---
v2: Also fix .format. [Janosch]

---
 scripts/kvm/kvm_stat | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/kvm/kvm_stat +0 -0
index 3cf1181..769d884 100755

scripts/kvm/kvm_stat def check_access(options): · line 800

Quoted 6 lines
scripts/kvm/kvm_stat +2 -1
@@ -796,11 +796,12 @@ def check_access(options):
         sys.stderr.write("Please enable CONFIG_TRACING in your kernel "
                          "when using the option -t (default).\n"
                          "If it is enabled, make {0} readable by the "
-                         "current user.\n")
+                         "current user.\n"
+                         .format(PATH_DEBUGFS_TRACING))

According to ./configure the minimum Python version is 2.4.

str.format() is a Python 2.6+ feature.

Is ./configure wrong (i.e. you are sure that the current crop of stable Debian, Red Hat, and SLES distros have 2.6+)? If so, please fix ./configure.

Otherwise please use traditional Python string formatting instead.

Stefan

Reviewed-by Peter Maydell
#3 lore raw
Quoted 5 lines · Stefan Hajnoczi
Quoted 2 lines
Quoted 2 lines

+ "current user.\n" +
.format(PATH_DEBUGFS_TRACING))

According to ./configure the minimum Python version is 2.4.

str.format() is a Python 2.6+ feature.

This was changed in September 2015:

commit fec21036ff516d20721abc01ae7be99ae5bb0c7b

Author: Markus Armbruster <[email protected]>
Date:   Fri Sep 4 21:53:03 2015 +0200

configure: Require Python 2.6

RHEL-6 and SLES-11 provide Python 2.6. It'll also work on OS X back to 10.6.

Message-Id: <[email protected]>

Are you looking at an older version of the configure script?

Paolo

#4 lore raw
Quoted 20 lines · Paolo Bonzini
Quoted 5 lines · Stefan Hajnoczi
Quoted 2 lines
Quoted 2 lines

+ "current user.\n" +
.format(PATH_DEBUGFS_TRACING))

According to ./configure the minimum Python version is 2.4.

str.format() is a Python 2.6+ feature.

This was changed in September 2015:

commit fec21036ff516d20721abc01ae7be99ae5bb0c7b

Author: Markus Armbruster <[email protected]>
Date:   Fri Sep 4 21:53:03 2015 +0200

configure: Require Python 2.6

RHEL-6 and SLES-11 provide Python 2.6. It'll also work on OS X back to 10.6.

Quoted 6 lines

Message-Id: <[email protected]>

Are you looking at an older version of the configure script?

Yes, I must have been. Thanks for pointing out the change.

Stefan

#5 lore raw
In reply to Fam Zheng
Quoted 21 lines · Fam Zheng

They seem to have snuck in when applying Janosch Frank <[email protected]>'s previous patch.

---
v2: Also fix .format. [Janosch]

---
 scripts/kvm/kvm_stat | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/kvm/kvm_stat +0 -1
index 3cf1181..769d884 100755
@@ -796,11 +796,12 @@ def check_access(options):
         sys.stderr.write("Please enable CONFIG_TRACING in your kernel "
                          "when using the option -t (default).\n"
                          "If it is enabled, make {0} readable by the "
-                         "current user.\n")

scripts/kvm/kvm_stat def check_access(options): · line 807

Quoted 10 lines
scripts/kvm/kvm_stat +3 -1
+                         "current user.\n"
+                         .format(PATH_DEBUGFS_TRACING))
         if options.tracepoints:
             sys.exit(1)
 
-        sys.stderr.write("Falling back to debugfs statistics!\n"
+        sys.stderr.write("Falling back to debugfs statistics!\n")
         options.debugfs = True
         sleep(5)
 

Thanks Fam, I'll send a pull request soon.

Paolo