Patchwork [04/10] No need to iterate if we already are over the limit

login
register
mail settings
Submitter Juan Quintela
Date Nov. 23, 2010, 11:03 p.m.
Message ID <2841a117c0a578d708a3e581db2c04ceb62accfa.1290552026.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/72768/
State New
Headers show

Comments

Juan Quintela - Nov. 23, 2010, 11:03 p.m.
From: Juan Quintela <quintela@trasno.org>

If buffers are full, don't iterate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@trasno.org>
---
 savevm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Anthony Liguori - Nov. 30, 2010, 2 a.m.
On 11/23/2010 05:03 PM, Juan Quintela wrote:
> From: Juan Quintela<quintela@trasno.org>
>
> If buffers are full, don't iterate
>
> Signed-off-by: Juan Quintela<quintela@redhat.com>
> Signed-off-by: Juan Quintela<quintela@trasno.org>
>    

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>   savevm.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index ceed6de..7c289af 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1498,6 +1498,9 @@ int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f)
>           if (se->save_live_state == NULL)
>               continue;
>
> +        if (qemu_file_rate_limit(f))
> +            return 0;
> +
>           START_SAVEVM_CLOCK();
>
>           /* Section type */
>

Patch

diff --git a/savevm.c b/savevm.c
index ceed6de..7c289af 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1498,6 +1498,9 @@  int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f)
         if (se->save_live_state == NULL)
             continue;

+        if (qemu_file_rate_limit(f))
+            return 0;
+
         START_SAVEVM_CLOCK();

         /* Section type */