def METHOD_NAME(vm, device_type):
    """
    Remove devices of a given type.
    :param vm: The vm object.
    :param device_type: Type of devices should be removed.
    """
    vm_was_running = vm.is_alive()
    vmxml = vm_xml.VMXML.new_from_dumpxml(vm.name)
    vmxml.remove_all_device_by_type(device_type)
    vmxml.sync()
    if vm_was_running:
        vm.start()