Commit Graph

208 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
2a46abbefd
qubes.vm: implement TemplateVM.appvms property 2016-04-20 02:28:11 +02:00
Marek Marczykowski-Górecki
8c6fe7ed90
Merge remote-tracking branch 'origin/master' into core3-devel-mm 2016-04-11 13:03:12 +02:00
Marek Marczykowski-Górecki
424d3054f3 backup: use vm.features to store backup-specific metadata
Do not keep them in system qubes.xml.
2016-04-07 13:21:00 +02:00
Marek Marczykowski-Górecki
e8f21929ad backup: by default include all the VMs with vm.include_in_backups
If there is a need for more robust default, it should be handled at that
property.
2016-04-07 13:21:00 +02:00
Marek Marczykowski-Górecki
45d6ab3862 qubes/vm: store libvirt config in libvirt.xml, fix rename handling 2016-04-07 13:03:46 +02:00
Marek Marczykowski-Górecki
7f5feac98b qubes/vm: fixes for features handling
Properly handle 'None' value, there is no difference between empty
string (<x></x>) and no content at all (<x/>).
2016-04-07 13:03:30 +02:00
Marek Marczykowski-Górecki
7cbe2dbd38 qubes/vm: add passio_stderr argument to vm.run_service
This allows getting error messages from service call, to provide more
meaningful error messages.
2016-04-07 12:58:05 +02:00
Marek Marczykowski-Górecki
e319639146 qubes/vm: add StandaloneVM class 2016-04-07 12:57:52 +02:00
Marek Marczykowski-Górecki
15e032cddb qubes/vm: fix handling "None" kernel
The "None" value still makes sense for HVM domains.
2016-03-21 11:44:59 +01:00
Wojtek Porczyk
29d0baa944 qubes/vm/mix/net: By default MAC is constant
MAC address was one place, where qid was leaked to the VM. Different MAC
addresses are not needed, since we do routing, not switching.
2016-03-21 11:44:59 +01:00
Wojtek Porczyk
04cc2099f7 HVM part 2 2016-03-21 11:44:54 +01:00
Marek Marczykowski-Górecki
8da7416f30 vm: Remove reference to old libvirt config template
This file isn't installed anymore
2016-03-21 11:44:54 +01:00
Wojtek Porczyk
5eaf03c4a2 HVM part 1 2016-03-21 11:44:46 +01:00
Wojtek Porczyk
d766b8e110 qubes: Fix "unify event names" 2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
9567f7b40b vm: rename 'yum-proxy-setup' feature to 'updates-proxy-setup'
The 'yum-proxy-setup' is deprecated since R3.0, so finally remove old
name.
But add it to R3.x compatibility layer.
2016-03-21 11:43:33 +01:00
Wojtek Porczyk
0f03b257ce qubes/vm: Fix features coercion 2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
3b1238f7cf vm: stub for new firewall API
- introduce 'firewall-changed' event
 - add reload_firewall_for_vm stub function

Should that function be private, called only from appropriate event
handlers?

QubesOS/qubes-issues#1815
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
c99a47d192 vm: fix handling firewall_conf path
It may be (and by default is) path relative to VM directory.
This code will be gone in the final version, after merging firewall
configuration into qubes.xml. But for now have something testable.
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
c9cad71d03 vm/mix/net: create vm.connected_vms dynamically
It is much less error-prone way. Previous approach didn't worked because
VMs weren't added here at 'domain-init'/'domain-loaded' event. And even
after adding such handlers it wasn't working because of
QubesOS/qubes-issues#1816.

It may be a little slower, but since it isn't used so often
(starting/stopping VM and reloading firewall), shouldn't be a problem.
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
3e3213e7c7 Redo "core: do not reset firewal when setting netvm=none"
Apparently it got lost in merge.

QubesOS/qubes-issues#862
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
736773dbec vm: remove obsolete firewall handling code
There is no vm.write_iptables_xenstore_entry().

QubesOS/qubes-issues#1815
2016-03-21 11:43:33 +01:00
Marek Marczykowski-Górecki
12f778b539 qubes/vm: do not recursively use repr in BaseVM.__repr__
This will easily end up in infinite recursion. For example
'sys-net'.template points at 'fedora-23', which itself has
'fedora-23'.netvm set to 'sys-net'.
2016-03-21 11:43:32 +01:00
Wojtek Porczyk
0f9ca47d90 qubes/ext/guid: Move gui-related code to extension 2016-03-21 11:43:32 +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
Wojtek Porczyk
bf78e662f6 Import qubesdb from the new module
fixes QubesOS/qubes-issues#1252
2016-03-03 01:18:17 +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
Marek Marczykowski-Górecki
e3c94f3949 core: fix handling numeric label value set
Not sure if it should be supported this way, but surely it shouldn't
throw AttributeError.
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
2cbbe0bdb6 core: abandon 'kernels' in VM directory
Since we have PV Grub now (which is much more convenient), it is useless
now.
2016-03-03 01:18:16 +01:00
Marek Marczykowski-Górecki
9428c70d31 core: fix vm.create_on_disk
QubesOS/qubes-issues#
2016-03-03 01:18:16 +01:00
Marek Marczykowski-Górecki
62759fb1f6 core: move maxmem default initialization to property itself
Also fix (for now?) units - memory_total is int bytes while maxmem in
megabytes.

