def METHOD_NAME(vmxml, dev_type, dev_dict=None, index=0,
                     virsh_instance=virsh):
    """
     Get specified device , update it with given dev_dict if the device exists,
     Create the device if it does not exist
    :param vmxml: domain VMXML instance
    :param dev_type: device type
    :param dev_dict: dict to create device
    :param index: device index
    :return: device object
    """
    dev_obj = None
    try:
        dev_obj, xml_devices = libvirt.get_vm_device(vmxml, dev_type, index=index)
        dev_obj.setup_attrs(**dev_dict)
        vmxml.devices = xml_devices
        vmxml.xmltreefile.write()
        vmxml.sync(virsh_instance=virsh_instance)
    except IndexError:
        dev_obj = create_vm_device_by_type(dev_type, dev_dict)
        libvirt.add_vm_device(vmxml, dev_obj, virsh_instance=virsh_instance)
    LOG.debug(f'XML of {dev_type} device is:\n{dev_obj}')
    return dev_obj