Commit Graph

31 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
bae493d015
Kill remaining qubesdb-daemon instances after shutting down all the VMs
It may happen (especially when VM doesn't close cleanly and needs to be
killed) that qubesdb-daemon will not notice VM shutdown immediately.
Normally it would stop after 60s timeout, but speed it up in case of
system shutdown

QubesOS/qubes-issues#1425
2015-11-15 02:06:19 +01:00
Marek Marczykowski-Górecki
46cbb4a133
Prevent stopping xenconsoled before shutting down all the VMs
Otherwise still running VMs will hang, consuming 100% CPU.

QubesOS/qubes-issues#1425
2015-11-14 23:29:21 +01:00
Marek Marczykowski-Górecki
06f5922da6
Adjust dom0 sched-credit weight based on default libvirt value for VMs
While default value for VMs is normally 256, libvirt set it to
(hardcoded) 1000. So adjust dom0 accordingly.

Fixes QubesOS/qubes-issues#1404
2015-11-11 04:30:01 +01:00
Marek Marczykowski-Górecki
d27d22a3cf
Merge remote-tracking branch 'qubesos/pr/5'
* qubesos/pr/5:
  fix VM autostart race condition

Fixes qubesos/qubes-issues#1075

Conflicts:
	linux/aux-tools/prepare-volatile-img.sh
2015-08-01 22:04:18 +02:00
Marek Marczykowski-Górecki
c4a28a943a
prepare-volatile-img: ensure that /usr/sbin in in the PATH
Build environment of LiveUSB does not contain /usr/sbin in path.
2015-08-01 22:02:07 +02:00
Marek Marczykowski-Górecki
90393c33f2
core: add offline mode to qvm-create, qvm-prefs
This is required to create VMs in process of building Live system, where
libvirt isn't running.

Additionally there is no udev in the build environment, so needs to
manually create /dev/loop*p* based on sysfs info.
2015-08-01 21:58:38 +02:00
Marek Marczykowski-Górecki
c9a670cbd1 linux/block-snapshot: fix handling root.img being already block device 2015-05-27 23:52:57 +02:00
Marek Marczykowski-Górecki
2856b6a836 Wait for udev to create loopXpY device when preparing volatile.img 2015-05-13 04:12:42 +02:00
Marek Marczykowski-Górecki
48945a9d37 linux/systemd: prevent user login before VMs autostart
When user logins, login script will try to connect all guid to all the
running VMs. If VMs are still booting at this stage, will never
automatically get its guid (until user tries to start some program
there). This can for example lead to lack of nm-applet icon.
2015-04-12 03:11:03 +02:00
Marek Marczykowski-Górecki
d76bd0ad1d Use partitioned loop device instead of device-mapper to prepare volatile.img
There was a lot problems with device-mapper, at least it asynchronous
creation, races with udev, problems with cleanup.
2015-04-03 11:24:37 +02:00
Marek Marczykowski-Górecki
98ab523da4 Wait for udev to process all the events during volatile.img preparation
Otherwise it could happen that the device will still be opened by udev,
so can't be freed by kpartx
2015-03-30 21:30:58 +02:00
Marek Marczykowski-Górecki
063e2617d6 Cleanup after failed volatile.img preparation 2015-03-30 16:18:52 +02:00
Marek Marczykowski-Górecki
668a2ac62b linux: set sgid for /var/run/qubes
This is much simpler than ensuring proper group set in every qubes
tool.
2015-03-19 10:31:50 +01:00
Marek Marczykowski-Górecki
bc9e4d1fe5 linux/block-snapshot: improve support for HVM domain
Handle stubdomains (the same device will be removed twice).
Use target domain name instead of stubdomain name for committing
template changes.
2015-02-22 14:44:09 +01:00
Marek Marczykowski-Górecki
fc439edf2f linux/block-snapshot: call qvm-template-commit in offline mode
When called from libvirt->libxl, there is libvirt lock taken on that
domain. Because of that, we can't access libvirt domain, so basically
any runtime information. Without that --offline-mode, script waited on
the lock and then was killed by libxl after a timeout - before actually
committing the changes.
2015-02-22 04:01:18 +01:00
Marek Marczykowski-Górecki
5d9fa977e2 Ensure that qvm-shutdown is called while libvirtd is still running 2015-02-09 03:47:45 +01:00
Marek Marczykowski-Górecki
2554d6aee3 Ensure that qubes-netvm.service is started after libvirtd 2015-02-02 04:49:56 +01:00
Marek Marczykowski-Górecki
c74fda802c Use tmpfile.d to create /var/run subdirs
This way it will be done much earlier, so qubes-db can be started before
qubes-core.service - which will solve startup dependency loop problem.
2015-02-02 04:48:42 +01:00
Marek Marczykowski-Górecki
8d0863d40f storage: Force sync after preparing volatile.img
This makes possible to release d-m partitions devices sooner (so avoid
race with kpartx).
2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
d5cb05fdc6 Move dispvm+qmemman service files to relevant directories
Remove them from global services dir.
2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
0009805041 rpm+makefile: move build/install code to Makefile files
This makes build "scripts" not tied to Fedora-specific files. Especially
ease porting to other platforms.
2014-11-19 12:50:24 +01:00
Marek Marczykowski-Górecki
7484ddfd2b startup-misc: populate local domain id
Apparently libvirt doesn't do it.
2014-11-19 12:50:24 +01:00
Marek Marczykowski
f159f3e168 Use QubesDB instead of Xenstore.
Mostly done. Things still using xenstore/not working at all:
 - DispVM
 - qubesutils.py (especially qvm-block and qvm-usb code)
 - external IP change notification for ProxyVM (should be done via RPC
   service)
2014-11-19 12:48:28 +01:00
Marek Marczykowski
a880483092 Migration to libvirt - core part
Still not all code migrated, added appropriate TODO/FIXME comments.
2014-11-19 12:47:00 +01:00
Marek Marczykowski
4a4fb5e243 qmemman: change process model from forking to single process + sd_notify
Forking daemon after initializing hypervisor connection can cause
problems (and actually does in case of libvirt).
To notify systemd when daemon is ready use notify socket (previously it
was termination of parent process).
2014-11-19 12:47:00 +01:00
Marek Marczykowski-Górecki
e90e1c62ec proxyvm: add support for rules with expire time (#760) 2014-03-28 02:54:59 +01:00
Marek Marczykowski-Górecki
6b4c96d195 Improve block devices detection during system startup
Not only refresh the info about mounted devices, but also check for
others - detected before xenstored was running. Because of recent change
in udev rules (adding flock) it shouldn't deadlock now.
2014-01-13 05:00:01 +01:00
Marek Marczykowski-Górecki
bba989e0a6 Move meminfo-writer to linux-utils repo
It is common for both dom0 and VM, and also quite linux-specific
(other OSes will need other implementation). So move to linux-specific
repo (not dom0-specific).
2014-01-05 05:36:50 +01:00
Marek Marczykowski-Górecki
59b9e43060 Fix VM autostart - set $DISPLAY env variable
Without this, started qrexec-daemon would not have access to GUI,
especially can't display Qubes RPC confirmation dialogs.
2013-11-26 16:53:26 +01:00
Marek Marczykowski-Górecki
6fddae3b9b Support for autostart VMs (#724) 2013-11-20 02:57:17 +01:00
Marek Marczykowski
a84886db07 Move all files one level up 2013-03-16 19:56:51 +01:00