func (v *VirStorageVol) GetXMLDesc(flags uint32) (string, error) { result := C.virStorageVolGetXMLDesc(v.ptr, C.uint(flags)) if result == nil { return "", GetLastError() } xml := C.GoString(result) C.free(unsafe.Pointer(result)) return xml, nil }
// XML fetches an XML document describing all aspects of the storage volume. func (vol StorageVolume) XML() (string, error) { vol.log.Println("reading storage volume XML...") cXML := C.virStorageVolGetXMLDesc(vol.virStorageVol, 0) if cXML == nil { err := LastError() vol.log.Printf("an error occurred: %v\n", err) return "", err } xml := C.GoString(cXML) vol.log.Printf("XML length: %v runes\n", utf8.RuneCountInString(xml)) return xml, nil }