mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Move variable initialisation out of import section. Remove obsolete save
parameter from XendDominInfo.exportToDB.
This commit is contained in:
1 parent
089412c49e
commit
42a5d02afb
2 files changed
+13
-7
No files matched your search
@@ -23,13 +23,13 @@
|
||||
"""
|
||||
import os
|
||||
|
||||
import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
|
||||
import xen.lowlevel.xc
|
||||
|
||||
from xen.xend import sxp
|
||||
from xen.xend import XendRoot; xroot = XendRoot.instance()
|
||||
from xen.xend import XendRoot
|
||||
from xen.xend import XendCheckpoint
|
||||
from xen.xend.XendDomainInfo import XendDomainInfo, shutdown_reason
|
||||
from xen.xend import EventServer; eserver = EventServer.instance()
|
||||
from xen.xend import EventServer
|
||||
from xen.xend.XendError import XendError
|
||||
from xen.xend.XendLogging import log
|
||||
from xen.xend import scheduler
|
||||
@@ -39,6 +39,12 @@ from xen.xend.xenstore import XenNode, DBMap
|
||||
from xen.xend.xenstore.xstransact import xstransact
|
||||
from xen.xend.xenstore.xsutil import GetDomainPath
|
||||
|
||||
|
||||
xc = xen.lowlevel.xc.new()
|
||||
xroot = XendRoot.instance()
|
||||
eserver = EventServer.instance()
|
||||
|
||||
|
||||
__all__ = [ "XendDomain" ]
|
||||
|
||||
SHUTDOWN_TIMEOUT = 30
|
||||
@@ -182,7 +188,7 @@ class XendDomain:
|
||||
if info.getDomid() in self.domains:
|
||||
notify = False
|
||||
self.domains[info.getDomid()] = info
|
||||
info.exportToDB(save=True)
|
||||
info.exportToDB()
|
||||
if notify:
|
||||
eserver.inject('xend.domain.create', [info.getName(),
|
||||
info.getDomid()])
|
||||
|
||||
@@ -444,7 +444,7 @@ class XendDomainInfo:
|
||||
return xstransact.Store(self.path, *args)
|
||||
|
||||
|
||||
def exportToDB(self, save=False):
|
||||
def exportToDB(self):
|
||||
to_store = {
|
||||
'domid': str(self.domid),
|
||||
'uuid': self.uuid,
|
||||
@@ -718,7 +718,7 @@ class XendDomainInfo:
|
||||
# Create domain devices.
|
||||
self.construct_image()
|
||||
self.configure()
|
||||
self.exportToDB(save=True)
|
||||
self.exportToDB()
|
||||
except Exception, ex:
|
||||
# Catch errors, cleanup and re-raise.
|
||||
print 'Domain construction error:', ex
|
||||
@@ -739,7 +739,7 @@ class XendDomainInfo:
|
||||
ssidref = self.info['ssidref'])
|
||||
if self.domid <= 0:
|
||||
raise VmError('Creating domain failed: name=%s' %
|
||||
self.vm.getName())
|
||||
self.info['name'])
|
||||
|
||||
if self.info['bootloader']:
|
||||
self.image.handleBootloading()
|
||||
|
||||