mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
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:
1 parent
72835ed4aa
commit
c9577eb490
2 files changed
+16
-2
No files matched your search
@@ -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.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||