Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context: add open_device_with_fd() #106

Merged
merged 1 commit into from
Aug 30, 2021
Merged

Conversation

elmarco
Copy link
Contributor

@elmarco elmarco commented Aug 17, 2021

See API documentation for details.

@a1ien
Copy link
Owner

a1ien commented Aug 18, 2021

I think this function must be unsafe. And also #34
How I said I don't like this api, but if you describe why it's worth to implement I can add

@elmarco
Copy link
Contributor Author

elmarco commented Aug 18, 2021

Agree, the function should probably be unsafe, similar to other FromRawFd Rust APIs.

Regarding ownership, we can document it that the DeviceHandle will own and close the fd on close/Drop.

It is a useful function, not only for Android, but on Linux. You can write a privileged process that open the USB device and give it to a user (spice-gtk had to modify ACL/permission on the file to do that in the past, but we can do better now, this has several advantages over the current approach) Thanks

@elmarco elmarco force-pushed the open-with-fd branch 4 times, most recently from 52d248f to 3542c8b Compare August 19, 2021 13:27
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
@elmarco
Copy link
Contributor Author

elmarco commented Aug 26, 2021

@a1ien ping, thanks

@a1ien
Copy link
Owner

a1ien commented Aug 30, 2021

LGTM. Thanks

@a1ien a1ien merged commit 78f15ce into a1ien:master Aug 30, 2021
@elmarco
Copy link
Contributor Author

elmarco commented Aug 30, 2021

Thanks!

@a1ien a1ien mentioned this pull request Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants