'Returns xml for libvirt.'

def get_config(self, connection_info, disk_info):

    conf = vconfig.LibvirtConfigGuestDisk()
    conf.driver_name = libvirt_utils.pick_disk_driver_name(self.host.get_version(), self.is_block_dev)
    conf.source_device = disk_info['type']
    conf.driver_format = 'raw'
    conf.driver_cache = 'none'
    conf.target_dev = disk_info['dev']
    conf.target_bus = disk_info['bus']
    conf.serial = connection_info.get('serial')
    data = {}
    if ('data' in connection_info):
        data = connection_info['data']
    if ('logical_block_size' in data):
        conf.logical_block_size = data['logical_block_size']
    if ('physical_block_size' in data):
        conf.physical_block_size = data['physical_block_size']
    if (('qos_specs' in data) and data['qos_specs']):
        tune_opts = ['total_bytes_sec', 'read_bytes_sec', 'write_bytes_sec', 'total_iops_sec', 'read_iops_sec', 'write_iops_sec']
        specs = data['qos_specs']
        if isinstance(specs, dict):
            for (k, v) in specs.items():
                if (k in tune_opts):
                    new_key = ('disk_' + k)
                    setattr(conf, new_key, v)
        else:
            LOG.warning('Unknown    content    in    connection_info/qos_specs:    %s', specs)
    if (('access_mode' in data) and data['access_mode']):
        access_mode = data['access_mode']
        if (access_mode in ('ro', 'rw')):
            conf.readonly = (access_mode == 'ro')
        else:
            LOG.error('Unknown    content    in    connection_info/access_mode:    %s', access_mode)
            raise exception.InvalidVolumeAccessMode(access_mode=access_mode)
    if (data.get('discard', False) is True):
        conf.driver_discard = 'unmap'
    if (disk_info['bus'] == 'scsi'):
        conf.device_addr = vconfig.LibvirtConfigGuestDeviceAddressDrive()
        conf.device_addr.controller = 0
        if ('unit' in disk_info):
            conf.device_addr.unit = disk_info['unit']
    return conf
