Commit Graph

71 Commits

Author SHA1 Message Date
Wojtek Porczyk
a615a45ecd Merge remote-tracking branch 'woju/pull/13/head' into core3-devel 2016-06-02 13:24:15 +02:00
Marek Marczykowski-Górecki
bb2e1f2870 qubes/vm: handle VM toplevel directory in QubesVM object not Storage
This directory is not only for disk images (in fact disk images may be
elsewhere depending on choosen volume pool), so it would be cleaner to
handle (create/remove) it directly in QubesVM class.
2016-06-02 13:22:07 +02:00
Marek Marczykowski-Górecki
0a21300872 qubes/storage: unify _remove_if_exists argument type
In some places full volume object was called, in others - just file
path. Since this function is also used in some volume init/teardown, use
path everywhere.
2016-06-02 13:07:35 +02:00
Marek Marczykowski-Górecki
b119b2c36b storage/file: simplify search for origin volume of snapshot/read-only
Check directly vm.template, throwing AttributeError when not found.
There may be some value in converting it to more descriptive error, but
since that's mostly for internal users (not user facing actions) don't
bother for now.

QubesOS/qubes-issues#1842
2016-06-02 12:38:07 +02:00
Marek Marczykowski-Górecki
54c70766a4 qubes/storage: allow snapshots of snapshots
It may make sense to create 'snapshot' volume out of already 'snapshot',
not only 'origin'. In pracice it will exactly the same as 'snapshot
connected directly to 'origin'.

QubesOS/qubes-issues#866
2016-06-02 12:37:00 +02:00
Marek Marczykowski-Górecki
48176d51f1 qubes/storage: minor error message fix 2016-06-02 12:29:39 +02:00
Marek Marczykowski-Górecki
d80f34888d qubes/storage: fix getting origin pool
volume_config parameter is about target volume, not origin.

QubesOS/qubes-issues#1842
2016-06-02 12:29:30 +02:00
Bahtiar `kalkin-` Gadimov
17790c32bb
Fix DomainPool missing a continue 2016-06-01 17:28:55 +02:00
Bahtiar `kalkin-` Gadimov
35974a5dbf
DomainPool check the untrusted data from qubes-db 2016-05-25 17:39:34 +02:00
Bahtiar `kalkin-` Gadimov
ddf040ae64
Do not serialize the domain pool config 2016-05-22 22:09:55 +02:00
Bahtiar `kalkin-` Gadimov
baaac858bc
Add DomainPool
- All domain pool volumes are removable volumes
- DomainVolume uses device name as vid
2016-05-22 22:09:54 +02:00
Bahtiar `kalkin-` Gadimov
e30f894df9
Add Volume.removable field 2016-05-22 21:42:27 +02:00
Bahtiar `kalkin-` Gadimov
116ba64e51
Storage.remove() catch IO/OSError and log it 2016-05-21 01:35:32 +02:00
Bahtiar `kalkin-` Gadimov
c5810758c5
FilePool fix origin volume removale 2016-05-21 01:35:31 +02:00
Bahtiar `kalkin-` Gadimov
8959e5a77e
Implement qvm-remove
- Remove old qvm-remove
- Remove a log line from Storage, because it prints confusing lines, like:
    Removing volume kernel: /var/lib/qubes/vm-kernels/4.1.13-6/modules.img
2016-05-21 01:35:30 +02:00
Bahtiar `kalkin-` Gadimov
1d5b89f0d5 LinuxKernel keep track of own volumes
This is squashed woju/qubes-core-admin#8 by @kalkin

- LinuxKernel.volumes() lists all available kernels
- LinuxKernel use kernel version as vid
- LinuxKernel add docstrings
- Linux.kernel use os.listdir instead of os.walk
- LinuxKernel dynamically list available kernels
2016-05-04 17:21:05 +02:00
Bahtiar `kalkin-` Gadimov
7200e6153b
Rename default storage driver from xen to file
- Rename XenPool   ⇒ FilePool
- Rename XenVolume ⇒ FileVolume
2016-04-30 20:42:46 +02:00
Bahtiar `kalkin-` Gadimov
b2c1017488 Fix missing parameter in Pool.__init__() 2016-04-30 20:42:00 +02:00
Bahtiar `kalkin-` Gadimov
04a3e80311 SizeMixIn first assert than call super() 2016-04-25 07:17:21 +02:00
Bahtiar `kalkin-` Gadimov
37ca33b0d1 Add docstring to xen volumes implementations 2016-04-25 07:17:21 +02:00
Bahtiar `kalkin-` Gadimov
8f060a8746 Fix Pool and Volume __init__ 2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
591134833b Replace Volume.__str__ with enhanced __repr__ 2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
d7ff4b9057 Move volume xml config from QubesVM to Volume 2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
2e28849c90 Move pool xml config from Qubes to Pool 2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
49b4951389 Storage move rename() logic to XenPool
- Fix config renaming
2016-04-25 07:17:20 +02:00
Bahtiar `kalkin-` Gadimov
fe6a35155e Move kernel file checks to LinuxKernel pool 2016-04-25 07:17:19 +02:00
Bahtiar `kalkin-` Gadimov
62c81044c5 Add XenPool.setup/destroy 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
97d04791b7 After add/remove_pool execute Pool.setup/destroy 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
9674d03088 Add pool LinuxKernel 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
d1a0542c85 Add XenPool.remove() 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
a37fc2464a Add XenPool.config() 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
971c4ae91d Add XenPool.driver field 2016-04-25 07:17:18 +02:00
Bahtiar `kalkin-` Gadimov
5f7cb41a21 Move Storage.clone_disk_files logic to XenPool
- Add XenVolume to identify volumes which can be cloned even if they are not in
the same pool
2016-04-25 07:17:17 +02:00
Bahtiar `kalkin-` Gadimov
973c83cedd Move most resize logic to XenPool 2016-04-25 07:17:17 +02:00
Bahtiar `kalkin-` Gadimov
bdfb85ac19 Refactor Storage, Pool and XenPool
- Remove all *_dev_config methods
 - Checks if a storage image exists moved to XenPool
 - Storage.remove wraps Pool.remove()
 - Stop volumes on domain sutdown/kill
 - Warn when using deprecated methods
2016-04-25 07:17:17 +02:00
Bahtiar `kalkin-` Gadimov
88238c80f3 Add XenPool._reset_volume 2016-04-25 07:17:17 +02:00
Bahtiar `kalkin-` Gadimov
3dab5193c6 XenPool add snapshot handling 2016-04-25 07:17:16 +02:00
Bahtiar `kalkin-` Gadimov
792d94959f Add implementations of xen volumes 2016-04-25 07:17:16 +02:00
Bahtiar `kalkin-` Gadimov
f02f9e3a41 Add XenPool init_volume 2016-04-25 07:17:16 +02:00
Bahtiar `kalkin-` Gadimov
4d4b846ce8 Replace XenStorage with XenPool 2016-04-25 07:17:16 +02:00
Bahtiar `kalkin-` Gadimov
32255a7916 Reverted Storage ←→ Pool dependency
- Storage() operates on a pool and in future on multiple pools
2016-04-25 07:17:16 +02:00
Bahtiar `kalkin-` Gadimov
24193c4308 Add Volume class 2016-04-25 07:16:38 +02:00
Bahtiar `kalkin-` Gadimov
3c798bc825 Pool configuration include the pool name 2016-04-25 07:16:37 +02:00
Bahtiar `kalkin-` Gadimov
22d73e8fa9 Fix Pool dir_path normalization 2016-04-25 07:16:37 +02:00
Bahtiar `kalkin-` Gadimov
36470310a2 Replace pool config parsing logic
- Move add_pool/remove_pool to Qubes class
- Add Qubes.get_pool
- Remove storage.conf
2016-04-25 07:16:37 +02:00
Bahtiar `kalkin-` Gadimov
47e89d84b6 XenStorage.format_disk_dev returns now BlockDevice 2016-04-25 07:16:36 +02:00
Bahtiar `kalkin-` Gadimov
b1978abce5 Use entry_points for pool driver discovery
- Add qubes.storage entry point to setup.py
- Removed the old pool driver class loading logic
- Reworked pool tests
2016-04-06 10:11:19 +02:00
Marek Marczykowski-Górecki
8262f2ef4b storage: fix handling standalone VMs
Currently Standalone have template=None.
2016-03-03 01:18:17 +01:00
Marek Marczykowski-Górecki
a73c694f54 storage: access *_img directly from vm.storage object
Not through vm.something_img proxy.
2016-03-03 01:18:17 +01:00
Marek Marczykowski-Górecki
f52a0f2d41 storage: get rid of 'servicevms' subdir
Keep all the non-template VMs in 'appvms'. Having it split makes no
sense since any VM can be "converted" to NetVM by simply changing its
provides_network attribute and probably assigning some PCI device.

On the other hand, it may be useful to set this manually, for example by
management stack - based on VM function, not type. But don't care about
it for now.
2016-03-03 01:18:16 +01:00