Patchwork [08/13] No need to iterate if we already are over the limit

login
register
mail settings
Submitter Juan Quintela
Date June 29, 2012, 4:43 p.m.
Message ID <d7f070832fb12b10fc89d63f32f9a66eefa93a32.1340987905.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/168238/
State New
Headers show

Comments

Juan Quintela - June 29, 2012, 4:43 p.m.
If buffers are full, don't iterate, just exit.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |    3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/savevm.c b/savevm.c
index 987c6c0..a15c163 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1626,6 +1626,9 @@  int qemu_savevm_state_iterate(QEMUFile *f)
         if (se->save_live_state == NULL)
             continue;

+        if (qemu_file_rate_limit(f)) {
+            return 0;
+        }
         trace_savevm_section_start();
         /* Section type */
         qemu_put_byte(f, QEMU_VM_SECTION_PART);