Commit Graph

3493 Commits

Author SHA1 Message Date
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
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
db20581340 storage: few more merge fixes 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
Marek Marczykowski-Górecki
d3f9c0b169 storage: fix loading default storage pool
qubes.config.defaults holds ['pool_drivers'] strings, not classes.
2016-03-03 01:14:54 +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
6bc30b2e0b qubes/tools/qvm_ls: fix getting columns from mixin 2016-03-03 00:46:05 +01:00
Wojtek Porczyk
21d6d51cbb qubes/tools/qvm_ls: remove fmt= argument
Unneeded, added complexity.
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
638c31ce68 qubes/tests/vm/qubesvm: some more tests 2016-01-21 13:31:43 +01:00
Wojtek Porczyk
06cc064c8c qubes/tests: split init to init1 and init2
This is to keep the correct order of the tests. The exact dependency
graph is somewhat complicated and contains several cycles.
2016-01-21 13:31:43 +01:00
Marek Marczykowski-Górecki
31a3796ed3
dispvm: do not remove innocent files when cleaning up DispVM
Fixes QubesOS/qubes-issues#1662
2016-01-20 02:51:57 +01:00
Marek Marczykowski-Górecki
689df4afd3
dispvm: cleanup DispVM even if was already destroyed
dispvm.force_shutdown() throw an exception if the VM is already dead.

Fixes QubesOS/qubes-issues#1660
2016-01-20 02:50:47 +01:00
Marek Marczykowski-Górecki
176755d9e2
tests: DispVM cleanup
QubesOS/qubes-issues#1660
2016-01-20 02:48:46 +01:00
Marek Marczykowski-Górecki
873706428e
dispvm: fix firewall propagation when the calling VM has no rules set
Fixes QubesOS/qubes-issues#1608
2016-01-18 02:19:19 +01:00
Marek Marczykowski-Górecki
ce75ba411f
tests: "empty" firewall propagation
Check if "empty" firewall is also properly propagated.

QubesOS/qubes-issues#1608
2016-01-18 02:09:17 +01:00
Marek Marczykowski-Górecki
04415e13fe
version 3.1.11 2016-01-15 17:35:25 +01:00
Marek Marczykowski-Górecki
5d36923170
qmemman: fix race condition on starting new VM
Force refreshing domain list after starting new VM, even if the
triggering watch wasn't about domain list change. Otherwise (with
outdated domain list) memory allocated to a new VM, but not yet used may
be redistributed (leaving to little to the Xen itself).

Fixes QubesOS/qubes-issues#1389
2016-01-14 04:37:02 +01:00
Marek Marczykowski-Górecki
411e8b5323
qmemman: refresh domain list holding global_lock
Retrieve a domain list only after obtaining global lock. Otherwise an
outdated list may be used, when a domain was introduced in the meantime
(starting a new domain is done with global lock held), leading to #1389.

QubesOS/qubes-issues#1389
2016-01-14 04:34:53 +01:00
Marek Marczykowski-Górecki
caa75cbc18
tests: regression test for #1389
QubesOS/qubes-issues#1389
2016-01-14 04:28:17 +01:00
Marek Marczykowski-Górecki
3eccc3a633
qmemman: use try/finally to really release the lock
Currently not needed in practice, but a preparation for the next
commit(s).

