Esempio n. 1
0
func (p *VirStoragePool) Destroy() error {
	result := C.virStoragePoolDestroy(p.ptr)
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
Esempio n. 2
0
// Destroy destroys an active storage pool. This will deactivate the pool on the
// host, but keep any persistent config associated with it. If it has a
// persistent config it can later be restarted with "Create". This does not free
// the associated StoragePool object.
func (pool StoragePool) Destroy() error {
	pool.log.Println("destroying storage pool...")
	cRet := C.virStoragePoolDestroy(pool.virStoragePool)
	ret := int32(cRet)

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

	pool.log.Println("pool destroyed")

	return nil
}