Commit Graph

44 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
50adc60882
vm/adminvm: add run_service* functions
Calling qrexec service dom0->dom0 can be useful when handling things
that can run in dom0 or other domain. This makes the interface uniform.
Example use cases include GUI VM and Audio VM.
2019-06-09 21:00:02 +02:00
Marek Marczykowski-Górecki
4f71e9775f
vm/adminvm: mark AdminVM as updateable 2019-03-26 01:19:34 +01:00
Marek Marczykowski-Górecki
5222650868
vm/adminvm: add stubs for kill/shutdown functions
Report proper error message, instead of throwing AttributeError on such
calls.

Fixes QubesOS/qubes-issues#4645
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
be2465c1f9
Fix issues found by pylint 2.0
Resolve:
 - no-else-return
 - useless-object-inheritance
 - useless-return
 - consider-using-set-comprehension
 - consider-using-in
 - logging-not-lazy

Ignore:
 - not-an-iterable - false possitives for asyncio coroutines

Ignore all the above in qubespolicy/__init__.py, as the file will be
moved to separate repository (core-qrexec) - it already has a copy
there, don't desynchronize them.
2018-07-15 23:51:15 +02:00
Rusty Bird
dbaf60ca24
Add include_in_backups property for AdminVM 2018-02-23 21:29:15 +00:00
Marek Marczykowski-Górecki
f5fe10e2ad
vm/adminvm: fix type of AdminVM.qid
It is defined as int in QubesVM.qid, make it consistent.
2017-12-21 18:18:12 +01:00
qubesuser
f2b8ad7d38 remove unused netid code
it's unused and has a netid property with name different than key
that would cause issues in the next commit
2017-11-11 02:37:37 +01:00
Marek Marczykowski-Górecki
4500c4dcab
vm/adminvm: add is_halted() method
It is used in some places, for example attaching devices.

Fixes QubesOS/qubes-issues#3054
2017-10-21 04:05:17 +02:00
Marek Marczykowski-Górecki
2164a8d7b8
Change license to LGPL v2.1+
See this thread for reasoning and acceptance from contributors:
https://groups.google.com/d/topic/qubes-devel/G7KzrfU0lWY/discussion
"Changing qubes-core-admin license to LGPL v2.1+"
2017-10-12 00:11:50 +02:00
Marek Marczykowski-Górecki
12b7e22d27
vm: do not start QubesDB watch instance multiple times
vm.create_qdb_entries can be called multiple times - for example when
changing VM IP. Move starting qdb watcher to start(). And just in case,
cleanup old watcher (if still exists) before starting new one.
This fixes one FD leak.
2017-09-29 12:05:23 +02:00
Marek Marczykowski-Górecki
9f88fa7f0c
Move QubesVM.{name,qid,uuid,label} to BaseVM
Reduce strange code in BaseVM (accessing non-existing self.name) and
code duplication.
2017-09-29 11:53:00 +02:00
Marek Marczykowski-Górecki
8488d5dc72
vm/adminvm: add default_dispvm property to AdminVM
This is useful to select default DispVM template for VMs started
directly by the user. This makes sense as long as AdminVM == GUIVM.

QubesOS/qubes-issues#2974
2017-08-06 20:54:10 +02:00
Marek Marczykowski-Górecki
b7f0cf7d82
vm: add API for watching changes in QubesDB
Provide an API for use QubesDB.watch() inside of qubesd.

Fixes QubesOS/qubes-issues#2940
2017-07-25 05:20:39 +02:00
Marek Marczykowski-Górecki
1759bca00f
Rename vm.qdb to vm.untrusted_qdb
QubesDB can be freely modified by a VM, so one should take care when
reading any data retrieved from it.

