Commit Graph

5601 Commits

Author SHA1 Message Date
Frédéric Pierret (fepitre)
9472e73465
mac address: lowercase of default value as in _setter_mac 2019-05-23 11:30:12 +02:00
Frédéric Pierret (fepitre)
06ec862be4
qubesdb: add qubes-mac path entry 2019-05-23 11:30:08 +02:00
Marek Marczykowski-Górecki
33bf3d4506
tests/salt: log more details about failures
Log command output on failure. By default CalledProcessError
presentation do not include it.
2019-04-13 21:51:42 +02:00
Marek Marczykowski-Górecki
5d0f8f8efa
tests/mime: confirm closing Firefox
If Firefox is started for the first time, it will open both requested
page and its welcome page. This means closing the window will trigger a
confirmation about closing multiple tabs. Handle this.
2019-04-13 21:50:34 +02:00
Marek Marczykowski-Górecki
66de41ac26
tests: use pkill instead of killall
killall isn't installed by default
2019-04-13 16:42:37 +02:00
Marek Marczykowski-Górecki
56ec271606
Fix initial value of dom0 static-max entry
This value needs to be set to actual static max for qmemman to work
properly. If it's set higher than real static-max, qmemman will try to
assign more memory to dom0, which dom0 could not use - will be wasted.
Since this script is executed before any VM is started, simply
take the current dom0 memory usage, instead of parsing dom0_mem Xen
argument. There doesn't seem to be nice API to get this value from Xen
directly.

Fixes QubesOS/qubes-issues#4891
2019-04-05 05:00:11 +02:00
Marek Marczykowski-Górecki
75916dca5d
tests: fix waiting for audio recording to end 2019-04-05 03:16:55 +02:00
Marek Marczykowski-Górecki
fc154fbbad
tests: fix resource leaks - process not waited for 2019-04-02 18:48:43 +02:00
Marek Marczykowski-Górecki
6b93aea5bd
tests: remove unused imports 2019-04-02 18:48:35 +02:00
Marek Marczykowski-Górecki
4f71e9775f
vm/adminvm: mark AdminVM as updateable 2019-03-26 01:19:34 +01:00
Marek Marczykowski-Górecki
4234fe5112
tests: fix cleanup after reflink tests
First make the directory accessible again, otherwise os.path.ismount may
not detect it (so umount would not be called) and then rmdir will fail.
2019-03-18 02:21:38 +01:00
Marek Marczykowski-Górecki
aa7c0b71a7
storage/lvm: refresh size cache if it's older than 30sec
Disk usage may change dynamically not only at VM start/stop. Refresh the
size cache before checking usage property, but no more than once every
30sec (refresh interval of disk space widget)

Fixes QubesOS/qubes-issues#4888
2019-03-17 20:45:46 +01:00
Marek Marczykowski-Górecki
b6f77ebfa1
tests: do not use lazy unmount
If unmount is going to fail, let it do so explicitly, instead of hiding
the failure now, and observing it later at rmdir.
And if it fails, lets report what process is using that mount point.
2019-03-16 03:06:24 +01:00
Marek Marczykowski-Górecki
65bdff1fdf
tests: re-enable policy prompt tests in travis
Xenial environment has much newer GTK/Glib. For those test to run, few
more changes are needed:
 - relevant GTK packages installed
 - X server running (otherwise GTK terminate the process on module
   import...)
 - enable system side packages in virtualenv set by travis
2019-03-16 03:03:49 +01:00
Marek Marczykowski-Górecki
b68746163b
travis: switch to xenial
QubesOS/qubes-issues#4613
2019-03-15 20:55:04 +01:00
Marek Marczykowski-Górecki
a46a43635f
qubespolicy: fix default target if it's a keyword
Compare "api name", not "display name" when selecting default target in
confirmation dialog.
And add test for this case.

