code: func (r *runtimeVM) UpdateContainerStatus(c *Container) error {
  	logrus.Debug("runtimeVM.UpdateContainerStatus() start")
  	defer logrus.Debug("runtimeVM.UpdateContainerStatus() end")
  
  	// Lock the container
  	c.opLock.Lock()
  	defer c.opLock.Unlock()
  
  	response, err := r.task.State(r.ctx, &task.StateRequest{
  		ID: c.ID(),
  	})
  	if err != nil {
  		if errors.Cause(err) != ttrpc.ErrClosed {
  			return errdefs.FromGRPC(err)
  		}
  		return errdefs.ErrNotFound
  	}
  
  	status := c.state.Status
  	switch response.Status {
  	case tasktypes.StatusCreated:
  		status = ContainerStateCreated
  	case tasktypes.StatusRunning:
  		status = ContainerStateRunning
  	case tasktypes.StatusStopped:
  		status = ContainerStateStopped
  	case tasktypes.StatusPaused:
  		status = ContainerStatePaused
  	}
  
  	c.state.Status = status
  	c.state.Finished = response.ExitedAt
  	c.state.ExitCode = int32(response.ExitStatus)
  
  	return nil
  }
docs: // UpdateContainerStatus refreshes the status of the container.