Commit Graph

101 Commits

Author SHA1 Message Date
Wojtek Porczyk
8edbf0e406 qubes: Document all the events
fixes QubesOS/qubes-issues#1811
2016-10-25 17:11:38 +02:00
Marek Marczykowski-Górecki
bb78eb1ce6
qubes: fix resetting already default property
`getattr(instance, self.__name__)` always succeed if attribute has
default value. This results in deleting attribute even when it isn't
set.
2016-09-08 04:17:58 +02:00
Marek Marczykowski-Górecki
0293c1c7ef
qubes/vm: move misc XML tags loading to separate method 2016-08-18 11:57:11 +02:00
Bahtiar `kalkin-` Gadimov
c18537439f Make pylint really happy ♥♥♥ 2016-07-21 12:21:56 +02:00
Wojtek Porczyk
6ade5736d7 pylint fixes 2016-06-10 21:27:29 +02:00
Wojtek Porczyk
63c09a090c qubes: Combat import cycles
This commit eliminates import statements happening in the middle of the
file (between two classes definition). The cycles are still there. The
only magic module is qubes itself.
2016-05-05 14:33:09 +02:00
Wojtek Porczyk
f8270a07bb qubes: add filename= argument to Qubes.save()
fixes QubesOS/qubes-issues#1846
2016-05-05 00:40:45 +02:00
Bahtiar `kalkin-` Gadimov
04536c5950 Don't exec app.save() after add_pool & remove_pool 2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
2e28849c90 Move pool xml config from Qubes to Pool 2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
ef485ca32a Add linux-kernel to defaults['pool_config'] 2016-04-25 07:17:19 +02:00
Bahtiar `kalkin-` Gadimov
97d04791b7 After add/remove_pool execute Pool.setup/destroy 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
36470310a2 Replace pool config parsing logic
- Move add_pool/remove_pool to Qubes class
- Add Qubes.get_pool
- Remove storage.conf
2016-04-25 07:16:37 +02:00
Bahtiar `kalkin-` Gadimov
c791cb1935 Serialize pool configuration to XML 2016-04-25 07:16:37 +02:00
Wojtek Porczyk
540942de47
qubes/ext: convert extensions to singletons
From now the extensions are instantiated once. They no longer have .app
attribute, but can access it from event handlers via vm.app.
2016-04-11 15:31:41 +02:00
Marek Marczykowski-Górecki
4308fa7946
Fix events names in docstrings 2016-04-11 00:13:14 +02:00
Marek Marczykowski-Górecki
ad1f1738fa qubes: make 'store' property public (R/O)
It makes sense to see from what Qubes object was loaded.
2016-04-07 13:21:00 +02:00
Marek Marczykowski-Górecki
c17f86e659 qubes: fix handling DEFAULT special value for VMProperty 2016-04-07 12:03:40 +02:00
Wojtek Porczyk
267a78e4e0 Fix resetting attribute to default when it's already default
Based on marmarek's
  WIP fix resetting attribute to default when it's already default
2016-04-06 18:09:57 +02:00
Wojtek Porczyk
42666e0ec5 Throw meaningful exception when qubes.xml is missing
Based on kalkin-'s Rais QubesException if qubes xml config is missing
2016-04-05 16:33:49 +02:00
Bahtiar `kalkin-` Gadimov
156ecf4163 Add missing import in qubes/__init__.py
This was: Fix qubes-create command
2016-04-05 16:25:51 +02:00
Bahtiar `kalkin-` Gadimov
49ec29a235 Fix bug in Qubes.get_vm_class() 2016-04-05 16:24:30 +02:00
Wojtek Porczyk
349e218638 qubes/devices: devices class framework
This fixes loading PCI devices.
2016-03-23 09:08:13 +01:00
Wojtek Porczyk
5eaf03c4a2 HVM part 1 2016-03-21 11:44:46 +01:00
Wojtek Porczyk
e0210130da qubes: Fix error in get_vms_based_on()
Not every vm has .template attribute.
2016-03-21 11:43:33 +01:00
Wojtek Porczyk
d766b8e110 qubes: Fix "unify event names" 2016-03-21 11:43:33 +01:00
Wojtek Porczyk
75dd882b83 qubes: Unify event names
Events will be named <object>-[pre-]-<verb>, where verb is in infinitive
form.
2016-03-21 11:43:32 +01:00
Wojtek Porczyk
d09bd5ab6a qubes: Convert QubesVM and Extension discovery to pkg_resources
QubesOS/qubes-issues#1238
2016-03-21 11:43:32 +01:00
Wojtek Porczyk
93686eae06 qubes/vm: change services to features 2016-03-21 11:43:32 +01:00
Marek Marczykowski-Górecki
5375dce90d Prefer human readable output in qvm-prefs and qubes-prefs tools 2016-03-03 01:18:17 +01:00
Wojtek Porczyk
c80e89d47e qubes: support QUBES_XML_PATH environment variable
This is reworked
    core: load default qubes.xml location from QUBES_XML_PATH env variable

