Skip to contentSkip to conversation

Fix sched commands for when wrong domain is given

PATCH Applied Masaki Kanno 2 participants 2 messages Jan 31, 2007 – Feb 6, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix sched commands for when wrong domain is given

Hi,

I found strange issues. I gave a wrong domain name to the xm sched commands. The xm sched commands only showed the header at that time. And the xm sched-sedf command did not become an error when I tried to set scheduler parameters.

# xm sched-credit -d Nonexistent-domain
Name                              ID Weight Cap 
# xm sched-sedf Nonexistent-domain
Name                              ID Period(ms) Slice(ms) Lat(ms) Extra Weight
# xm sched-sedf Nonexistent-domain -w 10
# 

I fixed it. When the wrong domain name is given, the xm sched commands show the following error messages.

# xm sched-credit -d Nonexistent-domain
Error: Domain 'Nonexistent-domain' does not exist.
Usage: xm sched-credit [-d <Domain> [-w[=WEIGHT]|-c[=CAP]]]

Get/set credit scheduler parameters.

  -d DOMAIN, --domain=DOMAIN     Domain to modify 
  -w WEIGHT, --weight=WEIGHT     Weight (int) 
  -c CAP, --cap=CAP              Cap (int) 
# xm sched-sedf Nonexistent-domain
Error: Domain 'Nonexistent-domain' does not exist.
Usage: xm sched-sedf <Domain> [options]

Get/set EDF parameters.
-p [MS], --period[=MS] Relative deadline(ms)
-s [MS], --slice[=MS] Worst-case execution time(ms). (slice <
period)
-l [MS], --latency[=MS] Scaled period (ms) when domain performs
heavy I/O
-e [FLAG], --extra[=FLAG] Flag (0 or 1) controls if domain can run
in extra time.
-w [FLOAT], --weight[=FLOAT] CPU Period/slice (do not set with

                                 --period/--slice)
# xm sched-sedf Nonexistent-domain -w 10
Error: Domain 'Nonexistent-domain' does not exist.
Usage: xm sched-sedf <Domain> [options]

Get/set EDF parameters.
-p [MS], --period[=MS] Relative deadline(ms)
-s [MS], --slice[=MS] Worst-case execution time(ms). (slice <
period)
-l [MS], --latency[=MS] Scaled period (ms) when domain performs
heavy I/O
-e [FLAG], --extra[=FLAG] Flag (0 or 1) controls if domain can run
in extra time.
-w [FLOAT], --weight[=FLOAT] CPU Period/slice (do not set with

                                 --period/--slice)

Best regards,
Kan

tools/python/xen/xm/main.py +6 -0
diff -r 5e8da0663ff8 tools/python/xen/xm/main.py
@@ -1144,6 +1144,9 @@ def xm_sched_sedf(args):
     doms = filter(lambda x : domid_match(domid, x),
                         [parse_doms_info(dom)
                          for dom in getDomains(None, 'running')])
+    if domid is not None and doms == []: 
+        err("Domain '%s' does not exist." % domid)
+        usage('sched-sedf')
 
     # print header if we aren't setting any parameters
     if len(opts.keys()) == 0:
@@ -1207,6 +1210,9 @@ def xm_sched_credit(args):
                   for dom in getDomains(None, 'running')])
 
     if weight is None and cap is None:
+        if domid is not None and doms == []: 
+            err("Domain '%s' does not exist." % domid)
+            usage('sched-credit')
         # print header if we aren't setting any parameters
         print '%-33s %-2s %-6s %-4s' % ('Name','ID','Weight','Cap')
         

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Applied
#1 lore raw

On Wed, Jan 31, 2007 at 11:28:39AM +0900, Masaki Kanno wrote:

Content-Description: Mail message body

Quoted 56 lines

Hi,

I found strange issues. I gave a wrong domain name to the xm sched commands. The xm sched commands only showed the header at that time. And the xm sched-sedf command did not become an error when I tried to set scheduler parameters.

# xm sched-credit -d Nonexistent-domain
Name                              ID Weight Cap 
# xm sched-sedf Nonexistent-domain
Name                              ID Period(ms) Slice(ms) Lat(ms) Extra Weight
# xm sched-sedf Nonexistent-domain -w 10
# 

I fixed it. When the wrong domain name is given, the xm sched commands show the following error messages.

# xm sched-credit -d Nonexistent-domain
Error: Domain 'Nonexistent-domain' does not exist.
Usage: xm sched-credit [-d <Domain> [-w[=WEIGHT]|-c[=CAP]]]

Get/set credit scheduler parameters.

  -d DOMAIN, --domain=DOMAIN     Domain to modify 
  -w WEIGHT, --weight=WEIGHT     Weight (int) 
  -c CAP, --cap=CAP              Cap (int) 
# xm sched-sedf Nonexistent-domain
Error: Domain 'Nonexistent-domain' does not exist.
Usage: xm sched-sedf <Domain> [options]

Get/set EDF parameters.
-p [MS], --period[=MS] Relative deadline(ms)
-s [MS], --slice[=MS] Worst-case execution time(ms). (slice <
period)
-l [MS], --latency[=MS] Scaled period (ms) when domain performs
heavy I/O
-e [FLAG], --extra[=FLAG] Flag (0 or 1) controls if domain can run
in extra time.
-w [FLOAT], --weight[=FLOAT] CPU Period/slice (do not set with

                                 --period/--slice)
# xm sched-sedf Nonexistent-domain -w 10
Error: Domain 'Nonexistent-domain' does not exist.
Usage: xm sched-sedf <Domain> [options]

Get/set EDF parameters.
-p [MS], --period[=MS] Relative deadline(ms)
-s [MS], --slice[=MS] Worst-case execution time(ms). (slice <
period)
-l [MS], --latency[=MS] Scaled period (ms) when domain performs
heavy I/O
-e [FLAG], --extra[=FLAG] Flag (0 or 1) controls if domain can run
in extra time.
-w [FLOAT], --weight[=FLOAT] CPU Period/slice (do not set with

Quoted 4 lines
                                 --period/--slice)

Applied, thank you.

Ewan.