From 5187e080ea528230a5124e657bc34b263252cdad Mon Sep 17 00:00:00 2001 From: Juan Quintela <quintela@redhat.com> Date: Mon, 22 Nov 2010 15:57:05 -0200 Subject: [PATCH 1/6] No need to iterate if we already are over the limit RH-Author: Juan Quintela <quintela@redhat.com> Message-id: <84e75eb7c660463587373716a6ede9f890c141d4.1290441250.git.quintela@redhat.com> Patchwork-id: 13775 O-Subject: [PATCH 1/6] No need to iterate if we already are over the limit Bugzilla: 513765 589017 RH-Acked-by: Glauber Costa <glommer@redhat.com> RH-Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com> RH-Acked-by: Alex Williamson <alex.williamson@redhat.com> If buffers are full, don't iterate Signed-off-by: Juan Quintela <quintela@redhat.com> --- qemu/savevm.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- qemu/savevm.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/qemu/savevm.c b/qemu/savevm.c index f0ea82b..309dc86 100644 --- a/qemu/savevm.c +++ b/qemu/savevm.c @@ -761,6 +761,9 @@ int qemu_savevm_state_iterate(QEMUFile *f) if (se->save_live_state == NULL) continue; + if (qemu_file_rate_limit(f)) + return 0; + /* Section type */ qemu_put_byte(f, QEMU_VM_SECTION_PART); qemu_put_be32(f, se->section_id); -- 1.7.3.2