From patchwork Fri Jun 22 13:46:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 166596 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 14E22B6EF1 for ; Fri, 22 Jun 2012 23:46:53 +1000 (EST) Received: from localhost ([::1]:34251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si4CI-0003tk-UK for incoming@patchwork.ozlabs.org; Fri, 22 Jun 2012 09:46:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si4C2-0003fC-Ap for qemu-devel@nongnu.org; Fri, 22 Jun 2012 09:46:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Si4Bx-0006FT-Nz for qemu-devel@nongnu.org; Fri, 22 Jun 2012 09:46:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Si4Bx-0006FN-Fg for qemu-devel@nongnu.org; Fri, 22 Jun 2012 09:46:29 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5MDkRt2012666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Jun 2012 09:46:27 -0400 Received: from trasno.mitica (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5MDkKFK030931; Fri, 22 Jun 2012 09:46:26 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 22 Jun 2012 15:46:14 +0200 Message-Id: <5a5d97ef8180b2c1f2be80d50ed49c9934de39a2.1340371865.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: owasserm@redhat.com, vinodchegu@gmail.com Subject: [Qemu-devel] [PATCH 3/8] No need to iterate if we already are over the limit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If buffers are full, don't iterate, just exit. Signed-off-by: Juan Quintela Reviewed-by: Orit Wasserman --- savevm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/savevm.c b/savevm.c index 40320be..9101bfb 100644 --- a/savevm.c +++ b/savevm.c @@ -1625,6 +1625,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);