core: call ACPI S3 emulation only for VMs with PCI devices
Actually it looks to be needed only there. But also another problem: this suspend doesn't work for firewallvm, for unknown reason.
This commit is contained in:
parent
149971ae2e
commit
dfe0b18382
@ -1542,17 +1542,20 @@ class QubesVm(object):
|
||||
if not self.is_running() and not self.is_paused():
|
||||
raise QubesException ("VM already stopped!")
|
||||
|
||||
xs_path = '/local/domain/%d/control/shutdown' % self.get_xid()
|
||||
xs.write('', xs_path, 'suspend')
|
||||
tries = 0
|
||||
while self.get_power_state() != "Suspended":
|
||||
tries += 1
|
||||
if tries > 15:
|
||||
# fallback to pause
|
||||
print >>sys.stderr, "Failed to suspend domain %s, falling back to pause method" % self.name
|
||||
self.pause()
|
||||
break
|
||||
time.sleep(0.2)
|
||||
if len (self.pcidevs) > 0:
|
||||
xs_path = '/local/domain/%d/control/shutdown' % self.get_xid()
|
||||
xs.write('', xs_path, 'suspend')
|
||||
tries = 0
|
||||
while self.get_power_state() != "Suspended":
|
||||
tries += 1
|
||||
if tries > 15:
|
||||
# fallback to pause
|
||||
print >>sys.stderr, "Failed to suspend domain %s, falling back to pause method" % self.name
|
||||
self.pause()
|
||||
break
|
||||
time.sleep(0.2)
|
||||
else:
|
||||
self.pause()
|
||||
|
||||
def resume(self):
|
||||
if dry_run:
|
||||
|
Loading…
Reference in New Issue
Block a user