direct-io.hg

changeset 15443:5d7160564381

xm: Fix xm block-detach error message duplication.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir@xensource.com>
date Sun Jul 01 22:25:27 2007 +0100 (2007-07-01)
parents 7a31e37fec9e
children 93b9161fc920
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Sun Jul 01 22:23:16 2007 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Sun Jul 01 22:25:27 2007 +0100
     1.3 @@ -2168,9 +2168,7 @@ def xm_network_attach(args):
     1.4          server.xend.domain.device_create(dom, vif)
     1.5  
     1.6  
     1.7 -def detach(args, command, deviceClass):
     1.8 -    arg_check(args, command, 2, 3)
     1.9 -
    1.10 +def detach(args, deviceClass):
    1.11      dom = args[0]
    1.12      dev = args[1]
    1.13      try:
    1.14 @@ -2204,12 +2202,13 @@ def xm_block_detach(args):
    1.15              raise OptionError("Cannot find device '%s' in domain '%s'"
    1.16                                % (dev,dom))
    1.17      else:
    1.18 +        arg_check(args, 'block-detach', 2, 3)
    1.19          try:
    1.20 -            detach(args, 'block-detach', 'vbd')
    1.21 +            detach(args, 'vbd')
    1.22              return
    1.23          except:
    1.24              pass
    1.25 -        detach(args, 'block-detach', 'tap')
    1.26 +        detach(args, 'tap')
    1.27  
    1.28  def xm_network_detach(args):
    1.29      if serverType == SERVER_XEN_API:
    1.30 @@ -2227,7 +2226,8 @@ def xm_network_detach(args):
    1.31          else:
    1.32              print "Cannot find device '%s' in domain '%s'" % (devid,dom)
    1.33      else:
    1.34 -        detach(args, 'network-detach', 'vif')
    1.35 +        arg_check(args, 'network-detach', 2, 3)
    1.36 +        detach(args, 'vif')
    1.37  
    1.38  
    1.39  def xm_vnet_list(args):