Fixes QubesOS/qubes-issues#4881
2019-03-15 05:35:36 +01:00
Marek Marczykowski-Górecki
aa798bf943
app: add missing load_stage=3 to global properties
Global properties should be loaded in stage 3, mark them as such.
Otherwise they are not loaded at all.
This applies to stats_interval and check_updates_vm. Others were
correct.

Fixes QubesOS/qubes-issues#4856
2019-03-14 14:56:01 +01:00
Marek Marczykowski-Górecki
68622462d0
version 4.1.0 2019-03-08 18:24:30 +01:00
Marek Marczykowski-Górecki
60bbbdd702
Merge branch 'kernelopts-files'
* kernelopts-files:
  vm: allow files in kernels_dir override built-in default kernelopts
2019-03-08 18:08:12 +01:00
Marek Marczykowski-Górecki
c093e14077
Merge branch 'libvirt-template-r41'
* libvirt-template-r41:
  libvirt: adjust domain xml template for upstream PVH format
2019-03-08 18:07:07 +01:00
Marek Marczykowski-Górecki
517fb8da26
Merge branch 'release4.0' 2019-03-08 00:28:08 +01:00
Marek Marczykowski-Górecki
13f351a4a7
version 4.0.40 2019-03-08 00:16:43 +01:00
Marek Marczykowski-Górecki
3a9c28b4ff
rpm: add BR: gcc 2019-03-02 16:09:09 +01:00
Marek Marczykowski-Górecki
dde3c637a1
qubes-hcl-report: quote VM name
Reported by @v6ak
2019-03-01 03:12:52 +01:00
Marek Marczykowski-Górecki
1ba8d7971f
tests: unit tests for internal.SuspendPre and internal.SuspendPost API 2019-02-28 00:43:33 +01:00
Marek Marczykowski-Górecki
092fb9659d
Make pylint happy
Fix multiple instances of 'no-else-raise' warning.
2019-02-27 18:40:18 +01:00
Marek Marczykowski-Górecki
933882ee9b
tests: fix race condition in firewall formatting test
Use fixed timestamp.
2019-02-27 15:38:22 +01:00
Marek Marczykowski-Górecki
2de5a8e894
vm,templates: allow to obtain common kernelopts from a kernel package
If kernel package ships default-kernelopts-common.txt file, use that
instead of hardcoded Linux-specific options.
For Linux kernel it may include xen_scrub_pages=0 option, but only if
initrd shipped with this kernel re-enable this option later.

QubesOS/qubes-issues#4839
QubesOS/qubes-issues#4736
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
e110cbecb3
storage: fallback kernels_dir path if there is no 'kernel' volume
Return meaningful value for kernels_dir if VM has no 'kernel' volume.
Right now it's mostly useful for tests, but could be also used for new
VM classes which doesn't have modules.img, but still use dom0-provided
kernel.
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
723b33a2f6
vm: move comment about memory overhead constants near their definition 2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
9257a6d14f
Do not abort suspend hooks if any qubes.Suspend* service fails to run
First of all, do not try to call those services in VMs not having qrexec
installed - for example Windows VMs without qubes tools.
Then, even if service call fails for any other reason, only log it but
do not prevent other services from being called. A single uncooperative
VM should generally be able only to hurt itself, not break other VMs
during suspend.

Fixes QubesOS/qubes-issues#3489
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
eeec2e0ddd
qubespolicy: forbid qrexec loopback connections at policy level
libxenvchan currently can't handle loopback connections. Since error
reporting on vchan connection setup is far from perfect, try to avoid
making such connections at all.

QubesOS/qubes-issues#951
Fixes QubesOS/qubes-issues#4804
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
202e3df6b6
vm/mixin/net: disconnect network interface on backend shutdown/crash
Since we have more reliable domain-shutdown event delivery (it si
guaranteed to be delivered before subsequent domain start, even if
libvirt fails to report it), it's better to move detach_network call to
domain-shutdown handler. This way, frontend domain will see immediately
that the backend is gone. Technically it already know that, but at least
Linux do not propagate that anywhere, keeping the interface up,
seemingly operational, leading to various timeouts.
Additionally, by avoiding attach_network call _just_ after
detach_network call, it avoids various race conditions (like calling
cleanup scripts after new device got already connected).

