Fix calling qubes.SuspendPre/qubes.SuspendPost services

Those should be called as root, not default user.

Thanks @jpouellet for debugging this.
Fixes QubesOS/qubes-issues#3151
Fixes QubesOS/qubes-issues#3142
This commit is contained in:
Marek Marczykowski-Górecki 2017-10-07 02:36:02 +02:00
parent 451cc339c7
commit bce7b64d4a
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -945,7 +945,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
raise qubes.exc.QubesVMNotRunningError(self)
if list(self.devices['pci'].attached()):
yield from self.run_service_for_stdio('qubes.SuspendPre')
yield from self.run_service_for_stdio('qubes.SuspendPre',
user='root')
self.libvirt_domain.pMSuspendForDuration(
libvirt.VIR_NODE_SUSPEND_TARGET_MEM, 0, 0)
else:
@ -975,7 +976,8 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
# pylint: disable=not-an-iterable
if self.get_power_state() == "Suspended":
self.libvirt_domain.pMWakeup()
yield from self.run_service_for_stdio('qubes.SuspendPost')
yield from self.run_service_for_stdio('qubes.SuspendPost',
user='root')
else:
yield from self.unpause()