示例#1
0
func (s *VirStream) Abort() error {
	result := C.virStreamAbort(s.ptr)
	if result < 0 {
		return errors.New(GetLastError())
	}
	return nil
}
示例#2
0
func (v *VirStream) Abort() error {
	result := C.virStreamAbort(v.ptr)
	if result == -1 {
		return GetLastError()
	}

	return nil
}
示例#3
0
// Abort requests that the in progress data transfer be cancelled abnormally
// before the end of the stream has been reached. For output streams this can be
// used to inform the driver that the stream is being terminated early. For
// input streams this can be used to inform the driver that it should stop
// sending data.
func (str Stream) Abort() error {
	str.log.Println("aborting stream...")
	cRet := C.virStreamAbort(str.virStream)
	ret := int32(cRet)

	if ret == -1 {
		err := LastError()
		str.log.Printf("an error occurred: %v\n", err)
		return err
	}

	str.log.Println("stream aborted")

	return nil
}