Added method XendDomain.privilegedDomain and use that inside DevController to

avoid hard-coding the domain ID 0.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@ewan committed 2005-10-04 00:21:49 +01:00
1 parent 72835ed4aa
commit c9577eb490
2 files changed
+16 -2

No files matched your search

+5
View File
@@ -284,6 +284,11 @@ class XendDomain:
pass
return dominfo
def privilegedDomain(self):
return self.domains[PRIV_DOMAIN]
def domain_unpause(self, id):
"""Unpause domain execution.
+11 -2
View File
@@ -189,8 +189,17 @@ class DevController:
"""
import xen.xend.XendDomain
backdom = xen.xend.XendDomain.instance().domain_lookup_by_name(
sxp.child_value(config, 'backend', '0'))
xd = xen.xend.XendDomain.instance()
backdom_name = sxp.child_value(config, 'backend')
if backdom_name:
backdom = xd.domain_lookup_by_name(backdom_name)
else:
backdom = xd.privilegedDomain()
if not backdom:
raise VmError("Cannot configure device for unknown backend %s" %
backdom_name)
frontpath = self.frontendPath(devid)
backpath = self.backendPath(backdom, devid)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.