Commit Graph

3191 Commits

Author SHA1 Message Date
Rusty Bird
3e3ac36f58
cp --reflink=auto to speed up clone/backup/restore on btrfs 2015-11-10 17:10:03 +00:00
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
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
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
Marek Marczykowski-Górecki
28cc933c4c
qvm-prefs: fix validation of 'timezone' property
This should be done in QubesVm class (property setter). But since we're
going to rewrite both qvm-prefs and QubesVm, settle on smaller change
for now.

QubesOS/qubes-issues#1184
2015-10-05 05:56:16 +02:00
Marek Marczykowski-Górecki
d2617917be
qvm-prefs: refuse negative 'qrexec_timeout' value
This should be done in QubesVm class (property setter). But since we're
going to rewrite both qvm-prefs and QubesVm, settle on smaller change
for now.

Fixes QubesOS/qubes-issues#1273
2015-10-05 05:54:21 +02:00
Marek Marczykowski-Górecki
0e37ac617a
qvm-prefs: unify 'seamless_gui_mode' with other true/false properties 2015-10-05 05:53:48 +02:00
Marek Marczykowski-Górecki
7be7cf2c5e
qvm-prefs: fix setting dispvm_netvm to none
Fixes QubesOS/qubes-issues#1272
2015-10-05 05:53:04 +02:00
Marek Marczykowski-Górecki
16b8fa011b
qvm-prefs: fix display format of 'label' property
Fixes QubesOS/qubes-issues#1274
2015-10-05 05:52:35 +02:00
Marek Marczykowski-Górecki
9ea81c50ae
tests: add tests for 'qvm-prefs'
QubesOS/qubes-issues#1184
QubesOS/qubes-issues#1274
QubesOS/qubes-issues#1273
QubesOS/qubes-issues#1272
2015-10-05 05:52:21 +02:00
Marek Marczykowski-Górecki
958b59cc00
core: Show the right kernel version for DispVMs
Fixes QubesOS/qubes-issues#948
2015-10-03 01:50:15 +02:00
Marek Marczykowski-Górecki
4f04c62f36
Merge branch 'bug1241'
Fixes QubesOS/qubes-issues#1241
2015-10-02 01:59:17 +02:00
Marek Marczykowski-Górecki
fa3325a2b2
Merge branch 'bug1198'
Fixes QubesOS/qubes-issues#1198
2015-10-02 01:59:05 +02:00