QubesOS/qubes-issues#1737
2016-03-03 01:18:16 +01:00
Marek Marczykowski-Górecki
2f3762ee68 core: minor fixes in handling properties
Conflicts:
	qubes/vm/qubesvm.py
2016-03-03 01:18:16 +01:00
Marek Marczykowski-Górecki
ab469e4473 vm: fix calling monitor layout notifier 2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
4095f3c5eb vm: disable uses_custom_config for now 2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
926596cba7 Initialize vm.storage after loading all the properties
It needs at least vm.name to be set.
2016-03-03 01:18:15 +01:00
Marek Marczykowski-Górecki
3af71ab65d storage: fix handling netvm and adminvm
@woju what was consensus on 'servicevms' dir? Since "being network
provider" is no longer separate type and can be changed during VM
lifetime, maybe we should abandon that idea? Or maybe just set it as VM
property (some storage pool config argument) - that way mgmt stack could
put all the sys-* VMs into separate directory, regardless of the type.
2016-03-03 01:18:06 +01:00
Wojtek Porczyk
c47e29ed50 Fix most errors from pylint 2016-03-03 01:14:54 +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
2d6ad3b60c qubes/vm/qubesvm: remove prefixes from qubesdb keys 2016-03-03 00:46:05 +01:00
Wojtek Porczyk
e8bedcd7ba qubes/vm: fix starting netvm 2016-03-03 00:46:05 +01:00
Wojtek Porczyk
01319e391f qubes: port netvm
From now, there are no separate NetVM and ProxyVM class, but property
"provides_network".
2016-03-03 00:46:05 +01:00
Wojtek Porczyk
689dd64b0d qubes: misc pylint fixes 2015-12-29 22:04:00 +01:00
Wojtek Porczyk
bf4dbe07d5 qubes/tests/vm/qubesvm: add basic tests for QubesVM
And already one fix to instantiation.
2015-12-29 20:35:04 +01:00
Wojtek Porczyk
69e0b94c74 Fix for UUID management
This fixes up 75c3f355db "qubes/vm/qubesvm: fix domain's UUID management".

Previously 'domain-init' was never really fired.

fixes QubesOS/qubes-issues#1557
2015-12-29 03:50:35 +01:00
Wojtek Porczyk
f1a0b1af39 qubes/tools: add qvm-run, qvm-{,un}pause
Also change convention of calling main(): now command returns its
numeric value instead of bool.

Also fixed QSB#13

fixes QubesOS/qubes-issues#1226
2015-12-29 03:43:08 +01: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
c9cbf8ffe2 core3: fix mounting modules.img 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
3724d6fca1 qubes/vm/qubesvm: fix core2 compatibility 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
8628a984fc qubes/vm: fix memory constraint while generating libvirt XML 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
75c3f355db qubes/vm/qubesvm: fix domain's UUID management
Now we generate UUID on domain's instantiation. This is needed, because
we sometimes don't update XML (like in qvm-start).

