Commit Graph

4777 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
d57aef96e5
admin.vm.Start: report libvirt errors to caller
Convert them to QubesException for that.
2017-05-17 11:17:21 +02:00
Marek Marczykowski-Górecki
207d497bfe
Remove block-cleaner-daemon
This service currently does more harm (desync libvirt state with
reality) than good. Since we have qubesd, we may come back to
implementing it properly using libvirt events.
2017-05-17 01:33:30 +02:00
Marek Marczykowski-Górecki
774f4c8d49
tests: admin.vm.devices.* Admin API
QubesOS/qubes-issues#2622
2017-05-16 09:05:22 +02:00
Marek Marczykowski-Górecki
661752bbc1
devices: list persistent devices also when not currently attached
When device extension do not return some "persistent" device as
currently attached, still return it, as it will be attached at next
domain startup. User can distinguish such devices by having
frontend_domain=None (or other VM).
Also, return a set from DeviceCollection.assignments().
2017-05-16 09:05:22 +02:00
Marek Marczykowski-Górecki
2c0d79af4a
devices: pass attach options to device handling extension
Otherwise options would be ignored...
2017-05-16 09:05:22 +02:00
Marek Marczykowski-Górecki
75ac611c90
admin: admin.vm.device.* methods
QubesOS/qubes-issues#2622
2017-05-16 09:05:13 +02:00
Marek Marczykowski-Górecki
f3c7fb8129
admin: add missing parts to admin.vm.Clone
Clone all the things.
2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
8533ec9773
devices: add clone method
Copy DeviceAssignment object
2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
b4ad5f0149
firewall: add clone and comparing methods, missing docstrings 2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
8de82f390e
tests: Tags() and Features() 2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
680dbf432c
vm: Features fixes
clear: dict should not be mutated during interation.
2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
ba86d6da79
vm: implement tag manager to fire events on change
While at it, adjust implementation to specification: tags don't have
value, only one bit of information (present/not present).

Fixes QubesOS/qubes-issues#2686
2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
68a426f0ba
admin: add methods for global properties
QubesOS/qubes-issues#2622
2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
0160d6e2f0
admin: fix handling default template in admin.vm.Create.* methods 2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
fcfb2e004a
tests: more for admin.Events method 2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
3c7d2289ce
vm: stubdom_xid: use canonical method for checking VM state
Don't depend on xid==-1 for not running VM.
This breaks some tests, as xid can be a mock object (not comparable to
int).
2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
e598735c3b
tests: minor formatting 2017-05-16 09:05:00 +02:00
Marek Marczykowski-Górecki
d4353c2a30
Enable linux-stubdom by default
Also, make it possible to set default on a template for its VMs.

QubesOS/qubes-issues#2185
2017-05-16 09:01:40 +02:00
HW42
f7094bec4f
add support for linux stubdoms
(cherry picked from commit e14ac1500a05162b3c07a5f44b4f0223f43fe90c)
2017-05-15 14:43:30 +02:00
Marek Marczykowski-Górecki
eaf5c27b27
Merge branch 'core3-devel'
This concludes over two years of rewriting Qubes' core.
Thank God it's now merged to master. --@woju

QubesOS/qubes-issues#1825
2017-05-12 19:59:14 +02:00
Marek Marczykowski-Górecki
72b29e8fe1
doc: remove documentation for removed metaclass 2017-05-12 19:38:16 +02:00
Marek Marczykowski-Górecki
625c03c504
Rename MgmtAPI to AdminAPI - part 3: Admin API
QubesOS/qubes-issues#853
2017-05-12 19:28:08 +02:00
Marek Marczykowski-Górecki
258d268a3a
Rename MgmtAPI to AdminAPI - part 2: internal API
QubesOS/qubes-issues#853
2017-05-12 19:28:08 +02:00
Marek Marczykowski-Górecki
cd489f46e1
Rename MgmtAPI to AdminAPI - part 1: classes
QubesOS/qubes-issues#853
2017-05-12 19:28:07 +02:00
Marek Marczykowski-Górecki
94937d1085
Remove obsolete test script 2017-05-12 18:43:35 +02:00
Marek Marczykowski-Górecki
e5596fe1ba
rpm: integrate -doc package into main one
It doesn't really make sense to keep man pages in separate package.
Previously it was done to avoid some build dependencies (pandoc require
a lot of them), but it isn't a problem anymore.
2017-05-12 18:43:35 +02:00
Marek Marczykowski-Górecki
81162a699b
Remove unused helper scripts 2017-05-12 18:43:35 +02:00
Marek Marczykowski-Górecki
2e7f483a60
Remove old pvusb handling code 2017-05-12 18:43:35 +02:00
Marek Marczykowski-Górecki
a6df6df449
doc: remove man pages of just removed tools 2017-05-12 18:43:35 +02:00
Marek Marczykowski-Górecki
83eef56f9d
Remove tools that are moved to -client repository
QubesOS/qubes-issues#853
2017-05-12 18:43:35 +02:00
Marek Marczykowski-Górecki
8992e71f85
Remove core2 code
This all either have been migrated to core3, or is not needed anymore.

