direct-io.hg

changeset 12461:76e5bf49cb37

Improve error message when trying to pause / unpause domain 0.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Ewan Mellor <ewan@xensource.com>
date Thu Nov 16 10:26:20 2006 +0000 (2006-11-16)
parents 989fd189f529
children c2bc435da114
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Nov 16 10:25:23 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Nov 16 10:26:20 2006 +0000
     1.3 @@ -948,10 +948,10 @@ class XendDomain:
     1.4              dominfo = self.domain_lookup_nr(domid)
     1.5              if not dominfo:
     1.6                  raise XendInvalidDomain(str(domid))
     1.7 -            
     1.8 +            if dominfo.getDomid() == DOM0_ID:
     1.9 +                raise XendError("Cannot unpause privileged domain %s" % domid)
    1.10              log.info("Domain %s (%d) unpaused.", dominfo.getName(),
    1.11                       int(dominfo.getDomid()))
    1.12 -            
    1.13              dominfo.unpause()
    1.14          except XendInvalidDomain:
    1.15              log.exception("domain_unpause")
    1.16 @@ -973,6 +973,8 @@ class XendDomain:
    1.17              dominfo = self.domain_lookup_nr(domid)
    1.18              if not dominfo:
    1.19                  raise XendInvalidDomain(str(domid))
    1.20 +            if dominfo.getDomid() == DOM0_ID:
    1.21 +                raise XendError("Cannot pause privileged domain %s" % domid)
    1.22              log.info("Domain %s (%d) paused.", dominfo.getName(),
    1.23                       int(dominfo.getDomid()))
    1.24              dominfo.pause()