All of lore.kernel.org
 help / color / mirror / Atom feed
* potential bug in "xm atropos" implementation
@ 2004-10-18 22:21 Diwaker Gupta
  2004-10-18 23:00 ` Christian Limpach
  0 siblings, 1 reply; 4+ messages in thread
From: Diwaker Gupta @ 2004-10-18 22:21 UTC (permalink / raw)
  To: xen-devel

>From tools/libxc/xc_atropos.c:

int xc_atropos_domain_set(int xc_handle,
                          u32 domid, u64 period, u64 slice, u64 latency,
                          int xtratime)

which takes 6 arguments

>From tools/python/xen/xm/main.py:
class ProgAtropos(Prog):
<snip>
    def main(self, args):
        if len(args) != 5: self.err("%s: Invalid argument(s)" % args[0])
        dom = args[1]
        v = map(int, args[2:5])
        server.xend_domain_cpu_atropos_set(dom, *v)

Now if you specify all 6 arguments on the command line, xm atropos
fails with "Invalid arguments" due to the above code. If you give 5
arguments, ProgAtropos fails since the corresponding libxc function
call takes 6 arguments.

Following patch will fix it:
Index: main.py
===================================================================
--- main.py     (revision 185)
+++ main.py     (working copy)
@@ -579,9 +579,9 @@
         print "\nSet atropos parameters."

     def main(self, args):
-        if len(args) != 5: self.err("%s: Invalid argument(s)" % args[0])
+        if len(args) != 6: self.err("%s: Invalid argument(s)" % args[0])
         dom = args[1]
-        v = map(int, args[2:5])
+        v = map(int, args[2:6])
         server.xend_domain_cpu_atropos_set(dom, *v)

 xm.prog(ProgAtropos)

-- 
Diwaker Gupta
http://resolute.ucsd.edu/diwaker


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-18 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-18 22:21 potential bug in "xm atropos" implementation Diwaker Gupta
2004-10-18 23:00 ` Christian Limpach
2004-10-18 23:30   ` Diwaker Gupta
2004-10-18 23:56     ` Christian Limpach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.