While libvirt itself still doesn't cleanup devices when the backend
domain is gone, this will emulate it within qubesd.

Fixes QubesOS/qubes-issues#3642
Fixes QubesOS/qubes-issues#1426
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
357231ca8f
tests: network reconnect after network provider shutdown/crash
QubesOS/qubes-issues#3642
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
e69bd3c572
tests: fix race condition between mkfs and udev
Just after LVM volume is created, udev tries to analyze it. This
prevents mkfs from creating filesystem there.
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
50a89aac3f
tests: check if page scrubbing is still enabled when switching kernel
QubesOS/qubes-issues#4736
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
5222650868
vm/adminvm: add stubs for kill/shutdown functions
Report proper error message, instead of throwing AttributeError on such
calls.

Fixes QubesOS/qubes-issues#4645
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
318ed439ff
storage/file: gracefully handle not mounted pool
Fixes QubesOS/qubes-issues#4668
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
27a0fe25ab
app: allow removing VM referencing only itself
Fixes QubesOS/qubes-issues#4224
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
7433f83581
tests: add in-use storage pool removal test
QubesOS/qubes-issues#4454
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
5aa49168e5
tests: make storage.TC_00_Pool usable outside of dom0 2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
2bd709501b
tests: adjust cleanup to added in-use storage pool detection on removal 2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
80e57e16be
Allow setting default_template to none
It may make sense to force explicit template choice on VM creation,
especially with more restrictive qrexec policy.
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
4f5687440f
Prevent removal of in-use storage pool
Fixes QubesOS/qubes-issues#4454
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
23bfc18535
Add pool-add, pool-pre-delete, pool-delete events 2019-02-27 06:04:01 +01:00
Marek Marczykowski-Górecki
d8b6d3efde
Make add_pool/remove_pool coroutines, allow Pool.{setup,destroy} as coroutines
Pool setup/destroy may be a time consuming operation, allow them to be
asynchronous. Fortunately add_pool and remove_pool are used only through
Admin API, so the change does not require modification of other
components.
2019-02-27 06:03:57 +01:00
Marek Marczykowski-Górecki
adbc618545
Use correct bool properties parsing by default
Boolean properties require specific setter to properly handle literal
"True" and "False" values. Previously it required all bool properties to
include 'setter=qubes.property.bool' in addition to 'type=bool'.
This fixes loading some boolean properties from qubes.xml. Specifically
at least include_in_backups on DispVM class lacked setter, which
resulted in property being reset to True automatically on qubesd
restart.

Fixes QubesOS/qubes-issues#4831
2019-02-23 15:43:19 +01:00
Marek Marczykowski-Górecki
f9593ce3e6
vm: allow files in kernels_dir override built-in default kernelopts
If default-kernelopts-pci.txt is present, it will override default
built-in kernelopts for the VMs with PCI device assigned.
Similarly if default-kernelopts-nopci.txt is present, it will override
default kernelopts for VMs without PCI devices.
For template-based VMs, kernelopts of the template takes precedence over
default-kernelopts-nopci.txt but not default-kernelopts-pci.txt.

Fixes QubesOS/qubes-issues#4839
2019-02-23 12:53:49 +01:00
Nicolas Iooss
c5cfb81b94
doc: fix paths of jinja templates for libvirt Xen configuration
The jinja templates are located in either /etc/qubes/templates or
/usr/share/qubes/templates. /usr/share/templates is not used and
/usr/share/qubes/template/ does not exist.

Fix the paths that are documented in
https://dev.qubes-os.org/projects/core-admin/en/latest/libvirt.html
2019-02-20 23:49:57 +01:00
Marek Marczykowski-Górecki
5b28c17eed
version 4.0.39 2019-02-19 22:33:59 +01:00