Skip to content

Commit

Permalink
Fix calling qubes.SuspendPre/qubes.SuspendPost services
Browse files Browse the repository at this point in the history
Those should be called as root, not default user.

Thanks @jpouellet for debugging this.
Fixes QubesOS/qubes-issues#3151
Fixes QubesOS/qubes-issues#3142
  • Loading branch information
marmarek committed Oct 7, 2017
1 parent 451cc33 commit bce7b64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qubes/vm/qubesvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,8 @@ def suspend(self):
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:
Expand Down Expand Up @@ -975,7 +976,8 @@ def resume(self):
# 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()

Expand Down

0 comments on commit bce7b64

Please sign in to comment.