[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tools:misc:xenpm: set max freq to all cpu with default cpuid



commit c1f9b9d77ceecb9fb782e4ab98ec3b94cf22dab8
Author:     Luwei Kang <luwei.kang@xxxxxxxxx>
AuthorDate: Thu Apr 13 18:44:28 2017 +0800
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Thu Apr 13 16:27:46 2017 +0100

    tools:misc:xenpm: set max freq to all cpu with default cpuid
    
    User can set max freq to specific cpu by
    "xenpm set-scaling-maxfreq [cpuid] <HZ>"
    or set max freq to all cpu with default cpuid by
    "xenpm set-scaling-maxfreq <HZ>".
    
    Set max freq with default cpuid will cause
    segmentation fault after commit id d4906b5d05.
    This patch will fix this issue and add ability
    to set max freq with default cpuid.
    
    Signed-off-by: Luwei Kang <luwei.kang@xxxxxxxxx>
    Compile-tested-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Release-acked-by: Julien Grall <julien.grall@xxxxxxx>
---
 tools/misc/xenpm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index ded40b9..762311e 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -99,10 +99,12 @@ static void parse_cpuid_and_int(int argc, char *argv[],
          exit(EINVAL);
     }
 
-    parse_cpuid(argv[0], cpuid);
-    if ( sscanf(argv[1], "%d", val) != 1 )
+    if ( argc > 1 )
+        parse_cpuid(argv[0], cpuid);
+
+    if ( sscanf(argv[argc > 1], "%d", val) != 1 )
     {
-        fprintf(stderr, "Invalid %s '%s'\n", what, argv[1]);
+        fprintf(stderr, "Invalid %s '%s'\n", what, argv[argc > 1]);
         exit(EINVAL);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.