This is my XML data:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/generic.qcow2'/>
<backingStore/>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
and my struct is:
// struct for get device details from xml
type DiskXmlInfo struct {
Devices []Disk `xml:"devices>disk"`
}
type Disk struct {
Type string `xml:"device,attr"`
// Name string `xml:"target>dev,attr"`
Name string `xml:"target>dev,attr"`
}
I cannot get the target attribute name. How to get the target attribute name?
Thanks in advance.