code: func CreateSnapDevice(poolName string, deviceID int, baseName string, baseDeviceID int) error {
  	devinfo, _ := GetInfo(baseName)
  	doSuspend := devinfo != nil && devinfo.Exists != 0
  
  	if doSuspend {
  		if err := SuspendDevice(baseName); err != nil {
  			return err
  		}
  	}
  
  	if err := CreateSnapDeviceRaw(poolName, deviceID, baseDeviceID); err != nil {
  		if doSuspend {
  			if err2 := ResumeDevice(baseName); err2 != nil {
  				return fmt.Errorf("CreateSnapDeviceRaw Error: (%v): ResumeDevice Error: (%v)", err, err2)
  			}
  		}
  		return err
  	}
  
  	if doSuspend {
  		if err := ResumeDevice(baseName); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // CreateSnapDevice creates a snapshot based on the device identified by the baseName and baseDeviceId,