// Stops a virtual machine.
348603
func (c *Client) StopVirtualMachine(p *StopVirtualMachineParameter) (*VirtualMachine, error) {
	obj, err := c.Request("stopVirtualMachine", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*VirtualMachine), err
}
140492
func (fw *Checkpoint) Stop(ctx context.Context, info map[string]string) (bool, error) {
	log.LoggerWContext(ctx).Warn("SSO Stop is not available for this firewall")
	return false, nil
}
699476
func (s *Syslog) Stop() {
	s.mu.Lock()
	defer s.mu.Unlock()

	if s.Closer != nil {
		s.Close()
	}
	s.wg.Wait()
}
130765
func (p *Provider) Stop() error {
	p.stopOnce.Do(p.stopInit)

	p.stopMu.Lock()
	defer p.stopMu.Unlock()

	p.stopCtxCancel()
	return nil
}
524018
func (s *ServergRPC) Stop() (err error) {
	s.m.Lock()
	defer s.m.Unlock()
	if s.grpcServer != nil {
		s.grpcServer.GracefulStop()
	}
	return
}
691777
func (cmd *Cmd) Stop() error {
	cmd.stoppingValue.Store(true)
	if err := cmd.Process.Signal(syscall.SIGKILL); err != nil {
		return err
	}
	return nil
}
986013
func (c *PCPClient) Stop() error {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	if !c.r.mapped {
		return errors.New("trying to stop an already stopped mapping")
	}

	c.stop()

	c.r.mapped = false

	err := c.writer.(*bytewriter.MemoryMappedWriter).Unmap(EraseFileOnStop)
	c.writer = nil
	if err != nil {
		return errors.Wrap(err, "client: error unmapping MemoryMappedBuffer")
	}

	return nil
}
67024
func (s *Harness) Stop() {
	var err error
	if s.etcdServer != nil {
		if err := s.etcdServer.Process.Kill(); err != nil {
			fmt.Printf("failed killing etcd process: %v", err)
		}
		// Just to make sure we actually finish it before continuing.
		s.etcdServer.Wait()
	}
	if s.etcdDir != "" {
		if err = os.RemoveAll(s.etcdDir); err != nil {
			fmt.Printf("failed clearing temporary dir: %v", err)
		}
	}
}
1104257
func (s *Instancer) Stop() {
	q := make(chan struct{})
	s.quitc <- q
	<-q
	s.quitc = nil
}
910795
func (command *Command) Stop() {
	if err := command.checkStarted(); err != nil {
		return
	}
	command.Proc.Signal(syscall.SIGHUP)
}
1294636
func (vm *VM) Halt() error {
	// Set up the authorizer
	tok, err := getServicePrincipalToken(&vm.Creds, azure.PublicCloud.ResourceManagerEndpoint)
	if err != nil {
		return err
	}
	authorizer := autorest.NewBearerAuthorizer(tok)

	// Poweroff the VM
	virtualMachinesClient := compute.NewVirtualMachinesClient(vm.Creds.SubscriptionID)
	virtualMachinesClient.Authorizer = authorizer

	_, errc := virtualMachinesClient.PowerOff(vm.ResourceGroup, vm.Name, nil)
	if err := <-errc; err != nil {
		return err
	}

	// Make sure the VM is stopped
	for i := 0; i < actionTimeout; i++ {
		state, err := vm.GetState()
		if err != nil {
			return err
		}
		if state == lvm.VMHalted {
			return nil
		}

		time.Sleep(1 * time.Second)
	}
	return ErrActionTimeout
}
645919
func (vm *InprocVM) Stop(ccid ccintf.CCID, timeout uint, dontkill bool, dontremove bool) error {
	path := ccid.GetName()

	ipctemplate := vm.registry.getType(path)
	if ipctemplate == nil {
		return fmt.Errorf("%s not registered", path)
	}

	instName := vm.GetVMName(ccid)

	ipc := vm.registry.getInstance(instName)
	if ipc == nil {
		return fmt.Errorf("%s not found", instName)
	}

	if !ipc.running {
		return fmt.Errorf("%s not running", instName)
	}

	ipc.running = false
	close(ipc.stopChan)
	vm.registry.removeInstance(instName)

	//TODO stop
	return nil
}
443647
func (i *Instance) Stop() error {
	// stop the servers
	for _, s := range i.servers {
		if gs, ok := s.server.(GracefulServer); ok {
			if err := gs.Stop(); err != nil {
				log.Printf("[ERROR] Stopping %s: %v", gs.Address(), err)
			}
		}
	}

	// splice i out of instance list, causing it to be garbage-collected
	instancesMu.Lock()
	for j, other := range instances {
		if other == i {
			instances = append(instances[:j], instances[j+1:]...)
			break
		}
	}
	instancesMu.Unlock()

	return nil
}
1233639
func (c *client) Stop() {
	c.active = false
	close(c.quit)
	c.Close()
}
252176
func (vm *VM) Destroy() (err error) {
	err = vm.haltWithFlag(true)
	if err != nil {
		return err
	}
	if vm.Dst != "" {
		err = os.RemoveAll(vm.Dst)
		if err != nil {
			err = lvm.ErrDeletingVM
			return
		}
	}
	return
}
395439
func (vm *VM) Suspend() error {
	if vm.MockSuspend != nil {
		return vm.MockSuspend()
	}
	return lvm.ErrNotImplemented
}
666776
func (s *InternalLBService) StopInternalLoadBalancerVM(p *StopInternalLoadBalancerVMParams) (*StopInternalLoadBalancerVMResponse, error) {
	resp, err := s.cs.newRequest("stopInternalLoadBalancerVM", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r StopInternalLoadBalancerVMResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}