func (v *VirStorageVol) GetName() (string, error) { name := C.virStorageVolGetName(v.ptr) if name == nil { return "", GetLastError() } return C.GoString(name), nil }
// 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 }