QubesOS/qubes-issues#1730
2016-03-03 01:18:17 +01:00
Marek Marczykowski-Górecki
9633573408 core: adjust units comment for host.memory_total, and fix related places
QubesOS/qubes-issues#1737
2016-03-03 01:18:16 +01:00
Wojtek Porczyk
88a63cbe3a qubes/vm/qubesvm: do not clone VM-specific properties
This is reworked
    core: do not clone VM-unique identifiers in clone_properties
by Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2016-03-03 01:18:16 +01:00
Marek Marczykowski-Górecki
64260f5844 core: handle default template
Fixes QubesOS/qubes-issues#1559
2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
15192ede42 core: allow not having clockvm/updatevm 2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
f7f1038f57 core: add a stopgap detection for simultaneous qubes.xml access
For now simply throw an exception. Proper solution require some locking

QubesOS/qubes-issues#1729
2016-03-03 01:18:15 +01:00
Wojtek Porczyk
c531b0eac2 qubes: fix None serialisation for VMProperty
Note that None != default (no attribute in XML at all).

This is reworked
  27eddcb WIP core: fix deserializing None for VMProperty
by Marek.
2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
843cf68c1a core: return QubesVMNotFoundError when setting non-existent VM to VMProperty
Not sure about this one. Maybe it should be rather
QubesPropertyValueError?
2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
380ad74494 core: fix property.__eq__ 2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
ee1e836523 core: fix clone_properties(proplist=something) 2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
929923164e Move libvirt_conn.close to object destructor
Process exit is too late for long-running processes. Especially tests,
which create a lot of such objects which leads to depleting all
the file descriptors.

QubesOS/qubes-issues#1697
2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
db20581340 storage: few more merge fixes 2016-03-03 01:18:15 +01:00
Wojtek Porczyk
9eafa57539 Merge remote-tracking branch 'marmarek/master' into core3-devel
The following list is bollocks. There were many, many more.

Conflicts:
    core-modules/003QubesTemplateVm.py
    core-modules/005QubesNetVm.py
    core/qubes.py
    core/storage/__init__.py
    core/storage/xen.py
    doc/qvm-tools/qvm-pci.rst
    doc/qvm-tools/qvm-prefs.rst
    qubes/tools/qmemmand.py
    qvm-tools/qvm-create
    qvm-tools/qvm-prefs
    qvm-tools/qvm-start
    tests/__init__.py
    vm-config/xen-vm-template-hvm.xml

This commit took 2 days (26-27.01.2016) and put our friendship to test.
    --Wojtek and Marek
2016-03-03 01:13:51 +01:00
Wojtek Porczyk
e4a0cfc8c8 qubes: fix instantiating with no or empty qubes.xml
There is always dom0 (domid=0) added, but it has None as self.xml.
2015-12-23 14:34:54 +01:00
Wojtek Porczyk
b54305bff1 qubes: fix qubes-create regression
Previous commit, which changed the handling of qubes.xml again, broke
bootstrapping.
2015-12-23 14:34:54 +01:00
Wojtek Porczyk
58608864c1 qubes: fix saving qubes.xml 2015-12-23 14:34:54 +01:00
Wojtek Porczyk
d693964ab9 qubes: fix deleting domain 2015-12-23 14:34:53 +01: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
17ac6cb225 core3: boolean properties can be set explicitely 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
b4d51b016b core3: some properties can be set only once
Some properties should not be changed by user at will (like UUID). The
solution is to make them write-once, so they will be set when loading
from XML and frozen for the lifespan of the object holding the property.
When desperately needed, users may edit XML by hand.

fixes QubesOS/qubes-issues#1235
2015-10-05 12:46:14 +02:00