There is still qvm-tools directory with a few tools that needs to be
migrated, or installed as is.
2017-05-12 18:36:29 +02:00
Marek Marczykowski-Górecki
bb4dc91ee8
storage/lvm: add workaround for ancient lvm2 in Travis-CI environment 2017-05-12 18:16:30 +02:00
Marek Marczykowski-Górecki
2a4af124f8
qubes/app: don't fail on saving qubes.xml when 'qubes' group isn't there 2017-05-12 18:11:27 +02:00
Marek Marczykowski-Górecki
da3eed582b
tests: rearrage LVM thin tests to run at least some in devel env
This requires creating LVM volume group, so create on based on loop dev
in /tmp.
This is rather rough, but if any of this fails, run the tests anyway -
it will simply skip LVM tests.
2017-05-12 18:10:17 +02:00
Marek Marczykowski-Górecki
b91b89a341
Make pylint ♥ 2017-05-12 17:41:38 +02:00
Marek Marczykowski-Górecki
0d84ee1c24
make pylint happy 2017-05-12 17:04:20 +02:00
Marek Marczykowski-Górecki
7ef020d5fe
devices: fix 'NotImplemented' usage
'__eq__' function should return 'NotImplemented' _value_, not
'NotImplementedError' exception.
2017-05-12 17:04:20 +02:00
Marek Marczykowski-Górecki
4f0d72f99a
devices: adjust API documentation
Device ident may contain only characters allowed in qrexec argument.
This will allow using it directly in qrexec argument in Attach/Detach
methods.
This also means PCI extension will need to be updated (it uses ':' in
ident).

QubesOS/qubes-issues#853
2017-05-12 17:04:20 +02:00
Marek Marczykowski-Górecki
ef031d6f0d
qubesvm: make vm.create_on_disk cleanup after failed attempt
Don't leave half-created VM - it will make harder to retry.
2017-05-12 17:04:20 +02:00
Marek Marczykowski-Górecki
2a25db7eb7
qubesvm: fix stdio handling in vm.run_service_for_stdio
Do set stdin/stdout/stderr descriptors as PIPE. Otherwise would not be
redirected.
2017-05-12 17:04:19 +02:00
Marek Marczykowski-Górecki
838553baf8
qubesvm: move storage.stop() to 'domain-shutdown' event handler
QubesOS/qubes-issues#2256
2017-05-12 17:04:19 +02:00
Marek Marczykowski-Górecki
0dfcaa63c9
Handle libvirt events in qubesd
This is required to get shutdown notification, when it wasn't initiated
by qubesd (for example 'poweroff' command inside of VM).
Libvirt event loop implementation must be registered before making
connection to libvirt, so move it to the beginning of main().
For now, only 'domain-shutdown' event is emited.
2017-05-12 17:04:19 +02:00
Marek Marczykowski-Górecki
3e067a3ef5
vm: run_service(): require user session running only when need gui access
User session may not be started at all (for example no qubes packages
installed there), so don't block it in all the cases. Also this would
prevent running 'qubes.WaitForSession' service...

In practice, default value for 'gui' argument is False, so in most cases
user session will be ignored. Which doesn't matter in most cases -
especially for services called by qubesd.
2017-05-12 17:04:19 +02:00
Marek Marczykowski-Górecki
68d5ca93e1
storage: have QubesVM() handle vm.dir_path, also on clone and rename
Keep it uniform - QubesVM() object is responsible for handling
vm.dir_path, Storage() is responsible for handling disk volumes (which
may live in that directory

QubesOS/qubes-issues#2256
2017-05-12 17:04:18 +02:00
Marek Marczykowski-Górecki
53be79b3b7
mgmt: vm.Create* and vm.Clone
Create methods are dynamically created based on available VM classes.

QubesOS/qubes-issues#2622
2017-05-12 17:04:18 +02:00
Marek Marczykowski-Górecki
52c3753d61
storage: support asynchronous storage pool implementations
Allow specific pool implementation to provide asynchronous
implementation. vm.storage.* methods will detect if given implementation
is synchronous or asynchronous and will act accordingly.
Then it's up to pool implementation how asynchronous should be achieved.
Do not force it using threads (`run_in_executor()`). But pool
implementation is free to use threads, if consider it safe in a
particular case.

This commit does not touch any pool implementation - all of them are
still synchronous.

QubesOS/qubes-issues#2256
2017-05-12 17:04:18 +02:00
Marek Marczykowski-Górecki
f324d30d4e
quebs: make Label() and storage.Pool() objects hashable 2017-05-12 14:27:47 +02:00
Marek Marczykowski-Górecki
59426b2dbc
tests: tools.qubesd
For now only QubesDaemonProtocol test. main function still untested

QubesOS/qubes-issues#2622
2017-05-12 14:27:47 +02:00
Marek Marczykowski-Górecki
29e21d1fc0
pylint: allow filter builtin 2017-05-12 14:25:33 +02:00
Marek Marczykowski-Górecki
ca51e8a02a
vm: remove unused metaclass 2017-05-12 14:25:32 +02:00