Ejemplo n.º 1
0
func (p *VirStoragePool) Create(flags uint32) error {
	result := C.virStoragePoolCreate(p.ptr, C.uint(flags))
	if result == -1 {
		return errors.New(GetLastError())
	}
	return nil
}
Ejemplo n.º 2
0
func (p *VirStoragePool) Create() error {
	result := C.virStoragePoolCreate(p.ptr, 0)
	if result < 0 {
		return errors.New(GetLastError())
	}
	return nil
}
Ejemplo n.º 3
0
// Create starts an inactive storage pool.
func (pool StoragePool) Create() error {
	pool.log.Println("creating storage pool...")
	cRet := C.virStoragePoolCreate(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 created")

	return nil
}