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

Device handling API design issues #4626

Open
marmarta opened this issue Dec 16, 2018 · 3 comments
Open

Device handling API design issues #4626

marmarta opened this issue Dec 16, 2018 · 3 comments
Assignees
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: core P: major Priority: major. Between "default" and "critical" in severity. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@marmarta
Copy link
Member

marmarta commented Dec 16, 2018

Qubes R4.0:

Event 'device-attached' means two essentially different things:

  • if a VM is running, it means "a device was successfully attached to a VM and now is in use by that VM"
  • if a VM is not running, it means "set the VM to try to use that device whenever it starts".
    Those should be two different events: an actual device-attach and some sort of device-assigned-to-vm, because the current way leads to tears and heartbreak and confusion.

Idea of "persistent" assignment doesn't really fit for some devices. It's okay-ish for PCI, as those devices are not hot-pluggable (mostly), but not so much for USB. The most weirdest is when VM is started with a device attached persistently, but then the device is unplugged. Now device is still "attached persistently", but not really attached (or even present).
There are also other problems like #4780. Also, it's useful to be able to start a VM even if device currently is missing (and attach it when device will be plugged in).

@marmarta marmarta added this to the Release 4.1 milestone Dec 16, 2018
@marmarek
Copy link
Member

Those also should be two separate Admin API methods, instead of just persistent option.

@marmarek marmarek added the P: major Priority: major. Between "default" and "critical" in severity. label Dec 16, 2018
@andrewdavidwong andrewdavidwong added the T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. label Dec 17, 2018
@marmarek marmarek changed the title Event 'device-attach' does not have a consistent meaning Device handling API design issues Mar 9, 2019
@marmarek marmarek modified the milestones: Release 4.1, Release 4.2 Nov 20, 2020
@marmarek
Copy link
Member

Another issue with the current devices API is how new devices are announced - there is just a device-list-changed:<type> event, but there is no information what change happened. It may be new device, it may be device removal, it maybe some device metadata change etc. Currently it's responsibility of every interested application (devices widget in practice) to refresh the list, compare and act accordingly like show a notification.

@andrewdavidwong andrewdavidwong added the affects-4.2 This issue affects Qubes OS 4.2. label Aug 8, 2023
@andrewdavidwong andrewdavidwong removed this from the Release 4.2 milestone Aug 13, 2023
@marmarta marmarta moved this to Backend in Device UX Redesign Sep 19, 2023
marmarta added a commit to marmarta/qubes-core-admin-client that referenced this issue Nov 20, 2023
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
@marmarta
Copy link
Member Author

So, I made a proposal for how the new API should look like from the client perspective. Any comments, @marmarek ?

piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Nov 26, 2023
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Jan 10, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Feb 21, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
@marmarek marmarek assigned piotrbartman and unassigned marmarek and woju Mar 7, 2024
@marmarek marmarek moved this to In progress in Current team tasks Mar 7, 2024
@marmarek marmarek moved this from In progress to In review in Current team tasks Mar 11, 2024
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Mar 20, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Apr 16, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Apr 28, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue May 8, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
piotrbartman pushed a commit to piotrbartman/qubes-core-admin-client that referenced this issue Jun 2, 2024
This is not a working API, this is just a proposal for it.

references QubesOS/qubes-issues#4626
marmarek added a commit to marmarek/qubes-mgmt-salt-dom0-qvm that referenced this issue Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: core P: major Priority: major. Between "default" and "critical" in severity. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
Status: In review
Status: Backend
Development

No branches or pull requests

5 participants