This commit is contained in:
adsharma@los-vmm.sc.intel.com committed 2005-08-17 12:33:56 -08:00
commit 14f83cd4d0
25 files changed
+326 -158

No files matched your search

+1 -2
View File
@@ -320,8 +320,7 @@ class XendDomain:
@param vmconfig: vm configuration
"""
config = sxp.child_value(vmconfig, 'config')
uuid = sxp.child_value(vmconfig, 'uuid')
dominfo = XendDomainInfo.restore(self.dbmap, config, uuid=uuid)
dominfo = XendDomainInfo.restore(self.dbmap, config)
return dominfo
def domain_restore(self, src, progress=False):
+9 -1
View File
@@ -195,19 +195,22 @@ class XendDomainInfo:
recreate = classmethod(recreate)
def restore(cls, parentdb, config, uuid):
def restore(cls, parentdb, config, uuid=None):
"""Create a domain and a VM object to do a restore.
@param parentdb: parent db
@param config: domain configuration
@param uuid: uuid to use
"""
if not uuid:
uuid = getUuid()
db = parentdb.addChild(uuid)
vm = cls(db)
ssidref = int(sxp.child_value(config, 'ssidref'))
log.debug('restoring with ssidref='+str(ssidref))
id = xc.domain_create(ssidref = ssidref)
vm.setdom(id)
vm.clear_shutdown()
try:
vm.restore = True
vm.construct(config)
@@ -979,6 +982,11 @@ class XendDomainInfo:
if not reason in ['suspend']:
self.shutdown_pending = {'start':time.time(), 'reason':reason}
def clear_shutdown(self):
db = self.db.addChild("/control")
db['shutdown'] = ""
db.saveDB(save=True)
def send_sysrq(self, key=0):
db = self.db.addChild("/control");
db['sysrq'] = '%c' % key;
+1 -1
View File
@@ -380,7 +380,6 @@ def randomMAC():
@return: MAC address string
"""
random.seed()
mac = [ 0xaa, 0x00, 0x00,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
@@ -689,6 +688,7 @@ def balloon_out(dom0_min_mem, opts):
del xc
def main(argv):
random.seed()
opts = gopts
args = opts.parse(argv)
if opts.vals.help:
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.