summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorAndrew Laski <andrew.laski@rackspace.com>2013-02-14 17:02:06 -0500
committerAndrew Laski <andrew.laski@rackspace.com>2013-02-14 17:02:06 -0500
commit145759f6ed2fb7ceefa640a1a7215099746d41ba (patch)
tree27551bf700c91aba4f308036592985c28f8327e6 /nova
parentdbdd6945d72fdc1719f88c92d961f20eccd5d01d (diff)
[xenapi] Cooperatively yield during sparse copy
On a resize down the sparse copy blocks other operations from running on the compute node, and can take a long time to finish. This patch adds a greenthread yield to not block other things from happening on the compute node. Change-Id: I1287a6a0bb3157ad0e5eafe53b02db21849650fa
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/xenapi/vm_utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 97e9e87f8..3bfe6de09 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -2083,6 +2083,7 @@ def _sparse_copy(src_path, dst_path, virtual_size, block_size=4096):
break
data = src.read(min(block_size, left))
+ greenthread.sleep(0)
duration = time.time() - start_time
compression_pct = float(skipped_bytes) / bytes_read * 100