QubesOS/qubes-issues#1389
2016-01-14 03:32:18 +01:00
Marek Marczykowski-Górecki
6a99b0b2ba
qmemman: add some useful logging for #1389
QubesOS/qubes-issues#1389
2016-01-14 03:15:38 +01:00
Marek Marczykowski-Górecki
f4d46c7855
tests: add a test for proper saving of DispVM firewall rules
Test if DispVM firewall rules are:
 - inherited from a calling VM
 - saved properly (so will be effective after firewall reload)
 - saved only for that DispVM (#1608)

QubesOS/qubes-issues#1608
2016-01-14 01:14:41 +01:00
Marek Marczykowski-Górecki
46a338d087
version 3.1.10 2016-01-12 12:05:19 +01:00
Marek Marczykowski-Górecki
8b9049d8c6
core/hvm: create root-cow.img if it's missing
It should be created at VM creation time (or template changes commit).
But for example for HVM templates created before implementing
QubesOS/qubes-issues#1573, there would be no such image. So create it
when needed, just before VM startup

Fixes QubesOS/qubes-issues#1602
2016-01-11 21:53:33 +01:00
Marek Marczykowski-Górecki
78b63eb21a
qmemman: fix crash when VM fails to start
In this case, qmemman would not manage to get any memory state for such
VM, so memory_current would be 'None'. But later it would perform
arithmetics on it, which would result in qmemman crash (TypeError
exception).

Fixes QubesOS/qubes-issues#1601
2016-01-11 21:50:57 +01:00
Marek Marczykowski-Górecki
301eed55b3
version 3.1.9 2016-01-07 06:38:06 +01:00
Marek Marczykowski-Górecki
db136674a9
tests: workaround libvirt bug - domain ID desynchronization 2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
baffef0ef0
tests: fix qvm-move-to-vm error code checking
Currently error code is 28 (ENOSPC). But generally any non-zero is
expected result here.

Fix test for QubesOS/qubes-issues#1355
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
24ad20cfe6
tests: add a simple dom0 backup test
Regression test for:
QubesOS/qubes-issues#1515

It assumes existing broken symlink in user dom0 home. Thanks for systemd
it is the case (`~/.local/share/systemd/user`).
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
ba3b908b73
backup: do not dereference symlinks in dom0 user home backup
Symlinks there should be preserved. Additionally broken symlink would
cause the backup to fail.

Fixes QubesOS/qubes-issues#1515
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
530a79417f
Add some logging to ease debugging libvirt errors
Temporary add some more logging to ease debugging libvirt errors.
Unfortunatelly stack trace doesn't contain actual error.

QubesOS/qubes-issues#1537
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
4af5a0503d
tests: qvm-revert-template-changes
Regression test for:
QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
f977858610
minor: add missing coding declaration 2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
35cb82cd2b
storage: use root-cow.img for HVM template, to support reverting changes
We still can't support running HVM template and its VMs simultaneously
(easily), but still, have root-cow.img handled for HVM template, to
allow qvm-revert-template-changes.

Fixes QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
fa196f1350
storage: actually use storage.root_img and such properties
Actual VM root disk used hardcoded image names, instead of properties
set for that purpose...
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
b26f2a73b4
core: mark QubesTemplateHVm.rootcow_img as property
Add missing '@property'.

QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Bahtiar `kalkin-` Gadimov
fdd618b420
Move xen storage tests to own file
This allows to run just the general storage tests without all the slow xen
storage based tests.
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
181eb3e764
qmemman: handle memory assigned to VM but not yet used
When VM got some memory assigned, balloon driver may not pick it up
immediatelly and the memory will still be seen as "free" by Xen, but VM
can use (request) it at any time. Qmemman needs to take care of such
memory (exclude it from "free" pool), otherwise it would redistribute it
to other domains, allowing the original domain to drain Xen memory pool.

Do this by redefining DomainState.memory_actual - it is now amount of
memory available to the VM (currently used, or possibly used). Then
calculate free memory by subtracting memory allocated but not used
(memory_target-memory_current).

Fixes QubesOS/qubes-issues#1389
2016-01-06 00:40:10 +01:00
Marek Marczykowski-Górecki
e30e802903
qmemman: add --debug option 2016-01-06 00:39:00 +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
66475e5ca7 qubes/tests/run: Fix running foregin TestCases
This is needed, because when tests fail to load, unittest module
generates artificial „LoadTestsFailure” class -- not based on our
QubesTestCase, so it does not have .log attribute.
2015-12-29 20:08:47 +01:00
Wojtek Porczyk
13b1a7201a qubes/tests: fix tearing down QubesTestCase 2015-12-29 16:49:17 +01:00