-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
new device API #274
new device API #274
Conversation
cc5a247
to
355bf81
Compare
qubesadmin/tools/qvm_device.py
Outdated
assignment.options = options | ||
vm.devices[args.devclass].assign(assignment) | ||
if vm.is_running() and not assignment.attached: | ||
print("Assigned. Now you can manually attach device or restart domain.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and other below) should respect -q
(same below).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
qubesadmin/tools/qvm_device.py
Outdated
vm.devices[args.devclass].get_assigned_devices()): | ||
vm.devices[args.devclass].unassign(device_assignment) | ||
if device_assignment.attached: | ||
print("Unassigned. Now you can manually detach device " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (besides -q
) should also print which device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
# Special treatment for '--list-device-classes' (alias --list-classes) | ||
curr_action = sys.argv[1:] | ||
if set(curr_action).intersection( | ||
{'--list-device-classes', '--list-classes'}): | ||
sys.exit(main(args=['', '--list-device-classes'])) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to this one (besides it being already slightly broken due to requiring a device class anyway)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I slightly fix it and now device class is not required :D (see lines 408-411).
355bf81
to
717253f
Compare
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024061301-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2024052808-4.3&flavor=update
Failed tests23 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/101100#dependencies 38 fixed
Unstable tests
|
Starting a qube with CDROM seems to be broken: https://openqa.qubes-os.org/tests/96799#step/TC_00_Basic/4 |
And also, unit tests need an update (and also pylint is unhappy) |
717253f
to
ace68ff
Compare
I keep device_protocol.py review in QubesOS/qubes-core-admin#579, other changes here looks okay (but I haven't tested the most recent version here yet). |
02e9f7f
to
bc0d9bb
Compare
See also updated comment from the today's test run, most failures looks to be related to the devices API rework (but some are probably "just" tests to be updated). |
bc0d9bb
to
a1ba96e
Compare
This is not a working API, this is just a proposal for it. references QubesOS/qubes-issues#4626
update description better error message cleanup
cleanup checking devclass
better error message fix assignment
fix assignment
1600fd6
to
7708545
Compare
after QubesOS/qubes-core-admin/pull/579
Proposed device events:
sometimes event can be fired twice, we can ignore it
e.g. if device is plugged out and in in short time we can have doubled
detaching and attaching...
device-list-changed: device-added -> device-added{devclass}
device-list-changed: device-remove -> device-removed{devclass}
device-property-changed: property_name: TODO?
device-assignment-changed: created -> device-assign:{devclass}
device-assignment-changed: removed -> device-unassign:{devclass}
device-assignment-changed: attached -> device-attach:{devclass}
device-assignment-changed: detached -> device-detach:{devclass}
device-assignment-changed: property-set -> device-assignment-changed:{devclass}
QubesOS/qubes-issues#4626