- data['start_time'] = float(xsc.read('', '%s/start_time' % data['vm']))
- data['uptime'] = time.time()-data['start_time']
-
+ start_time = xsc.read('', '%s/start_time' % data['vm'])
+ if start_time is not None:
+ data['start_time'] = float(start_time)
+ data['uptime'] = time.time()-data['start_time']
+ else:
+ data['uptime'] = 0
+ # CD or autoinstall, if we're using either
+ vbds = xsc.ls('', '/local/domain/%d/device/vbd' % domid)
+ if vbds is not None:
+ for vbd in vbds:
+ dev = '/local/domain/%d/device/vbd/%s' % (domid, vbd)
+ dev_type = xsc.read('', '%s/device-type' % dev)
+ dev_params = xsc.read('', '%s/params' % xsc.read('', '%s/backend' % dev))
+ if dev_type == 'cdrom':
+ data['cdrom'] = dev_params
+ elif dev_type == 'disk' and dev_params == '/dev/xenvg/s_install_hda':
+ data['autoinstall'] = True
+ cmdline = xsc.read('', '%s/image/cmdline' % data['vm'])
+ if cmdline is not None and 'auto=true' in cmdline:
+ data['autoinstall'] = True
+