diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-05-31 16:40:38 -0400 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-05-31 16:40:38 -0400 |
| commit | eb32a136c9c05fe1191a1da03c84f293c2de8c0b (patch) | |
| tree | 10f27c5f09213a34bcc6a8cf24c47750fcbab724 /nova | |
| parent | b8bcc715fccbd1e3ae82f508e7d4334414818d35 (diff) | |
| parent | 3812bb4c7e6fcee4c87c1225d9c725db08527018 (diff) | |
Merged trunk.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/libvirt/connection.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py index b156fb0bc..f563d0681 100644 --- a/nova/virt/libvirt/connection.py +++ b/nova/virt/libvirt/connection.py @@ -488,19 +488,27 @@ class LibvirtConnection(driver.ComputeDriver): @exception.wrap_exception def pause(self, instance, callback): - raise exception.ApiError("pause not supported for libvirt.") + """Pause VM instance""" + dom = self._lookup_by_name(instance.name) + dom.suspend() @exception.wrap_exception def unpause(self, instance, callback): - raise exception.ApiError("unpause not supported for libvirt.") + """Unpause paused VM instance""" + dom = self._lookup_by_name(instance.name) + dom.resume() @exception.wrap_exception def suspend(self, instance, callback): - raise exception.ApiError("suspend not supported for libvirt") + """Suspend the specified instance""" + dom = self._lookup_by_name(instance.name) + dom.managedSave(0) @exception.wrap_exception def resume(self, instance, callback): - raise exception.ApiError("resume not supported for libvirt") + """resume the specified instance""" + dom = self._lookup_by_name(instance.name) + dom.create() @exception.wrap_exception def rescue(self, instance): |
