Commit Graph

3202 Commits

Author SHA1 Message Date
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
ea68c6a766 xen: fix template vm storage code 2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
11047bf427 Use platform specific locking method
None of found existing portable locking module does support RW locks.
Use lowlevel system locking support - both Windows and Linux support
such feature.

Drop locking code in write_firewall_conf() b/c is is called with
QubesVmCollection lock held anyway.
2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
a5a2c0b97c Revert "release qubes.xml lock on object destroy"
This reverts commit 39e056b74acca3854c5707d8f2cbcd199b8cac75.
This change rely on reverted python-locking use.
2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
5fb1991ad5 QubesWniVmStorage: prefix system user with "qubes-vm-". 2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
f927f12e39 QubesWniVmStorage: pass all positional parameters to base class 2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
392b70a4d8 Create missing private.img when needed
Not only for HVM, but any VM type which support private.img.
2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
21c908b9b2 Move storage-related VM rename code to storage class 2014-11-19 12:50:28 +01:00
Marek Marczykowski-Górecki
ada5ebd784 Use "None" in *_img attr for "not applicable"
Some VM types do not have particular disk image. Instead of enumerating
cases in storage class, signal unused image from VM class by setting
appropriate attr to None.
2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
396011e227 Fix initialization of storage class
Move it earlier - before first access to *_img attrs.
2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
7b5dd67b58 Completely move *_img attrs to QubesVmStorage class 2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
e2bea656b4 Add vm-configs for WNI 2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
ec37a4e681 Rename vm-configs directory to be more generic 2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
35ecfc82ef wni: QubesWniVmStorage and update settings file 2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
2457a705d0 Load Qubes DB python module only when needed.
This is temporary band aid for the python module problems.
This should also slightly speed up some tools (not all uses Qubes DB).
2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
e8715cd561 release qubes.xml lock on object destroy
This will ensure that lock will be released even in case of error.
2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
50188c8832 Use relative path in system_path dict instead of path templates
This will allow use of correct slashes/backslashes (os.path.join instead
of hardcoded '/').
2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
a17f6ef779 Update QubesHVM to use QubesVmStorage classes
Also add external drive support to QubesXenVmStorage (move from
QubesHVM).
2014-11-19 12:50:27 +01:00
Marek Marczykowski-Górecki
66b39ac2a2 Typo fix in error message. 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
4ae720956d Use file copy instead of symlink on Windows 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
467477409d makefile/windows: install qvm-tools with .py extension
So system will automatically run them with python interpreter (wherever
it is installed). This require to have ".py" in PATHEXT variable.
2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
675a164e7d makefile/windows: use c:\qubes as default data dir 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
eaac99bf64 qvm-tools: check if running as root only on systems with os.geteuid 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
b323a4d1e3 core: Fix handling the case when no settings file present. 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
50e44ce22d makefile: Improve readability of settings.py install command 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
ec17f7d329 core/xen: setup xen-specific defaults in separate settings file 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
d91162e74d minor comment fix 2014-11-19 12:50:26 +01:00
Marek Marczykowski-Górecki
0a1f3d0a44 core: split VM images handling to separate class
This will ease handling different types of VMM (which can require
different image types, location etc).
2014-11-19 12:50:25 +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
a8bee8d978 Ignore error when 'xen.lowlevel.xs' doesn't exists
There are still few uses of direct xenstore access, most of them are
xen-specific (so doesn't need to be portable). For now simply don't
connect to xenstore when no 'xen.lowlevel.xs' module present. It will
break such xen-specific accesses - it must be somehow reworked - either
by adding appropriate conditionals, or moving such code somewhere else
(custom methods of libvirt driver?).
2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
bc58ca5edb Remove import xen.lowlevel.xc
There is still use of it: QubesHost.get_free_xen_memory and
QubesHost.measure_cpu_usage. Will migrate them to libvirt later (for now
some things will be broken - namely qubes-manager).
2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
6193b4fea3 Add support for VMM-specific settings. 2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
80c89cc91c Delay resolving system_path['qubes_base_dir']
So changes made by os/vmm-specific settings would be taken into account.
2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
f6835346d4 Move initialization code at the end of file
So all of it will be in one place.
2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
aad945e01b makefile: install only relevant stuff according to OS/VMM 2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
69d1ae645f Do not use qmemman when not present (installed) on particular VMM 2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
72e415a807 move qubes-notify-* to libexec 2014-11-19 12:50:25 +01:00
Marek Marczykowski-Górecki
ed13972e4e Remove xenstore-watch-qubes
Since we have Qubes DB, it needed anymore.
2014-11-19 12:50:24 +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
fb353ea615 core: fix regression in iptables rule generator
This commit:
eb11a2f Use QubesDB instead of Xenstore.
introduced regression in iptables rules generator (sed misuse...).
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
c8fb5cfd99 dispvm: minor fixes 2014-11-19 12:50:24 +01:00
Marek Marczykowski
ff2c925e18 dispvm: use qubesdb instead of xenstore 2014-11-19 12:50:24 +01:00
Marek Marczykowski
457737b6cc QubesVm: ignore errors during debug VM config file creation
Currently <vm-dir>/<vm-name>.conf file is used only for debugging
purposes - the real one is passed directly to libvirt, without storing
on disk for it.
In some cases (e.g. qvm-clone) QubesVM.create_config_file() can be
called before VM directory exists and in this case it would fail.
Because it isn't critical fail in any means (the config file will be
recreated on next occasion) just ignore this error.

Final version most likely will have this part of code removed
completely.
2014-11-19 12:48:28 +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
31424603fa rpm: move R: xen-runtime inside vmm-xen deps block
Do not depend on xen package unconditionally.
2014-11-19 12:48:28 +01:00
Marek Marczykowski
6c345aaccf hvm: enable missing features
Apparently libvirt driver have own defaults for machine features - all
disabled (instead of using libxl defaults). So enable such features
explicitly.
2014-11-19 12:48:28 +01:00
Marek Marczykowski
5644656859 hvm: add UUID to libvirt config
Add missing entry. Also fix indentation of first few lines.
2014-11-19 12:48:28 +01:00
Marek Marczykowski
3f6947b87e dispvm: fix domain ID handling
Do not use obsoleted get_xid() function.
2014-11-19 12:48:27 +01:00
Marek Marczykowski
9393b5f931 Fix domain rename
libvirt_domain object needs to be recreated, so force it. Also fix
config path setting (missing extension) - create_config_file
uses it as custom config indicator (if such detected, VM settings -
especially name, would not be updated).
2014-11-19 12:48:27 +01:00