core-admin/qubes
Marek Marczykowski-Górecki 018877a19c
vm: avoid starting the same VM multiple times simultaneously
While libvirt handle locking itself, there is also Qubes-specific
startup part. Especially starting qrexec-daemon and waiting until
qrexec-agent connect to it. When someone will attempt to start VM the
second time (or simply assume it's already running) - qrexec will not be
connected yet and the operation will fail. Solve the problem by wrapping
the whole vm.start() function with a lock, including a check if VM is
running and waiting for qrexec.

Also, do not throw exception if VM is already running.

This way, after a call to vm.start(), VM will be started with qrexec
connected - regardless of who really started it.
Note that, it will not solve the situation when someone check if VM is
running manually, like:

    if not vm.is_running():
        yield from vm.start()

Such code should be changed to simply:

    yield from vm.start()

Fixes QubesOS/qubes-issues#2001
Fixes QubesOS/qubes-issues#2666
2017-06-05 23:38:30 +02:00
..
api api/internal: make GetSystemInfo not crash on not set default DispVM 2017-06-05 23:33:58 +02:00
ext ext: BlockDevices extension 2017-06-05 23:33:58 +02:00
qmemman qmemman: update for py3k 2017-02-27 02:37:49 +01:00
storage storage: remove DomainPool 2017-06-05 23:33:58 +02:00
tests ext: BlockDevices extension 2017-06-05 23:33:58 +02:00
tools Move qvm-template-postprocess tool to core-admin-client 2017-05-26 15:08:17 +02:00
vm vm: avoid starting the same VM multiple times simultaneously 2017-06-05 23:38:30 +02:00
__init__.py property: add property.__str__ 2017-05-19 18:49:21 +02:00
app.py qubes/app: don't fail on saving qubes.xml when 'qubes' group isn't there 2017-05-12 18:11:27 +02:00
backup.py backup: add a little more usage info, include docs in main index 2017-04-21 19:58:32 +02:00
config.py Remove unused helper scripts 2017-05-12 18:43:35 +02:00
core2migration.py Make pylint ♥ 2017-04-15 23:50:11 +02:00
devices.py devices : make DeviceInfo sortable 2017-06-05 23:33:58 +02:00
dochelpers.py Add documentation for mgmt 2017-03-13 21:51:52 +01:00
events.py events: add support for per-instance handlers 2017-05-12 14:25:32 +02:00
exc.py admin: raise QubesNoSuchPropertyError for non-existing properties 2017-05-23 04:32:59 +02:00
firewall.py firewall: add clone and comparing methods, missing docstrings 2017-05-16 09:05:00 +02:00
log.py qubes: port core to python3 2017-01-20 16:42:51 +01:00
rngdoc.py Make pylint happy 2017-04-21 16:57:35 +02:00
tarwriter.py Make pylint happy 2017-04-21 16:57:35 +02:00
utils.py Make pylint happy 2017-04-21 16:57:35 +02:00