예제 #1
0
func (v *VirStorageVol) GetName() (string, error) {
	name := C.virStorageVolGetName(v.ptr)
	if name == nil {
		return "", GetLastError()
	}
	return C.GoString(name), nil
}
예제 #2
0
// Name fetches the storage volume name. This is unique within the scope of
// a pool.
func (vol StorageVolume) Name() (string, error) {
	vol.log.Println("reading storage volume name...")
	cName := C.virStorageVolGetName(vol.virStorageVol)

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

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

	return name, nil
}