From 145759f6ed2fb7ceefa640a1a7215099746d41ba Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Thu, 14 Feb 2013 17:02:06 -0500 Subject: [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 --- nova/virt/xenapi/vm_utils.py | 1 + 1 file changed, 1 insertion(+) 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 -- cgit