diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-06-24 18:10:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-06-24 18:10:27 +0000 |
| commit | 243ea7e668e49a4c121a88b3d1eb075ce20f88ca (patch) | |
| tree | a0d7d00c66fa589a7764a79952220216c6ba45ca /nova/virt | |
| parent | 4a4988a0a8ea7971ea80a1d9e96f0becc6958dda (diff) | |
| parent | c6a120417e68c7423ad4898eb5e0567e0f22e0f3 (diff) | |
| download | nova-243ea7e668e49a4c121a88b3d1eb075ce20f88ca.tar.gz nova-243ea7e668e49a4c121a88b3d1eb075ce20f88ca.tar.xz nova-243ea7e668e49a4c121a88b3d1eb075ce20f88ca.zip | |
Merge "Perform additional check before live snapshotting"
Diffstat (limited to 'nova/virt')
| -rwxr-xr-x | nova/virt/libvirt/driver.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 3b70952d7..6a93d92ae 100755 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -1208,6 +1208,18 @@ class LibvirtDriver(driver.ComputeDriver): REQ_HYPERVISOR_LIVESNAPSHOT) \ and not source_format == "lvm": live_snapshot = True + # Abort is an idempotent operation, so make sure any block + # jobs which may have failed are ended. This operation also + # confims the running instance, as opposed to the system as a + # whole, has a new enough version of the hypervisor (bug 1193146). + try: + virt_dom.blockJobAbort(disk_path, 0) + except libvirt.libvirtError as ex: + error_code = ex.get_error_code() + if error_code == libvirt.VIR_ERR_CONFIG_UNSUPPORTED: + live_snapshot = False + else: + pass else: live_snapshot = False @@ -1279,13 +1291,6 @@ class LibvirtDriver(driver.ComputeDriver): # Save a copy of the domain's running XML file xml = domain.XMLDesc(0) - # Abort is an idempotent operation, so make sure any block - # jobs which may have failed are ended. - try: - domain.blockJobAbort(disk_path, 0) - except Exception: - pass - def _wait_for_block_job(domain, disk_path): status = domain.blockJobInfo(disk_path, 0) try: |