Fixes QubesOS/qubes-issues#2934
2017-07-24 13:01:55 +02:00
Marek Marczykowski-Górecki
6db39345fb
Merge remote-tracking branch 'origin/core3-quick-fixes-20170703' 2017-07-04 16:11:18 +02:00
Marek Marczykowski-Górecki
3c4b60fa45
vm/adminvm: (re-)add vm.qdb property
Dom0 also expose some information in QubesDB - like list of block
devices.
2017-07-04 12:58:39 +02:00
Marek Marczykowski-Górecki
3721ae3e8b
vm/adminvm: setup libvirt_domain property
Since libvirt do provide object for dom0 too, return it here.
It's much easier than special-casing AdminVM everywhere. And in fact
sometimes it is actually useful (for example attaching devices from/to
dom0, adjusting memory).
2017-07-04 04:09:27 +02:00
Marek Marczykowski-Górecki
e4d285d479
vm/adminvm: make AdminVM sortable
One more thing gone during changing AdminVM base class.
2017-06-20 12:47:00 +02:00
Marek Marczykowski-Górecki
e8c303977b
vm/adminvm: fix str(AdminVM) after changing its base
BaseVM have no (useful) __str__ method.
2017-06-12 10:15:13 +02:00
Marek Marczykowski-Górecki
fa1da422d1
vm/adminvm: don't base AdminVM on QubesVM
dom0 isn't real VM and most properties doesn't apply to it. Lets make it
more explicit.
2017-06-06 21:57:27 +02:00
Marek Marczykowski-Górecki
5d3204c730
vm: remove prepare_dvm parameter from methods and events
It was related to DispVM savefile preparation, but it is no longer
applicable in Qubes 4.0
2017-06-05 23:38:30 +02:00
Wojtek Porczyk
df03800278 Fix miscellaneous warnings
Among them:
- explicitly close files (possibly using with: syntax)
- use non-deprecated methods
2017-05-29 17:34:15 +02:00
Marek Marczykowski-Górecki
50b812190b
Merge remote-tracking branch 'kalkin/device-assignments' into core3-devel
* kalkin/device-assignments: (21 commits)
  PCI extension cache PCIDevice objects
  Make pylint ♥
  Fix pylint warning no-else-return
  Fix pylint warning len-as-conditional
  device-list-attached event returns a dev/options tupples list
  DeviceAssignment options are now a dict
  Remove WrongAssignment exception
  Rename qubes.devices.BlockDevice to qubes.storage.BlockDevice
  Update relaxng devices option element
  Fix tests broken by the new assignment api
  Fix qubes.tests.devices
  Fix pci device integration tests
  qvm-device add support for assignments
  Update ext/pci to new api
  BaseVM add DeviceAssignment xml serialization
  Migrate DeviceCollection to new API
  Add PersistentCollection helper to qubes.devices
  Add DeviceAssignment
  qvm-device validates device parameters
  qvm-device fix handling of non block devices
  ...
2017-04-21 17:09:33 +02:00
Marek Marczykowski-Górecki
fa72679b47
Make pylint happy
New pylint throw some more warnings.
2017-04-21 16:57:35 +02:00
Bahtiar `kalkin-` Gadimov
79407a8717
Make pylint ♥ 2017-04-15 23:50:11 +02:00
Marek Marczykowski-Górecki
c41585e2f5
Initialize dom0 label
It is required property. Additionally, define icon_path to None,
otherwise it tries to access dom0.dir_path, which isn't set.
2017-03-16 20:04:01 +01:00
Wojtek Porczyk
d74567d65f qubes: port core to python3
fixes QubesOS/qubes-issues#2074
2017-01-20 16:42:51 +01:00
Marek Marczykowski-Górecki
d8a1216daf
Fix qubes-create in offline mode
QubesOS/qubes-issues#2412
2016-11-26 04:08:09 +01:00
Wojtek Porczyk
c9accc258c Merge remote-tracking branch 'woju/pull/15/head' into core3-devel
Conflicts:
	qubes/storage/__init__.py
	qubes/storage/file.py
	qubes/vm/qubesvm.py
2016-06-28 15:15:00 +02:00
Bahtiar `kalkin-` Gadimov
7081bd433a
Make pylint happy 2016-06-23 14:23:34 +02:00
Bahtiar `kalkin-` Gadimov
bb2e6a2ad3
Add QubesVM.attached_volumes() 2016-06-23 13:16:09 +02:00
Bahtiar `kalkin-` Gadimov
0cd667a1f5 qubes.vm.adminvm fix XXX and add docstrings 2016-06-16 17:01:33 +02:00
Bahtiar `kalkin-` Gadimov
e5906df0c7 AdminVM remove get_private_img_sz 2016-06-16 16:59:27 +02:00
Bahtiar `kalkin-` Gadimov
930fe417a8 Remove storage size and usage methods from QubesVM 2016-06-16 16:59:26 +02:00
Wojtek Porczyk
2e42a408e5 core3: Add documentation to qubes.exc
part of QubesOS/qubes-issues#1279
2015-10-17 00:20:44 +02:00
Wojtek Porczyk
96efb4568a core3: add different exceptions
From now on there are different exceptions which can be raise on
different occasions.

fixes QubesOS/qubes-issues#1279
2015-10-17 00:17:12 +02:00
Wojtek Porczyk
ea44c0acf3 qubes: pylint fixes
Fix bunch of errors and warnings.
2015-10-05 23:49:39 +02:00
Wojtek Porczyk
a017d78174 Dumb down dir_path property
From now, dir_path cannot be set and is calculated from domain's class
and name.

fixes QubesOS/qubes-issues#1234
2015-10-05 12:46:14 +02:00
Wojtek Porczyk
8d3edbf133 qubes/vm: fix kernels_dir 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
bf29d5e5b5 qubes: pylint fixes (disable unfounded messages) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
ee06e7d7a2 qubes: documentation and licence fixes 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
8805db5e5f core3 move: AdminVM class 2015-06-29 17:39:26 +02:00
Wojtek Porczyk
65595e3b39 apidoc stub 2015-06-29 17:39:22 +02:00
Wojtek Porczyk
7f27d987cc import framework for core3 2015-06-29 17:39:22 +02:00