X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/602d2e0f6b958aa58ebe1a13b0116efe36423aca..ab1973b52cb6de053cca60b50d058907f88e246b:/host/usr/sbin/invirt-janitor diff --git a/host/usr/sbin/invirt-janitor b/host/usr/sbin/invirt-janitor index 75a637a..6edcca9 100755 --- a/host/usr/sbin/invirt-janitor +++ b/host/usr/sbin/invirt-janitor @@ -40,15 +40,25 @@ def cleanup(): lv_path = '/dev/xenvg/%s' % lv try: + # If the LV name doesn't start with old_, we probably + # don't actually want to be deleting it. + # + # Put it in the try block because we still want to delete + # the state file. + if not lv.startswith('old_'): + continue + syslog.syslog(syslog.LOG_INFO, "Cleaning up LV '%s'" % lv_path) - subprocess.check_call(['/usr/bin/ionice', - '-c', '2', - '-n', '7', - '/bin/dd', - 'if=/dev/zero', - 'of=%s' % lv_path, - 'bs=1M']) + # In a perfect world, this should be erroring out with + # ENOSPC, so we ignore errors + subprocess.call(['/usr/bin/ionice', + '-c', '2', + '-n', '7', + '/bin/dd', + 'if=/dev/zero', + 'of=%s' % lv_path, + 'bs=1M']) # Ignore any errors here, because there's really just not # anything we can do.