WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] potential bug in "xm atropos" implementation

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] potential bug in "xm atropos" implementation
From: Diwaker Gupta <diwakergupta@xxxxxxxxx>
Date: Mon, 18 Oct 2004 15:21:38 -0700
Delivery-date: Mon, 18 Oct 2004 23:31:11 +0100
Domainkey-signature: a=rsa-sha1; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=G7V93k6XrTc+N2H5RKumeDVC/5fRl6lNRDH6X/Qj0HiedqyC6PZtvlgHNOe2o516up6gApkU0+zyTSXsuKlRB0FQ6ZPDb9WOqBJih3I1b/cKgygKZzYbQOiDv1IyFYeYK7o/I9CJKTKWHC+SkxmfnplXo7/SSlpTKqKjj6eJNGc
Envelope-to: steven.hand@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Reply-to: Diwaker Gupta <diwakergupta@xxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
>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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>