Commit Graph

3532 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
34f7ddd41e
core: force QubesDB reconnection on VM start 2015-11-07 05:43:34 +01:00
Marek Marczykowski-Górecki
49141d444e
tests: resize private.img/root.img
QubesOS/qubes-issues#1268
2015-11-07 05:43:32 +01:00
Marek Marczykowski-Górecki
cf6c6baded
Improve resize2fs call for root.img resize
1. Do not start GUI session - to reduce startup time
2. Use user="root" instead of sudo - not all templates have sudo
installed (for example fedora-21-minimal)
3. Add missing wait=True - otherwise VM may be shutdown during the
operation.

QubesOS/qubes-issues#1268
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
cfe782f04a
Merge remote-tracking branch 'qubesos/pr/8'
* qubesos/pr/8:
  Support more VM types in qvm-grow-root

Fixes QubesOS/qubes-issues#1268
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
1e9221e1c8
Merge remote-tracking branch 'origin/pr/8'
* origin/pr/8:
  typo
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
f714a8224b
backup: follow symbolic links
For a long time Qubes backup did not include symlinked files, which
apparently is quite common practice for users with multiple disks (for
example HDD + SSD). It is covered in documentation
(https://www.qubes-os.org/doc/secondary-storage/), but better solution
would be to simply include symlinked files.

Restore of such files would (of course) not preserve the symlinks -
normal files will be restored instead. But that's fine. If the user want
to move the data to another location, he/she can do that and restore the
symlink.

The only possible breakage from this change is having a copy (instead of
symlink) to a VM icon. But storing that symlink in a backup was broken
for some time (because of --xform usage) and it is handled during
restore, so not a real problem.

This doesn't cover all the problems with symlinked VM images - the other
one is qvm-block behaviour, which would treat such images as non-system
disks, so easily detachable (which would break VM operation). But that's
another story.

Fixes QubesOS/qubes-issues#1384
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
6051a89227
tests: add regression test for #1386
QubesOS/qubes-issues#1386
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
8275e828af
backup: move existing directories out of the way during restore
In most cases it would be some leftover after failed restore, or even
the reason why the user is restoring a VM in the first place. Move it to
nearby directory, but do not remove - backup tool should _never_ remove
any data.

When the pre-existing directory would not be moved, restore utility
(`shutil.move`) would place the data inside of that directory, with
additional directory level (for example `/var/lib/qubes/appvms/work/work`),
which would be wrong and would later fail on `vm.verify_files`. And more
importantly - such VM would not work.

Fixes QubesOS/qubes-issues#1386
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
0695e7ba78
utils/QubesWatch: register libvirt event loop only when really launched
Registering event implementation in libvirt and then not calling it is
harmful, because libvirt expects it working. Known drawbacks:
- keep-alives are advertised as supported but not really sent (cause
  dropping connections)
- connections are not closed (sockets remains open, effectively leaking
  file descriptors)

So call libvirt.virEventRegisterDefaultImpl only when it will be really
used (libvirt.virEventRunDefaultImpl called), which means calling it in
QubesWatch. Registering events implementation have effect only on new
libvirt connections, so start a new one for QubesWatch.

Fixes QubesOS/qubes-issues#1380
2015-11-07 03:51:51 +01:00
Marek Marczykowski-Górecki
93b7b3cb72
utils/QubesWatch: improve error handling (minor) 2015-11-07 03:51:50 +01:00
Marek Marczykowski-Górecki
d38883833a
core: ensure that QubesDB connections are closed when disposing a VM collection
There are some circular dependencies (TemplateVM.appvms,
NetVM.connected_vms, and probably more), which prevents garbage
collector from cleaning them.

Fixes QubesOS/qubes-issues#1380
2015-11-07 03:51:50 +01:00
Marek Marczykowski-Górecki
a7b124d6da
tests: fix race condition in copy-paste test
Don't wait arbitrary time for paste to finish.
2015-11-03 02:47:08 +01:00
Marek Marczykowski-Górecki
c30c9c7d4e
tests: minor fixes to time sync tests
- don't crash when ClockVM wasn't set previously
- increase allowed delta (for slow systems)
2015-11-03 02:46:03 +01:00
Marek Marczykowski-Górecki
31ad72aa70
tests: better handle templates with no 'createrepo' installed 2015-11-03 02:44:25 +01:00
Marek Marczykowski-Górecki
44c340c046
tests: add wait_for_window function to reduce code duplication 2015-11-03 02:43:46 +01:00
Marek Marczykowski-Górecki
cf110c74e2
tests: fix cleanup in dom0 updates tests
The only directory to cleanup is cls.tmpdir. So make it simple, without
class property cleanup_paths, which for some reason didn't wasn't
emptied in tearDownClass.
2015-11-03 02:40:53 +01:00
Marek Marczykowski-Górecki
5160423065
tests: perform dom0 update check using VMs of different templates
QubesOS/qubes-issues#1282
QubesOS/qubes-issues#1029
2015-10-30 14:58:23 +01:00
Marek Marczykowski-Górecki
33255964c7
tests: handle Whonix in simple GUI tests
Whonix VMs have always hostname of 'host', so handle that when searching
for a window based on its title.
2015-10-30 14:09:52 +01:00
Marek Marczykowski-Górecki
f064a4c6ea
tests: improve qvm-run of GUI apps tests, include qubes-desktop-run 2015-10-27 23:16:37 +01:00
Marek Marczykowski-Górecki
9cb62f8f4d
tests: VM updates (direct and through updates proxy) 2015-10-27 23:16:10 +01:00
Marek Marczykowski-Górecki
de295136ce
Fix "utils/QubesWatch: use timers to retry QubesDB watch registration" 2015-10-27 21:47:01 +01:00
Marek Marczykowski-Górecki
1c0ade6166
Fix race condition in QubesVm.get_cputime/get_mem
When domain is destroyed after isActive check, but before getting
actuall info, it would fail. So handle this situation.
2015-10-27 21:35:02 +01:00
Marek Marczykowski-Górecki
e475e291a9
tests: more qrexec tests, this time for deadlocks
Tests for recently discovered deadlocks on write(2).

QubesOS/qubes-issues#1347
2015-10-25 15:23:12 +01:00
Michal Rostecki
3be8bb31fb Support more VM types in qvm-grow-root
QubesOS/qubes-issues#1268
2015-10-24 19:58:03 +02:00
Patrick Schleizer
c2b5630637 typo 2015-10-21 20:57:30 +00:00
Wojtek Porczyk
dc3fcc3141 qubes/tests: port again the backported test runner
part of QubesOS/qubes-issues#1248
2015-10-17 00:20:44 +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
Marek Marczykowski-Górecki
75168c8aef
core: improve handling QubesDB startup errors
Kill the VM when QubesDB initialization fails, in any way, not only
QubesDB daemon itself.
2015-10-13 23:49:32 +02:00
Marek Marczykowski-Górecki
5c549e1134
core: Provide more meaningful error when failed to kill old QubesDB instance
This process may be running as root in case of default NetVM. But do not
kill it forcibly (through sudo or so), because it may also be stale
pid file. After all, QubesDB should automatically terminate when its VM
is terminated, so this code is already some error handling.

Fixes QubesOS/qubes-issues#1331
2015-10-13 23:46:59 +02:00
Wojtek Porczyk
4cf56b40bb add config for coverage.py 2015-10-12 16:40:46 +02:00
Marek Marczykowski-Górecki
2b7bd1f1f5
Merge remote-tracking branch 'qubesos/pr/7'
* qubesos/pr/7:
  Don't send screen layout to the VM if we haven't received it from xrandr because this breaks proper initial screen layout set by gui-agent Fixes QubesOS/qubes-issues#1305 QubesOS/qubes-issues#998
2015-10-11 02:56:25 +02:00
Marek Marczykowski-Górecki
b9fedb622e
version 3.1.1 2015-10-11 02:52:51 +02:00
Marek Marczykowski-Górecki
350e279f4f
Fix handling /etc/localtime hardlink
If /etc/localtime in dom0 is a hardlink to zoneinfo file (instead of
symlink) and more than one zoneinfo file is hardlinked to this inode,
appVMs will get invalid timezone, e.g. "Europe/Warsaw\x0aPoland".

Reported by @yaqu, fix provided by @yaqu
Fixes QubesOS/qubes-issues#1315
2015-10-10 17:30:40 +02:00
Marek Marczykowski-Górecki
18edf4946c
dispvm: get rid of obsolete symlinks to dvm.conf
Separate config file is no longer created for DispVM - the configuration
is passed directly to libvirt.

Fixes QubesOS/qubes-issues#1314
2015-10-10 05:22:44 +02:00
Marek Marczykowski-Górecki
820e5c0e69
Update stubdom memory allocation to 44MB
Since 677a79b "hvm: change default graphics to std vga ('xen')",
stubdomain uses 44MB RAM

QubesOS/qubes-issues#1136
2015-10-10 05:22:44 +02:00
HW42
912d4c1447
qubes-random-seed: feed kernel rng with randomness from dom0 2015-10-10 05:22:43 +02:00
Marek Marczykowski-Górecki
063b436b03
notify-updates: ignore chown error
If running as normal user, chown will fail. This isn't a problem,
because the file is probably already owned by the correct user. The
whole point about this chown is to give access to the file for normal
user, so if the write succeeded, it isn't needed.
2015-10-10 05:22:43 +02:00
Marek Marczykowski-Górecki
88b4a84cce
Merge remote-tracking branch 'origin/pr/7' into HEAD
* origin/pr/7:
  Properly account for Xen memory overhead to fix large VMs

QubesOS/qubes-issues#1136
2015-10-10 05:22:13 +02:00
qubesuser
540f4f7294 Properly account for Xen memory overhead to fix large VMs 2015-10-10 01:08:56 +02:00
Ivan Konov
78c3f40f89 Don't send screen layout to the VM if we haven't received it from xrandr
because this breaks proper initial screen layout set by gui-agent
Fixes QubesOS/qubes-issues#1305 QubesOS/qubes-issues#998
2015-10-09 22:56:41 +03:00
Marek Marczykowski-Górecki
2d8a8094ed
qmemman: add some comments about new condition for failing request
QubesOS/qubes-issues#1136
2015-10-09 19:29:15 +02:00
Marek Marczykowski-Górecki
f6fdec08f2
Merge remote-tracking branch 'origin/pr/6'
* origin/pr/6:
  Support large VMs by removing the fixed balloon iteration limit

QubesOS/qubes-issues#1136
2015-10-09 18:30:02 +02:00
qubesuser
a55172d63e Support large VMs by removing the fixed balloon iteration limit 2015-10-09 13:50:34 +02:00
Wojtek Porczyk
fb6acb5f6b core3: documentation fixes 2015-10-05 23:57:03 +02:00
Wojtek Porczyk
ea44c0acf3 qubes: pylint fixes
Fix bunch of errors and warnings.
2015-10-05 23:49:39 +02:00
Wojtek Porczyk
15713cbf46 qubes/tools: rewrite qvm-kill
Also new function, `error_runtime` for common parser.

fixes QubesOS/qubes-issues#1222
2015-10-05 18:06:02 +02:00
Wojtek Porczyk
015b01fe46 qubes/tools: unify looking up the domain
This is common operation that is repeatable.
2015-10-05 17:34:13 +02:00
Wojtek Porczyk
55e4ddcd3d qubes/tools: custom QubesArgumentParser
Common functions that revolve around running the tool (like
`dont_run_as_root`) will be methods of this class.
2015-10-05 14:03:11 +02:00
Wojtek Porczyk
c9cbf8ffe2 core3: fix mounting modules.img 2015-10-05 12:46:14 +02:00