Commit Graph

258 Commits

Author SHA1 Message Date
Marek Marczykowski-Górecki
9fa090b422
core: prevent VM renaming over already existing VM
Fixes QubesOS/qubes-issues#1723
2016-02-08 04:38:26 +01:00
Marek Marczykowski-Górecki
0b5bd060bb
Fix domain renaming when it wasn't defined in libvirt
Fixes QubesOS/qubes-issues#1632
2016-02-06 05:36:07 +01:00
Marek Marczykowski-Górecki
8ee909f08c
Caught unknown libvirt errors on getting runtime VM info
In some cases libvirt doesn't report error code at all. This probably
happens in some stage of domain startup/shutdown. Threat this the same
as domain not running.

Fixes QubesOS/qubes-issues#1537
2016-02-06 05:34:22 +01:00
Marek Marczykowski-Górecki
31a3796ed3
dispvm: do not remove innocent files when cleaning up DispVM
Fixes QubesOS/qubes-issues#1662
2016-01-20 02:51:57 +01:00
Marek Marczykowski-Górecki
530a79417f
Add some logging to ease debugging libvirt errors
Temporary add some more logging to ease debugging libvirt errors.
Unfortunatelly stack trace doesn't contain actual error.

QubesOS/qubes-issues#1537
2016-01-07 05:48:33 +01:00
Marek Marczykowski-Górecki
35cb82cd2b
storage: use root-cow.img for HVM template, to support reverting changes
We still can't support running HVM template and its VMs simultaneously
(easily), but still, have root-cow.img handled for HVM template, to
allow qvm-revert-template-changes.

Fixes QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
b26f2a73b4
core: mark QubesTemplateHVm.rootcow_img as property
Add missing '@property'.

QubesOS/qubes-issues#1573
2016-01-07 05:48:32 +01:00
Marek Marczykowski-Górecki
9809e4168e
core: log pci detach error on VM shutdown
Thanks @Rudd-O for pointing this out.
2015-12-26 14:05:21 +01:00
Marek Marczykowski-Górecki
1b5daea771
qvm-grow-root: add --allow-start option
In some (most) cases VM needs to be started to complete resize
operation. This may be unexpected, so make it clear and do not start the
VM when the user did not explicitly allow that.

Fixes QubesOS/qubes-issues#1268
2015-12-26 04:10:20 +01:00
Marek Marczykowski-Górecki
49c1ab2f99
qvm-grow-root: wait for VM to shutdown at the end
Otherwise it could lead to some race conditions, for example when the
user tries to start some application there afterwards.

QubesOS/qubes-issues#1268
2015-12-26 04:08:12 +01:00
Marek Marczykowski-Górecki
e3e8a55c92
core: forbid 'lost+found' as VM name
When /var/lib/qubes/appvms is a mount point of ext4 filesystem, there
will be already 'lost+found' directory. Avoid this conflict.

Fixes QubesOS/qubes-issues#1440
2015-12-26 03:02:23 +01:00
Marek Marczykowski-Górecki
d4a42093b1
dispvm: Start required NetVM first (if necessary)
The comment "calling VM have the same netvm" doesn't apply to:
 - DispVM started from dom0 menu
 - DispVM started from a VM with `dispvm_netvm` property modified

