Beispiel #1
0
func (p *VirStoragePool) Build(flags uint32) error {
	result := C.virStoragePoolBuild(p.ptr, C.uint(flags))
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
// Build builds the underlying storage pool.
func (pool StoragePool) Build(flags StoragePoolBuildFlag) error {
	pool.log.Printf("building storage pool (flags = %v)...\n", flags)
	cRet := C.virStoragePoolBuild(pool.virStoragePool, C.uint(flags))
	ret := int32(cRet)

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

	pool.log.Println("pool built")

	return nil
}