[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] xend: stubdom console based save/restore
Add "special" PV consoles to handle save/restore state files of stubdom qemu-xen. Signed-off-by: Igor Pavlikevich <ipavlikevich@xxxxxxxxx> --- tools/python/xen/xend/XendConfig.py | 1 + tools/python/xen/xend/XendDomainInfo.py | 11 ++++++++++- tools/python/xen/xend/image.py | 6 ++++-- tools/python/xen/xend/server/DevController.py | 19 ++++++++++++++----- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 9c47e56..3ff8719 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1889,6 +1889,7 @@ class XendConfig(dict): 'uuid': dev_uuid, 'protocol': protocol, 'location': location, + 'output': '', 'other_config': other_config, } diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 456e325..6f83342 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -75,6 +75,8 @@ from xen.xend.XendDSCSI import XendDSCSI, XendDSCSI_HBA MIGRATE_TIMEOUT = 30.0 BOOTLOADER_LOOPBACK_DEVICE = '/dev/xvdp' +XM_DEVICE_MODEL_SAVE_FILE = '/var/lib/xen/qemu-save' +XM_DEVICE_MODEL_RESTORE_FILE = '/var/lib/xen/qemu-resume' xc = xen.lowlevel.xc.xc() xoptions = XendOptions.instance() @@ -1627,7 +1629,14 @@ class XendDomainInfo: serial_consoles = self.info.console_get_all('vt100') if not serial_consoles: cfg = self.info.console_add('vt100', self.console_port) - self._createDevice('console', cfg) + if self.info['PV_kernel'].find('stubdom') > -1 : + self._createDevice('console', cfg) + cfg['output'] = 'file:'+XM_DEVICE_MODEL_SAVE_FILE+'.'+str(self.domid-1) + self._createDevice('console', cfg) + cfg['output'] = 'pipe:'+XM_DEVICE_MODEL_RESTORE_FILE+'.'+str(self.domid-1) + self._createDevice('console', cfg) + else: + self._createDevice('console', cfg) else: console_uuid = serial_consoles[0].get('uuid') self.info.console_update(console_uuid, 'location', diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 832c168..f845751 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -471,7 +471,8 @@ class ImageHandler: if self.device_model.find('stubdom-dm') > -1 : from xen.xend import XendDomain domains = XendDomain.instance() - domains.domains_lock.release() + if not restore: + domains.domains_lock.release() count = 0 while True: @@ -488,7 +489,8 @@ class ImageHandler: if count > 100: break - domains.domains_lock.acquire() + if not restore: + domains.domains_lock.acquire() def signalDeviceModel(self, cmd, ret, par = None): if self.device_model is None: diff --git a/tools/python/xen/xend/server/DevController.py b/tools/python/xen/xend/server/DevController.py index 0431cc2..e45d375 100644 --- a/tools/python/xen/xend/server/DevController.py +++ b/tools/python/xen/xend/server/DevController.py @@ -498,6 +498,7 @@ class DevController: xd = xen.xend.XendDomain.instance() backdom_name = config.get('backend') + output = config.get('output') if backdom_name: backdom = xd.domain_lookup_nr(backdom_name) else: @@ -510,11 +511,19 @@ class DevController: frontpath = self.frontendPath(devid) backpath = self.backendPath(backdom, devid) - frontDetails.update({ - 'backend' : backpath, - 'backend-id' : "%i" % backdom.getDomid(), - 'state' : str(xenbusState['Initialising']) - }) + if output != '' and output != None: + frontDetails.update({ + 'backend' : backpath, + 'backend-id' : "%i" % backdom.getDomid(), + 'state' : str(xenbusState['Initialising']), + 'output' : output + }) + else: + frontDetails.update({ + 'backend' : backpath, + 'backend-id' : "%i" % backdom.getDomid(), + 'state' : str(xenbusState['Initialising']) + }) if self.vm.native_protocol: frontDetails.update({'protocol' : self.vm.native_protocol}) -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |