[Qemu-devel] [PATCH] vmxcap: Fix output formatting

Stefan Fritsch posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1500538486-23453-1-git-send-email-sf@sfritsch.de
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
scripts/kvm/vmxcap | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] vmxcap: Fix output formatting
Posted by Stefan Fritsch 6 years, 9 months ago
From: Stefan Fritsch <stefan_fritsch@genua.de>

One string is longer than 40 chars. Set the field width to 50.

Signed-off-by: Stefan Fritsch <stefan_fritsch@genua.de>
---
 scripts/kvm/vmxcap | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap
index d9a6db0bb7..19506f45bf 100755
--- a/scripts/kvm/vmxcap
+++ b/scripts/kvm/vmxcap
@@ -69,7 +69,7 @@ class Control(object):
                 s = 'forced'
             elif one and zero:
                 s = 'yes'
-            print('  %-40s %s' % (self.bits[bit], s))
+            print('  %-50s %s' % (self.bits[bit], s))
 
 class Misc(object):
     def __init__(self, name, bits, msr):
@@ -94,7 +94,7 @@ class Misc(object):
                 def fmt(x):
                     return { True: 'yes', False: 'no' }[x]
             v = (value >> lo) & ((1 << (hi - lo + 1)) - 1)
-            print('  %-40s %s' % (self.bits[bits], fmt(v)))
+            print('  %-50s %s' % (self.bits[bits], fmt(v)))
 
 controls = [
     Misc(
-- 
2.11.0


Re: [Qemu-devel] [PATCH] vmxcap: Fix output formatting
Posted by Michael Tokarev 6 years, 6 months ago
Please excuse me for the long delay with this patch.

20.07.2017 11:14, Stefan Fritsch wrote:
> From: Stefan Fritsch <stefan_fritsch@genua.de>
> 
> One string is longer than 40 chars. Set the field width to 50.

The string is this one, I guess:

Miscellaneous data
  Hex: 0x100401e5
  VMX-preemption timer scale (log2)        5
  Store EFER.LMA into IA-32e mode guest control yes
  HLT activity state                       yes
  Shutdown activity state                  yes

While technically after this change, it will be aligned
in one column, I think it is better to reword this one
entry instead: when widening the alignment column, the
whole thing becomes less and less readable, it is more
difficult this way to follow which value correspond to
which entry.

A better wording for this one entry is welcome :)

Thanks,

/mjt