예제 #1
0
func (p *VirStoragePool) GetName() (string, error) {
	name := C.virStoragePoolGetName(p.ptr)
	if name == nil {
		return "", errors.New(GetLastError())
	}
	return C.GoString(name), nil
}
예제 #2
0
func (n *StoragePool) GetName() (string, error) {
	result := C.virStoragePoolGetName(n.cptr)
	if result == nil {
		return "", GetLastError()
	}

	name := C.GoString(result)
	return name, nil
}
예제 #3
0
// Name fetches the locally unique name of the storage pool.
func (pool StoragePool) Name() (string, error) {
	pool.log.Println("reading storage pool name...")
	cName := C.virStoragePoolGetName(pool.virStoragePool)

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

	name := C.GoString(cName)
	pool.log.Printf("name: %v\n", name)

	return name, nil
}