From 7722e288918d66780014cc3933badeeed8b3273d Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 20 Nov 2024 17:30:56 +0100 Subject: [PATCH] machinedriver: Implement Kill() --- pkg/machinedriver/driver.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/machinedriver/driver.go b/pkg/machinedriver/driver.go index 0b14a63f..e1f3f5ab 100644 --- a/pkg/machinedriver/driver.go +++ b/pkg/machinedriver/driver.go @@ -438,7 +438,13 @@ func (d *Driver) GetState() (state.State, error) { // Kill stops a host forcefully func (d *Driver) Kill() error { - return fmt.Errorf("Kill() unimplemented") + fmt.Printf("Forcefully stopping machine %q\n", d.vmConfig.Name) + if err := d.stop(false); err != nil { + return err + } + //newMachineEvent(events.Stop, events.Event{Name: vmName}) + fmt.Printf("Machine %q forcefully stopped\n", d.vmConfig.Name) + return nil } // Remove a host