fixes QubesOS/qubes-issues#1236
2015-10-05 12:46:14 +02:00
Wojtek Porczyk
6f4951d08a install python package with setuptools 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
ce60915fb0 qvm-ls: fix listing domains and labels 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
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
12329e7b35 qubes/vm/qubesvm: fix log initialisation 2015-10-05 12:46:14 +02:00
Wojtek Porczyk
af1a6a49bd qvm-ls: fix printing label 2015-10-05 12:46:13 +02:00
Wojtek Porczyk
0fbee4dc10 core3: more fixes 2015-10-05 12:46:13 +02:00
Wojtek Porczyk
80d664441d core3: fixes from Marek
This is adapted from commit 90a50dca406e3d40c88ea338566e0460589df7a3.
2015-10-05 12:46:13 +02:00
Wojtek Porczyk
e9b998400d qubes/vm/qubesvm: fix __init__ wrt .storage attr 2015-09-28 18:20:28 +02:00
Wojtek Porczyk
84eb082ed2 qubes/vm/qubesvm: fix label setting/loading 2015-09-28 18:20:28 +02:00
Wojtek Porczyk
ea9a984fa7 qubes/vm: Fix instantiating QubesVM
vm.app attribute needs to be accessible before setting properties
2015-09-28 18:20:28 +02:00
Wojtek Porczyk
12092c3aa5 core3: port TemplateVM 2015-09-28 18:15:24 +02:00
Wojtek Porczyk
7886695c63 qubes/vm/qubesvm: fix qid setter to accept str
Mainly for loading from XML.
2015-06-29 17:39:29 +02:00
Wojtek Porczyk
7f16e0a73b qubes: disable events by default not to interfere with loading from XML 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
f2d9d628c4 qubes/vm/qubesvm: Fix loading/instantiating 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
6a4820c381 qubes/tools: qvm-ls 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
e83d21c671 qubes: more documentation and doc fixes 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
5d9b92a039 qubes: pylint fixes (minor programming errors) 2015-06-29 17:39:28 +02:00
Wojtek Porczyk
186b277418 qubes/vm: fix logging 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
45977fc873 qubes: fix VM instantiation and loading 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
8c437f4053 qubes: unify PropertyHolder API
get_props_list() -> property_list()
_init_property() -> _property_init()
2015-06-29 17:39:27 +02:00
Wojtek Porczyk
6798790e1f qubes: pylint fixes (fix signatures) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
8d3edbf133 qubes/vm: fix kernels_dir 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
adb144acfe qubes: pylint fixes (small mistakes and wrong names) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
4a85c823c3 qubes: pylint fixes (qualify imported variables) 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
ac1739df6b qubes: pylint fixes (fix imports) 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
cdc3df66c8 qubes: pylint fixes (mostly whitespace) 2015-06-29 17:39:27 +02:00
Wojtek Porczyk
d937d39c9e qubes: fix Qubes instantiation 2015-06-29 17:39:26 +02:00
Wojtek Porczyk
8e16dd2b28 qubes/storage: fix storage instantiation 2015-06-29 17:39:26 +02:00
Wojtek Porczyk
8805db5e5f core3 move: AdminVM class 2015-06-29 17:39:26 +02:00
Wojtek Porczyk
8afba4c5e9 core3 move: storage/* 2015-06-29 17:39:26 +02:00
Jason Mehring
be3e888bbe Fixed typos 2015-06-29 17:39:26 +02:00
Wojtek Porczyk
04c221e924 qubes/vm/qubesvm: fix env manipulation on qrexec-daemon start 2015-06-29 17:39:26 +02:00
Wojtek Porczyk
af154b53fe qubes: change names of XML generating methods
Methods returning lxml.etree.Elements are called xml_ or lvxml_, meant for
qubes.xml or libvirt respectively.

Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:26 +02:00
Wojtek Porczyk
92eca8edb9 qubes: Fix comments accross the code
Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
2e1696cb16 qubes: Fix XML validation test 2015-06-29 17:39:25 +02:00
Wojtek Porczyk
091ffa5444 qubes: Add parser for property docstring
From now, docstrings in properties cannot contain sphinx-specific features,
because there is no sphinx in dom0.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
c0e3281d04 qubes: fix changing domain name
Changing name of running VM is wrong.

Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
1deb3221c7 qubes: fix netvm semantics WRT default values
Automatic acquiring default*_netvm, default_template and {clock,update}vm is no
more. This will be moved to firstboot. Advanced users (those, who elect not to
autoconfig their initial VMs) will have to deal with that.

Acknowledgement:
This commit is a result of core3 review by Marek.
2015-06-29 17:39:25 +02:00
Wojtek Porczyk
52c1be49ec qubes/vm: remove unneccessary import 2015-06-29 17:39:24 +02:00
Wojtek Porczyk
9fa3d60d0b qubes/events: fix event handling order
Events are divided into "pre" and "post" events. "Pre" events fire handlers in
MRO, "post" fire them in reverse.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
41fef46db2 core3 move: QubesVM
This is a big commit and probably incomplete. Tests will follow.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
f9658ae338 qubes/vm: remove old event methods that were overlooked 2015-06-29 17:39:24 +02:00
Wojtek Porczyk
f149c7b59b qubes/vm: fixed __repr__ for BaseVM
Previously it could fail with AttributeError when any of the properties was unset.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
ef4f00dac0 qubes/vm: DeviceManager class for herding devices
collections.defaultdict was not enough, because it cannot pass any arguments to
factory. We need to pass domain object and device class to fire events on attach
and detach.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
1a032ecf2a core3: basic global events and their documentation 2015-06-29 17:39:24 +02:00
Wojtek Porczyk
855a434879 core3: event framework adjusted for global Qubes object
From now, global events are emitted by qubes.Qubes object and handlers are registered there.
2015-06-29 17:39:24 +02:00
Wojtek Porczyk
b623a71d87 core3 move: QubesVmCollection
This got split to qubes.Qubes and qubes.VMCollection.
From now on, VMCollection is a stupid bag. Some parts went elsewhere.
2015-06-29 17:39:23 +02:00
Wojtek Porczyk
87ae0112eb qubes/vm: New XML format loading 2015-06-29 17:39:23 +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