Skip to content

Commit

Permalink
Fix kvm2 vm driver remove domain
Browse files Browse the repository at this point in the history
  • Loading branch information
josedonizetti authored and medyagh committed Jun 27, 2019
1 parent 0900b2b commit d6a839b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/drivers/kvm/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,13 @@ func (d *Driver) Remove() error {
}

func (d *Driver) destroyRunningDomain(dom *libvirt.Domain) error {
state, reason, err := dom.GetState()
state, _, err := dom.GetState()
if err != nil {
return errors.Wrap(err, "getting domain state")
}

if state == libvirt.DOMAIN_SHUTOFF && reason == int(libvirt.DOMAIN_SHUTOFF_DESTROYED) {
// if the domain is not running, we don't destroy it
if state != libvirt.DOMAIN_RUNNING {
log.Warnf("Domain %s already destroyed, skipping...", d.MachineName)
return nil
}
Expand Down

0 comments on commit d6a839b

Please sign in to comment.