<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _get_disks(dom):
    '''
    Get domain disks from a libvirt domain object.
    '''
    disks = {}
    doc = ElementTree.fromstring(dom.XMLDesc(0))
    for elem in doc.findall('devices/disk'):
        source = elem.find('source')
        if source is None:
            continue
        target = elem.find('target')
        if target is None:
            continue
        if 'dev' in target.attrib:
            qemu_target = source.get('file', '')
            if not qemu_target:
                qemu_target = source.get('dev', '')
            elif qemu_target.startswith('/dev/zvol/'):
                disks[target.get('dev')] = {
                        'file': qemu_target,
                        'zfs': True}
                continue
            if not qemu_target and 'protocol' in source.attrib and 'name' in source.attrib:  # for rbd network
                qemu_target = '{0}:{1}'.format(
                        source.get('protocol'),
                        source.get('name'))
            if not qemu_target:
                continue

            disk = {'file': qemu_target, 'type': elem.get('device')}

            driver = elem.find('driver')
            if driver is not None and driver.get('type') == 'qcow2':
                try:
                    stdout = subprocess.Popen(
                                ['qemu-img', 'info', '--output', 'json', '--backing-chain', disk['file']],
                                shell=False,
                                stdout=subprocess.PIPE).communicate()[0]
                    qemu_output = salt.utils.stringutils.to_str(stdout)
                    output = _parse_qemu_img_info(qemu_output)
                    disk.update(output)
                except TypeError:
                    disk.update({'file': 'Does not exist'})

            disks[target.get('dev')] = disk
    return disks