Fixes QubesOS/qubes-issues#1334
2015-12-23 19:24:25 +01:00
Marek Marczykowski-Górecki
d539bd2be1
core: preserve qrexec-timeout during VM clone
Fixes QubesOS/qubes-issues#1501
2015-12-23 19:07:18 +01:00
Marek Marczykowski-Górecki
027ffedec4
core: typo fix in error handling 2015-12-07 00:03:39 +01:00
Marek Marczykowski-Górecki
2658c9a6e6
core: detach PCI devices before shutting down VM
When VM is shutting down it doesn't disconnect PCI frontend (?), so when
VM is destroyed it ends up in timeouts in PCI backend shutdown (which
can't communicate with frontend at that stage). Prevent this by
detaching PCI devices while VM is still running.

Fixes QubesOS/qubes-issues#1494
Fixes QubesOS/qubes-issues#1425
2015-12-06 14:31:43 +01:00
Marek Marczykowski-Górecki
28886390b4
Merge branch 'always-stubdom-guid' 2015-11-28 05:10:54 +01:00
Marek Marczykowski-Górecki
f525a58134
core: adjust for updated stubdom support in libvirt
Fixes QubesOS/qubes-issues#1456
2015-11-27 20:00:33 +01:00
Marek Marczykowski-Górecki
cc3ab7aaa1
Merge remote-tracking branch 'qubesos/pr/11'
* qubesos/pr/11:
  libvirtError in _update_libvirt_domain is no longer silently swallowed.
2015-11-25 03:46:55 +01:00
Vít Šesták
eb97c5652f libvirtError in _update_libvirt_domain is no longer silently swallowed.
I had some issue with fstrim and the missing else had caused the code to continue and fail later with a non-descriptive error message. This commit makes the error message more descriptive and helpful.
2015-11-25 01:16:27 +01:00
Bahtiar `kalkin-` Gadimov
2ebd20049d Refactor appmenus paths to core-admin-linux 2015-11-22 12:21:40 +01:00
Bahtiar `kalkin-` Gadimov
710b95a6ac Fix app icons errors 2015-11-17 19:37:20 +01:00
Bahtiar `kalkin-` Gadimov
78891dd70f QubesVm save the name of the storage pool used 2015-11-17 19:37:19 +01:00
Marek Marczykowski-Górecki
7359e394bc
core: detach connected VMs when shutting down NetVM
This is workaround for missing libxl/libvirt functionality: QubesOS/qubes-issues#1426

Also it should improve system shutdown time, as this is the situation
where all the VMs are shutting down simultaneously.

Fixes QubesOS/qubes-issues#1425
2015-11-15 02:06:18 +01:00
Marek Marczykowski-Górecki
4316027fb1
core: Add 'wait' parameter to vm.run_service function
Sometimes it makes sense to "fire and forget" a service. For example
"qubes.InstallUpdatesGUI".

QubesOS/qubes-issues#1249
2015-11-13 05:43:40 +01:00
Marek Marczykowski-Górecki
540fe3f552
core: set vm.uses_default_kernel=False when setting vm.kernel
Forgetting this leads to misterious errors (VM started with different
kernel than it was just set), so simplify the API.

Fixes QubesOS/qubes-issues#1400
2015-11-10 17:07:57 +01:00
Marek Marczykowski-Górecki
ba54792c83
core: make modules.img optional even for PV
When using PVGrub it doesn't make sense to attach modules.img, since
modules are already in the VM. Initramfs there will already handle such
situation and will not try to mount it, when VM's root filesystem
already contains appropriate /lib/modules/`uname -r`.

On the other hand, error earlier when initramfs is missing. While also
not used by PV Grub, the file is always specified in libvirt config and
when missing libvirt will throw rather cryptic error message.

QubesOS/qubes-issues#1354
2015-11-10 17:04:50 +01:00
Marek Marczykowski-Górecki
34f7ddd41e
core: force QubesDB reconnection on VM start 2015-11-07 05:43:34 +01:00
Marek Marczykowski-Górecki
cf6c6baded
Improve resize2fs call for root.img resize
1. Do not start GUI session - to reduce startup time
2. Use user="root" instead of sudo - not all templates have sudo
installed (for example fedora-21-minimal)
3. Add missing wait=True - otherwise VM may be shutdown during the
operation.

QubesOS/qubes-issues#1268
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
cfe782f04a
Merge remote-tracking branch 'qubesos/pr/8'
* qubesos/pr/8:
  Support more VM types in qvm-grow-root

Fixes QubesOS/qubes-issues#1268
2015-11-07 05:03:54 +01:00
Marek Marczykowski-Górecki
1c0ade6166
Fix race condition in QubesVm.get_cputime/get_mem
When domain is destroyed after isActive check, but before getting
actuall info, it would fail. So handle this situation.
2015-10-27 21:35:02 +01:00
Michal Rostecki
3be8bb31fb Support more VM types in qvm-grow-root
QubesOS/qubes-issues#1268
2015-10-24 19:58:03 +02:00
Marek Marczykowski-Górecki
75168c8aef
core: improve handling QubesDB startup errors
Kill the VM when QubesDB initialization fails, in any way, not only
QubesDB daemon itself.
2015-10-13 23:49:32 +02:00
Marek Marczykowski-Górecki
5c549e1134
core: Provide more meaningful error when failed to kill old QubesDB instance
This process may be running as root in case of default NetVM. But do not
kill it forcibly (through sudo or so), because it may also be stale
pid file. After all, QubesDB should automatically terminate when its VM
is terminated, so this code is already some error handling.

Fixes QubesOS/qubes-issues#1331
2015-10-13 23:46:59 +02:00
Marek Marczykowski-Górecki
2b7bd1f1f5
Merge remote-tracking branch 'qubesos/pr/7'
* qubesos/pr/7:
  Don't send screen layout to the VM if we haven't received it from xrandr because this breaks proper initial screen layout set by gui-agent Fixes QubesOS/qubes-issues#1305 QubesOS/qubes-issues#998
2015-10-11 02:56:25 +02:00
Marek Marczykowski-Górecki
350e279f4f
Fix handling /etc/localtime hardlink
If /etc/localtime in dom0 is a hardlink to zoneinfo file (instead of
symlink) and more than one zoneinfo file is hardlinked to this inode,
appVMs will get invalid timezone, e.g. "Europe/Warsaw\x0aPoland".

Reported by @yaqu, fix provided by @yaqu
Fixes QubesOS/qubes-issues#1315
2015-10-10 17:30:40 +02:00
Marek Marczykowski-Górecki
820e5c0e69
Update stubdom memory allocation to 44MB
Since 677a79b "hvm: change default graphics to std vga ('xen')",
stubdomain uses 44MB RAM

QubesOS/qubes-issues#1136
2015-10-10 05:22:44 +02:00
HW42
912d4c1447
qubes-random-seed: feed kernel rng with randomness from dom0 2015-10-10 05:22:43 +02:00
Marek Marczykowski-Górecki
88b4a84cce
Merge remote-tracking branch 'origin/pr/7' into HEAD
* origin/pr/7:
  Properly account for Xen memory overhead to fix large VMs

QubesOS/qubes-issues#1136
2015-10-10 05:22:13 +02:00
qubesuser
540f4f7294 Properly account for Xen memory overhead to fix large VMs 2015-10-10 01:08:56 +02:00
Ivan Konov
78c3f40f89 Don't send screen layout to the VM if we haven't received it from xrandr
because this breaks proper initial screen layout set by gui-agent
Fixes QubesOS/qubes-issues#1305 QubesOS/qubes-issues#998
2015-10-09 22:56:41 +03:00
Marek Marczykowski-Górecki
958b59cc00
core: Show the right kernel version for DispVMs
Fixes QubesOS/qubes-issues#948
2015-10-03 01:50:15 +02:00
Marek Marczykowski-Górecki
4f04c62f36
Merge branch 'bug1241'
Fixes QubesOS/qubes-issues#1241
2015-10-02 01:59:17 +02:00
Marek Marczykowski-Górecki
fa3325a2b2
Merge branch 'bug1198'
Fixes QubesOS/qubes-issues#1198
2015-10-02 01:59:05 +02:00
Marek Marczykowski-Górecki
3cdae85254
core: preserve 'autostart' setting during VM rename
Systemd unit name needs to be renamed.

Fixes QubesOS/qubes-issues#1256
2015-10-02 01:57:00 +02:00
Marek Marczykowski-Górecki
b9e6b0a076
core/hvm: fix error message when creating HVM while not supported by the hardware
libvirt reports such errors at domain definition, not startup (as was in
libxl).

QubesOS/qubes-issues#1198
2015-09-25 22:21:10 +02:00
Marek Marczykowski-Górecki
dd1bea98e1
core/start: ensure that the previous QubesDB daemon isn't running
When restarting VM (starting it just after it was shut down), it may
happen that previous `qubesdb-daemon` instance is still running - if VM
doesn't properly terminate the connection, dom0 part will not terminate
immediately, but at next alive check (every 10s). Such `qubesdb-daemon`,
when terminating, will remove pid file and socket file. In case of new
daemon already running it would be those of the new daemon, making the
whole QubesDB of this VM inaccessible for dom0 (`qubesdb-daemon` is
running, but its socket is removed).

To prevent this race, ensure that previous instance is terminated before
starting the new one.
There is no need to manually removing socket file, because if some stale
socket exists, it will be replaced by the new one when new
`qubesdb-daemon` starts up.

QubesOS/qubes-issues#1241
2015-09-25 22:06:14 +02:00
Marek Marczykowski-Górecki
76bddaa280 core: use vm.absolute_path to parse paths in qubes.xml
This makes easier to handle some corner cases. One of them is having
entry without `dir_path` defined. This may happen when migrating from R2
(using backup+restore or in-place) while some DisposableVM was running
(even if not included in the backup itself).

Fixes qubesos/qubes-issues#1124
Reported by @doncohen, thanks @wyory for providing more details.
2015-09-04 01:58:53 +02:00
Marek Marczykowski-Górecki
226a144285 core: fix vm-persistence info for DispVM
(reported by @adrelanos)
qubesos/qubes-issues#1101
2015-09-03 21:11:43 +02:00
Marek Marczykowski-Górecki
3beb307901 core: add VM persistence info to qubesdb (#1101)
Fixes qubesos/qubes-issues#1101
2015-09-02 00:15:14 +02:00
Marek Marczykowski-Górecki
1ed4a2cbb2
core: fix getting libvirt error code 2015-08-08 21:29:56 +02:00