def _populate_from_python_config(self, parsed_py):
raise NotImplementedError
-
+
+ def _get_old_state_string(self):
+ state_string = ''
+ for state_name in CONFIG_OLD_DOM_STATES:
+ on_off = self.get(state_name, 0)
+ if on_off:
+ state_string += state_name[0]
+ else:
+ state_string += '-'
+
+ return state_string
def get_sxp(self, domain = None, ignore_devices = False, ignore = []):
""" Get SXP representation of this config object.
else:
sxpr.append(['status', str(DOM_STATE_HALTED)])
+ sxpr.append(['state', self._get_old_state_string()])
+
# For save/restore migration
if domain:
if domain.store_mfn:
'name' : get_info('name', str, '??'),
'mem' : get_info('memory', int, 0),
'vcpus' : get_info('online_vcpus', int, 0),
- 'status' : get_status('status', int, DOM_STATE_HALTED),
+ 'state' : get_info('state', str, ''),
'cpu_time' : get_info('cpu_time', float, 0),
'up_time' : get_info('up_time', float, -1),
'seclabel' : security.get_security_printlabel(info),
print '%-40s %3s %5s %5s %10s %9s' % \
('Name', 'ID', 'Mem', 'VCPUs', 'State', 'Time(s)')
- format = "%(name)-40s %(domid)3d %(mem)5d %(vcpus)5d %(status)10s " \
+ format = "%(name)-40s %(domid)3d %(mem)5d %(vcpus)5d %(state)10s " \
"%(cpu_time)8.1f"
for dom in doms:
('Name', 'ID', 'Mem', 'VCPUs', 'State', 'Time(s)', 'Label')
output = []
- format = '%(name)-32s %(domid)3d %(mem)5d %(vcpus)5d %(status)10s ' \
+ format = '%(name)-32s %(domid)3d %(mem)5d %(vcpus)5d %(state)10s ' \
'%(cpu_time)8.1f %(seclabel)9s'
for dom in doms: