Marek Marczykowski-Górecki
fba6eac07f
qubes/tests: do not undefine libvirt domain twice
...
Do not access vm.libvirt_domain after it being already removed - this
will redefine it again in libvirt, just to undefine it in a moment.
On the other hand, few lines below there is fallback libvirt cleanup, in
case of proper one not working.
2016-08-09 05:14:09 +02:00
Marek Marczykowski-Górecki
6d45b97357
tests: workaround 'int' name being shadowed by module name
...
qubes.tests.int shadows 'int' type in qubes.tests module.
QubesOS/qubes-issues#2241
2016-08-09 05:14:09 +02:00
Marek Marczykowski-Górecki
3f6c96ee39
qubes/vm: fix handling autostart set/reset
...
1. Service symlink must have ".service" extension
2. Disable service on property reset to default
2016-08-09 05:14:09 +02:00
Marek Marczykowski-Górecki
5b4e30524a
qubes/vm: remove duplicated check for duplicate name on rename
2016-08-09 03:02:04 +02:00
Marek Marczykowski-Górecki
73d61bb378
qubes/events: fix event handlers ordering
...
Since "qubes: fix event framework", handlers from extensions looks the
same as from the VM class itself, so it isn't possible to order them
correctly. Specification says:
For each class first are called bound handlers (specified in class
definition), then handlers from extensions. Aside from above,
remaining order is undefined.
So, restore this property, which is later correctly used to order
handlers.
2016-08-09 02:58:14 +02:00
Marek Marczykowski-Górecki
5177f5e12b
qubes/core2migration: fix vm.template handling
...
VM constructor can't be given just template QID, it must be TemplateVM
object.
2016-08-09 02:57:23 +02:00
Marek Marczykowski-Górecki
067cfb7cd6
Send approximate physical screen dimensions to the VM
...
When properly set, applications will have a chance to automatically
detect HiDPI and act accordingly. This is the case for Fedora 23
template and GNOME apps (maybe even all built on top of GTK).
But for privacy reasons, don't provide real values, only some
approximate one. Give enough information to distinguish DPI above 150,
200 and 300. This is some compromise between privacy and HiDPI support.
QubesOS/qubes-issues#1951
This commit is migrated from gui-daemon repository
(dec462795d14a336bf27cc46948bbd592c307401).
2016-08-08 04:03:00 +02:00
Marek Marczykowski-Górecki
6bd127beb3
qubes/core2migration: fix handling templates
2016-08-08 04:00:37 +02:00
Marek Marczykowski-Górecki
5ab860a18c
qubes: don't fail VM removal if already undefined in libvirt
...
This may happen when it was manually undefined for some reason. Or
during tests cleanup (tearDown).
2016-08-08 00:15:46 +02:00
Marek Marczykowski-Górecki
53562799cd
Fix typo in libvirt auto reconnection
2016-08-08 00:13:26 +02:00
Marek Marczykowski-Górecki
4e022382a5
Merge remote-tracking branch 'origin/master' into core3-devel
2016-08-08 00:11:46 +02:00
Marek Marczykowski-Górecki
1604aee8d4
Merge remote-tracking branch 'qubesos/pr/42' into core3-devel
...
* qubesos/pr/42:
Make pylint happy ♥
2016-08-04 17:46:16 +02:00
Bahtiar `kalkin-` Gadimov
4477ea9678
Make pylint happy ♥
2016-08-04 17:38:39 +02:00
Wojtek Porczyk
288ff85731
Merge remote-tracking branch 'origin/pull/48/head' into core3-devel
2016-08-03 18:25:02 +02:00
Bahtiar `kalkin-` Gadimov
ea34c0ed56
Fix volume_exists in qubes_lvm
2016-08-03 02:57:46 +02:00
Bahtiar `kalkin-` Gadimov
02c8fc999c
ThinPool.import() skips not saveable volumes
2016-08-03 02:57:46 +02:00
Bahtiar `kalkin-` Gadimov
9190fdeb79
Fix lvm pylint disable=import-error
2016-08-03 02:57:45 +02:00
Bahtiar `kalkin-` Gadimov
064629b63a
Fix qubes.lvm _reset
2016-08-03 02:57:44 +02:00
Bahtiar `kalkin-` Gadimov
9d30bb132a
Fix umask
2016-08-03 02:57:44 +02:00
Bahtiar `kalkin-` Gadimov
824c359319
Fix ThinPool revision handling
2016-08-03 02:57:43 +02:00
Bahtiar `kalkin-` Gadimov
f3072e7dd0
qubes-create adds default lvm pool if it exists
2016-08-03 02:57:42 +02:00
Bahtiar `kalkin-` Gadimov
3ae6530cd8
Add lvm thin pool storage implementation
2016-08-03 02:57:42 +02:00
Bahtiar `kalkin-` Gadimov
7d11a7afbd
Add lvm tests
2016-08-03 02:57:41 +02:00
Bahtiar `kalkin-` Gadimov
f90d86fe13
Add qubes.utils.random_string()
2016-08-03 02:57:40 +02:00
Bahtiar `kalkin-` Gadimov
c559ffdeab
VMCollection reword vm already exists exception
2016-08-03 02:57:39 +02:00
Bahtiar `kalkin-` Gadimov
0dd1875fb6
Add vm.shutdown(wait)
2016-08-01 15:09:28 +02:00
Bahtiar `kalkin-` Gadimov
8972254e22
Add qvm-check
2016-07-21 23:40:24 +02:00
Wojtek Porczyk
ecb626d64b
qubes/vm/qubesvm: Simplify error message
2016-07-21 19:40:45 +02:00
Wojtek Porczyk
f915115cfb
Merge remote-tracking branch 'woju/pull/25/head' into core3-devel
2016-07-21 19:38:58 +02:00
Wojtek Porczyk
c5f44f9b07
Merge remote-tracking branch 'woju/pull/24/head' into core3-devel
2016-07-21 19:36:55 +02:00
Wojtek Porczyk
8e08dae447
Merge remote-tracking branch 'origin/pull/43/head' into core3-devel
2016-07-21 19:33:21 +02:00
Wojtek Porczyk
36e5bcd766
Merge remote-tracking branch 'origin/pull/39/head' into core3-devel
2016-07-21 16:43:25 +02:00
Bahtiar `kalkin-` Gadimov
d3f8fc96e4
Fix pci device attachment to QubesVM
2016-07-21 12:22:53 +02:00
Bahtiar `kalkin-` Gadimov
c18537439f
Make pylint really happy ♥♥♥
2016-07-21 12:21:56 +02:00
Bahtiar `kalkin-` Gadimov
c5307f3f47
qvm-ls hide stacktrace if qubes.xml is missing
2016-07-21 12:20:09 +02:00
Bahtiar `kalkin-` Gadimov
190f045c07
Fix qvm-prefs
2016-07-21 12:10:00 +02:00
Bahtiar `kalkin-` Gadimov
778cda0daa
qvm-pool show pools without volumes
...
- Only empty `DomainPools` are skipped
2016-07-14 17:26:28 +02:00
Bahtiar `kalkin-` Gadimov
71161bfb93
Add mock libvirt objects
2016-07-13 23:28:02 +02:00
Bahtiar `kalkin-` Gadimov
d380fb4aba
qubes.tests.app make pylint happy ♥
2016-07-13 23:08:59 +02:00
Bahtiar `kalkin-` Gadimov
23e52775b6
qubes.tests.init make pylint happy ♥
2016-07-13 23:08:58 +02:00
Bahtiar `kalkin-` Gadimov
d8a90a77c2
Make pylint really happy ♥♥♥
2016-07-13 22:35:58 +02:00
Bahtiar `kalkin-` Gadimov
bcf1cfcb1f
Add qvm-clone(1)
2016-07-13 22:35:58 +02:00
Bahtiar `kalkin-` Gadimov
1467f1ede5
Storage add clone support
2016-07-13 22:35:57 +02:00
Bahtiar `kalkin-` Gadimov
496434d865
qvm-create uses new api
...
- `-p` is now used for `--pool` instead of `--property`
- Documented pool usage
2016-07-13 22:34:37 +02:00
Bahtiar `kalkin-` Gadimov
61feb0ced7
Migrate backup to new storage api
2016-07-13 22:34:37 +02:00
Bahtiar `kalkin-` Gadimov
bb8b58b04c
qubes.backup fix verify_files
2016-07-13 22:34:36 +02:00
Bahtiar `kalkin-` Gadimov
53ff88cd15
qvm-block add revert command
2016-07-13 22:34:36 +02:00
Bahtiar `kalkin-` Gadimov
9acd46bddb
qvm-block show if old revisions are available
2016-07-13 22:34:35 +02:00
Bahtiar `kalkin-` Gadimov
e07c4cc8e8
qvm-block use new storage API
2016-07-13 22:34:35 +02:00
Bahtiar `kalkin-` Gadimov
95fed1eb71
qubes.linux.kernel use new storage api
2016-07-13 22:34:34 +02:00
Bahtiar `kalkin-` Gadimov
f60ccb235d
qubes.storage.domain use new storage API
2016-07-13 22:34:34 +02:00
Bahtiar `kalkin-` Gadimov
d1c606b952
qubes.storage.file use new storage API
2016-07-13 22:34:33 +02:00
Bahtiar `kalkin-` Gadimov
1f735669bc
Migrate qubes.vm modules to new API
2016-07-13 22:34:33 +02:00
Bahtiar `kalkin-` Gadimov
ca9797bb6b
qubes.tests.int.basic use new storage API
2016-07-13 22:34:32 +02:00
Bahtiar `kalkin-` Gadimov
1cbabc79ff
qubes.vm.QubesVM use new storage api
2016-07-13 22:34:32 +02:00
Bahtiar `kalkin-` Gadimov
7e1563c88d
Add handling for old volume config
2016-07-13 22:34:31 +02:00
Bahtiar `kalkin-` Gadimov
1bccb146d8
Add qubes.storage.isodate() helper function
2016-07-13 22:34:31 +02:00
Bahtiar `kalkin-` Gadimov
7841e3f6c0
qubes.storage rework api
2016-07-13 22:34:30 +02:00
Bahtiar `kalkin-` Gadimov
3952cef556
QubesVM serialize bool values from XML
2016-07-13 22:21:32 +02:00
Bahtiar `kalkin-` Gadimov
4cc7b8d2a8
Fix qubes.tests.storage
2016-07-13 22:21:31 +02:00
Bahtiar `kalkin-` Gadimov
bba9b38e8e
Avoid libvirt access in qubes.vm.qubesvm.QubesVM
2016-07-13 22:21:30 +02:00
Bahtiar `kalkin-` Gadimov
774cbd499e
Add TestVM.is_halted() to fix failing tests
2016-07-13 21:57:12 +02:00
Bahtiar `kalkin-` Gadimov
6fad722554
Make pylint really happy ♥♥♥
2016-07-13 21:13:29 +02:00
Bahtiar `kalkin-` Gadimov
3b93fd612e
Make pylint really happy ♥♥♥
2016-07-13 20:58:45 +02:00
Bahtiar `kalkin-` Gadimov
de5487bf14
Dumb down qvm-remove
...
- Move `vm.is_halted()` check in to VMCollection.__delitem__()
- `vm.remove_from_disk()` will raise exception if is called on a running vm
2016-07-13 18:24:29 +02:00
Bahtiar `kalkin-` Gadimov
5115eef413
qvm-shutdown make pylint happy ♥
2016-07-13 18:09:32 +02:00
Bahtiar `kalkin-` Gadimov
63a1edc274
Fix qvm-remove undefines domain in libvirt
...
- Return error if domain is not halted
- Undefine the domain in libvirt, to avoid: "Domain already exists with uuid…"
2016-07-05 13:39:47 +02:00
Bahtiar `kalkin-` Gadimov
a66df9c82e
Fix bugs in qvm-shutdown --all
...
- Exit the program if all domains are halted
- Changed log.notice to log.info
- Replace map with dictionary comprehensions (pylint)
2016-07-05 13:32:59 +02:00
Wojtek Porczyk
c899d1f960
qubes/tests: Show errors while loading external tests
...
Now failure to load external tests shows in which entry point the error
happened and a useful traceback. The traceback extends from the "try"
statement down to the actual error line, but it does not include the
frames above, ie. from the invocation to the load_tests routine. This is
a limitation of Python itself and usually not a problem.
2016-07-04 16:51:35 +02:00
Wojtek Porczyk
1ff1ca37a1
Merge remote-tracking branch 'woju/pull/21/head' into core3-devel
...
Conflicts:
qubes/storage/__init__.py
2016-07-02 11:54:56 +02:00
Wojtek Porczyk
d28ab908cc
Network and storage fixes
2016-06-29 16:42:35 +02:00
Wojtek Porczyk
b53c572f1d
Merge remote-tracking branch 'woju/pull/23/head' into core3-devel
2016-06-28 15:19:57 +02:00
Wojtek Porczyk
c9accc258c
Merge remote-tracking branch 'woju/pull/15/head' into core3-devel
...
Conflicts:
qubes/storage/__init__.py
qubes/storage/file.py
qubes/vm/qubesvm.py
2016-06-28 15:15:00 +02:00
Bahtiar `kalkin-` Gadimov
e26932a81a
Fix bug in FilesPool.target_dir()
2016-06-23 14:23:34 +02:00
Bahtiar `kalkin-` Gadimov
7081bd433a
Make pylint happy
2016-06-23 14:23:34 +02:00
Bahtiar `kalkin-` Gadimov
0ab27d7426
qubes.vm.__init__ Remove unneeded time import
2016-06-23 14:23:33 +02:00
Bahtiar `kalkin-` Gadimov
b584d1a4bb
Remove QubesVM.is_netvm() and is_disposablevm()
2016-06-23 14:23:33 +02:00
Bahtiar `kalkin-` Gadimov
4a0b7585d1
Remove QubesVM.is_proxyvm()
2016-06-23 14:23:32 +02:00
Bahtiar `kalkin-` Gadimov
b0a7d0c283
Remove QubesVM.is_appvm()
2016-06-23 14:23:32 +02:00
Bahtiar `kalkin-` Gadimov
e08ca1ff57
Remove QubesVM.is_template()
2016-06-23 14:23:31 +02:00
Bahtiar `kalkin-` Gadimov
ba3b191702
QubesVM add docstrings & fix pylint errors
2016-06-23 14:23:31 +02:00
Bahtiar `kalkin-` Gadimov
a2668d81e3
QubesVM remove resize functions
2016-06-23 14:23:30 +02:00
Bahtiar `kalkin-` Gadimov
9132690eef
Add QubesVM.is_halted()
2016-06-23 14:23:24 +02:00
Bahtiar `kalkin-` Gadimov
4db84c42a6
Fix qubes.storage.file _remove_if_exists
2016-06-23 13:17:00 +02:00
Bahtiar `kalkin-` Gadimov
12745a4860
Qubes.add_pool() returns the added pool
2016-06-23 13:17:00 +02:00
Bahtiar `kalkin-` Gadimov
8fc3772017
Add Volume.__str__()
2016-06-23 13:16:59 +02:00
Bahtiar `kalkin-` Gadimov
3dd77719c1
Pool.create source_volume argument is optional
2016-06-23 13:16:59 +02:00
Bahtiar `kalkin-` Gadimov
b260c2cdd9
Fix pylint warnings
2016-06-23 13:16:10 +02:00
Bahtiar `kalkin-` Gadimov
bb2e6a2ad3
Add QubesVM.attached_volumes()
2016-06-23 13:16:09 +02:00
Bahtiar `kalkin-` Gadimov
b9ddc00741
Add qvm-block
2016-06-23 13:16:08 +02:00
Bahtiar `kalkin-` Gadimov
c487b5fe9b
Fix PoolsAction
2016-06-23 13:16:07 +02:00
Bahtiar `kalkin-` Gadimov
90c882610e
Storage attach volumes from other pools
...
- Already attached volumes are ignored
2016-06-23 13:16:07 +02:00
Bahtiar `kalkin-` Gadimov
c4a506206c
Fix VmNameGroup formatting
2016-06-23 13:16:06 +02:00
Bahtiar `kalkin-` Gadimov
2f0df26606
Add subparser handling to parse_qubes_app
2016-06-23 13:16:06 +02:00
Bahtiar `kalkin-` Gadimov
4f0b17cb52
Add qubes.tools.RunningVmNameAction
2016-06-23 13:16:05 +02:00
Bahtiar `kalkin-` Gadimov
b5eb377490
Add VolumeAction for parsing POOL_NAME:VOLUME_ID
2016-06-23 13:16:05 +02:00
Bahtiar `kalkin-` Gadimov
0ac40ddd4f
Volume.__repr__ returns POOL_NAME:VOLUME_ID
2016-06-23 13:16:04 +02:00
Bahtiar `kalkin-` Gadimov
09727b1cbd
Add Volume.internal field
...
- Linux kernel volumes are always internal volumes
2016-06-23 13:16:03 +02:00
Bahtiar `kalkin-` Gadimov
07800a0e67
Add Volume.eq, neq and hash
2016-06-23 13:16:03 +02:00
Bahtiar `kalkin-` Gadimov
f08ce2cb79
A Pool should always have a volumes property
...
NOTE: FilesPool need some way to dynamically discover volumes
2016-06-23 13:15:54 +02:00
Bahtiar `kalkin-` Gadimov
88198fb7ac
Storage verification is part of the pool interface
...
- LinuxKernel pool add verify method
- FilePool implent verification
2016-06-23 13:11:59 +02:00
Bahtiar `kalkin-` Gadimov
87ae5a3b65
Fix qvm-start
2016-06-21 17:44:35 +02:00
Bahtiar `kalkin-` Gadimov
d56f02598a
Replace QubesVM.verify_files() with Storage.verify_files()
2016-06-21 14:58:12 +02:00
Bahtiar `kalkin-` Gadimov
296fa17322
QubesVM remove obsolete *_img methods
2016-06-21 14:58:12 +02:00
Bahtiar `kalkin-` Gadimov
e7732f8ad0
Storage.verify fires domain-verify-files event
2016-06-21 14:58:11 +02:00
Bahtiar `kalkin-` Gadimov
457c915d03
qvm-create fix access to volume paths
2016-06-21 14:58:11 +02:00
Bahtiar `kalkin-` Gadimov
732d2b33f4
Add LinuxKernel.is_outdated()
2016-06-21 14:58:10 +02:00
Bahtiar `kalkin-` Gadimov
3b441ebaad
Add Storage.outdated_volumes and Pool.is_outdated
2016-06-21 14:58:10 +02:00
Bahtiar `kalkin-` Gadimov
0a471e719b
qubes.backup fix access to volume paths
2016-06-21 14:58:09 +02:00
Bahtiar `kalkin-` Gadimov
db608f6e01
Pool add str, eq & neq
2016-06-21 12:53:31 +02:00
Bahtiar `kalkin-` Gadimov
803efa76ff
Merge FilePool._resize_loop_device() with resize()
2016-06-21 12:48:57 +02:00
Bahtiar `kalkin-` Gadimov
72df863bb9
Fix qubes.storage.file pylint warnings
2016-06-21 12:47:47 +02:00
Bahtiar `kalkin-` Gadimov
20282c17fe
Volume add docstrings
2016-06-21 12:44:21 +02:00
Bahtiar `kalkin-` Gadimov
b830cb5544
Volume add eq, neq & hash methods
2016-06-21 12:39:47 +02:00
Wojtek Porczyk
66f46d8a25
Fix test error after bdfb85ac
(refactor storage)
2016-06-21 10:10:45 +02:00
Wojtek Porczyk
d6ad8d34a6
Merge remote-tracking branch 'marmarek/patch-1' into core3-devel
2016-06-16 21:46:53 +02:00
Marek Marczykowski-Górecki
dcdb62721b
tests: mark TC_01_FileVolumes.test_003_read_volume with expected failure
2016-06-16 21:23:18 +02:00
Marek Marczykowski-Górecki
4e797663e9
tests: make storage tests working outside of dom0
2016-06-16 21:14:35 +02:00
Marek Marczykowski-Górecki
2ff6aa456e
Provide fake CPUs count and total memory in offline mode
2016-06-16 21:08:44 +02:00
Marek Marczykowski-Górecki
5eea473725
core2migration: add a skeleton for dispvm_netvm migration
...
QubesOS/qubes-issues#2075
2016-06-16 17:25:45 +02:00
Bahtiar `kalkin-` Gadimov
29633f43f8
qubes.vm.templatevm Add LICENSE & docstring
2016-06-16 17:11:49 +02:00
Marek Marczykowski-Górecki
9cdf994360
Minor fixes
2016-06-16 17:06:42 +02:00
Marek Marczykowski-Górecki
98effef606
backup: add option to use default kernel for restored VMs
2016-06-16 17:06:42 +02:00
Marek Marczykowski-Górecki
91404cc647
backup: collect files to backup once
2016-06-16 17:06:41 +02:00
Marek Marczykowski-Górecki
2dacb3a542
backup: drop/resolve minor "TODO" comments
2016-06-16 17:06:41 +02:00
Bahtiar `kalkin-` Gadimov
91ee455a37
NetVMMixin add docstrings & fix pylint errors
2016-06-16 17:06:19 +02:00
Marek Marczykowski-Górecki
c9a55cc198
tests: use offline mode
...
QubesOS/qubes-issues#2008
2016-06-16 17:04:16 +02:00
Bahtiar `kalkin-` Gadimov
b77c36b224
Remove NetVMMixin.vif()
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
7ccba17a38
qubes.vm.__init__ Replace TODOs with SEE: #1815
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
ec9550c7cc
qubes.vm.__init__ Remove debug xml file creation
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
94d9fd040f
qubes.vm.__init__ Add docstrings
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
77d54b55ad
qubes.vm.__init__ Fix pylint warnings
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
f318871279
qubes.vm.__init__ Remove uses_custom_config bits
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
b5fe49f422
qubes.vm.__init__ Remove unneeded imports
2016-06-16 17:01:34 +02:00
Bahtiar `kalkin-` Gadimov
93e68a6796
qubes.vm.dispvm Fix XXX, add docstring & LICENSE
2016-06-16 17:01:33 +02:00
Bahtiar `kalkin-` Gadimov
d25c44ca71
qubes.vm.appvm Fix XXX, add docstrings & LICENSE
2016-06-16 17:01:33 +02:00
Bahtiar `kalkin-` Gadimov
0cd667a1f5
qubes.vm.adminvm fix XXX and add docstrings
2016-06-16 17:01:33 +02:00
Bahtiar `kalkin-` Gadimov
e5906df0c7
AdminVM remove get_private_img_sz
2016-06-16 16:59:27 +02:00
Bahtiar `kalkin-` Gadimov
9f3385296b
qubes.storage.file fix pylint warnings
2016-06-16 16:59:27 +02:00
Bahtiar `kalkin-` Gadimov
38dc74587d
Rewrote file rename_target_dir
2016-06-16 16:59:27 +02:00
Bahtiar `kalkin-` Gadimov
a4577c0dce
Rename Storage.create_on_disk to Storage.create
2016-06-16 16:59:27 +02:00
Bahtiar `kalkin-` Gadimov
930fe417a8
Remove storage size and usage methods from QubesVM
2016-06-16 16:59:26 +02:00
Wojtek Porczyk
e47043ebd7
More pylint fixes
2016-06-16 13:29:16 +02:00
Wojtek Porczyk
3cb5f031a9
Fix storage initialisation
2016-06-16 13:29:15 +02:00
Wojtek Porczyk
1f302fb776
Fix "pylint fixes" wrt dir_path
2016-06-16 13:29:15 +02:00
Wojtek Porczyk
677a3e51f4
Move libvirt XML network device to jinja
2016-06-16 13:29:15 +02:00
Wojtek Porczyk
ba20254888
Rewrite PCI attaching/detaching from xl to libvirt
...
The only remaining part is querying vm-side BDF. That can't be done
in libvirt.
2016-06-16 13:29:15 +02:00
Wojtek Porczyk
63b6674fbd
fix qvm-ls display of cpu_time
...
QubesOS/qubes-core-admin#27
2016-06-13 19:10:01 +02:00
Wojtek Porczyk
6a10daf7be
Merge branch 'master' into core3-devel
...
Remains to be fixed:
88cb62fc
d2640b51
958c2926
2016-06-13 19:03:46 +02:00
Wojtek Porczyk
6ade5736d7
pylint fixes
2016-06-10 21:27:29 +02:00