Revision 8904b35c

b/lib/hypervisor/hv_kvm.py
631 631
      acpi = instance.hvparams[constants.HV_ACPI]
632 632
    else:
633 633
      acpi = False
634
    pidfile, pid, alive = self._InstancePidAlive(name)
634
    _, pid, alive = self._InstancePidAlive(name)
635 635
    if pid > 0 and alive:
636 636
      if force or not acpi:
637 637
        utils.KillProcess(pid)
638 638
      else:
639 639
        self._CallMonitorCommand(name, 'system_powerdown')
640 640

  
641
    if not self._InstancePidAlive(name)[2]:
642
      self._RemoveInstanceRuntimeFiles(pidfile, name)
643
      return True
644
    else:
645
      return False
641
  def CleanupInstance(self, instance_name):
642
    """Cleanup after a stopped instance
643

  
644
    """
645
    pidfile, pid, alive = self._InstancePidAlive(instance_name)
646
    if pid > 0 and alive:
647
      raise errors.HypervisorError("Cannot cleanup a live instance")
648
    self._RemoveInstanceRuntimeFiles(pidfile, instance_name)
646 649

  
647 650
  def RebootInstance(self, instance):
648 651
    """Reboot an instance.

Also available in: Unified diff