From patchwork Tue Oct 2 11:33:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 188491 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 344D82C0085 for ; Tue, 2 Oct 2012 22:47:04 +1000 (EST) Received: from localhost ([::1]:56378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ1sM-0002Y7-CJ for incoming@patchwork.ozlabs.org; Tue, 02 Oct 2012 08:47:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ0jw-0006bo-IC for qemu-devel@nongnu.org; Tue, 02 Oct 2012 07:34:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJ0jq-0007kx-6I for qemu-devel@nongnu.org; Tue, 02 Oct 2012 07:34:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJ0jp-0007jm-VN for qemu-devel@nongnu.org; Tue, 02 Oct 2012 07:34:10 -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 q92BY9gK019672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Oct 2012 07:34:09 -0400 Received: from trasno.mitica (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q92BXbaq001633; Tue, 2 Oct 2012 07:34:08 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Tue, 2 Oct 2012 13:33:18 +0200 Message-Id: <1349177616-5341-24-git-send-email-quintela@redhat.com> In-Reply-To: <1349177616-5341-1-git-send-email-quintela@redhat.com> References: <1349177616-5341-1-git-send-email-quintela@redhat.com> 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 Subject: [Qemu-devel] [PATCH 23/41] buffered_file: We can access directly to bandwidth_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 Signed-off-by: Juan Quintela Reviewed-by: Paolo Bonzini --- buffered_file.c | 5 ++--- buffered_file.h | 3 +-- migration.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/buffered_file.c b/buffered_file.c index 4fca774..43e68b6 100644 --- a/buffered_file.c +++ b/buffered_file.c @@ -222,15 +222,14 @@ static void buffered_rate_tick(void *opaque) buffered_put_buffer(s, NULL, 0, 0); } -QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state, - size_t bytes_per_sec) +QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state) { QEMUFileBuffered *s; s = g_malloc0(sizeof(*s)); s->migration_state = migration_state; - s->xfer_limit = bytes_per_sec / 10; + s->xfer_limit = migration_state->bandwidth_limit / 10; s->file = qemu_fopen_ops(s, buffered_put_buffer, NULL, buffered_close, buffered_rate_limit, diff --git a/buffered_file.h b/buffered_file.h index 8a38754..ef010fe 100644 --- a/buffered_file.h +++ b/buffered_file.h @@ -17,7 +17,6 @@ #include "hw/hw.h" #include "migration.h" -QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state, - size_t xfer_limit); +QEMUFile *qemu_fopen_ops_buffered(MigrationState *migration_state); #endif diff --git a/migration.c b/migration.c index f647a3f..ea21dc4 100644 --- a/migration.c +++ b/migration.c @@ -429,7 +429,7 @@ void migrate_fd_connect(MigrationState *s) int ret; s->state = MIG_STATE_ACTIVE; - s->file = qemu_fopen_ops_buffered(s, s->bandwidth_limit); + s->file = qemu_fopen_ops_buffered(s); DPRINTF("beginning savevm\n"); ret = qemu_savevm_state_begin(s->file, &s->params);