示例#1
0
func (p *VirStoragePool) Refresh(flags uint32) error {
	result := C.virStoragePoolRefresh(p.ptr, C.uint(flags))
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
示例#2
0
// Refresh requests that the pool refresh its list of volumes. This may involve
// communicating with a remote server, and/or initializing new devices at the
// OS layer.
func (pool StoragePool) Refresh() error {
	pool.log.Println("refreshing storage pool...")
	cRet := C.virStoragePoolRefresh(pool.virStoragePool, 0)
	ret := int32(cRet)

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

	pool.log.Println("pool refreshed")

	return nil
}