From 9f88189ca1aaa08faf6bca2a9fb0ae95393a7b5d Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Wed, 10 Jun 2009 17:47:04 -0400 Subject: [PATCH] In invirt-remote: * If a particular VM is being autoinstalled, include that in the invirt-listvms output. svn path=/trunk/packages/invirt-remote/; revision=2351 --- debian/changelog | 7 +++++++ host/usr/sbin/invirt-listvms | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index af6a9b0..2c1de9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-remote (0.3.15) unstable; urgency=low + + * If a particular VM is being autoinstalled, include that in the + invirt-listvms output. + + -- Evan Broder Wed, 10 Jun 2009 14:46:39 -0700 + invirt-remote (0.3.14) unstable; urgency=low * Maybe we won't be /quite/ so ionice to the dd over a deleted LV. diff --git a/host/usr/sbin/invirt-listvms b/host/usr/sbin/invirt-listvms index 0f9d5dc..d71d6eb 100755 --- a/host/usr/sbin/invirt-listvms +++ b/host/usr/sbin/invirt-listvms @@ -32,12 +32,16 @@ def get_dom(domid): data['vm'] = xsc.read('', '/local/domain/%d/vm' % domid) data['start_time'] = float(xsc.read('', '%s/start_time' % data['vm'])) data['uptime'] = time.time()-data['start_time'] - # CD, if there is one + # CD or autoinstall, if we're using either vbds = xsc.ls('', '/local/domain/%d/device/vbd' % domid) for vbd in vbds: dev = '/local/domain/%d/device/vbd/%s' % (domid, vbd) - if xsc.read('', '%s/device-type' % dev) == 'cdrom': - data['cdrom'] = xsc.read('', '%s/params' % xsc.read('', '%s/backend' % dev)) + 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 return name, data -- 1.7.9.5