From patchwork Fri Sep 23 12:57:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 116095 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 26C91B6F72 for ; Sat, 24 Sep 2011 00:30:46 +1000 (EST) Received: from localhost ([::1]:49071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R75Kk-0002Te-8y for incoming@patchwork.ozlabs.org; Fri, 23 Sep 2011 08:58:26 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R75KL-0001Xl-O2 for qemu-devel@nongnu.org; Fri, 23 Sep 2011 08:58:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R75KK-0004so-4Q for qemu-devel@nongnu.org; Fri, 23 Sep 2011 08:58:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R75KJ-0004si-QO for qemu-devel@nongnu.org; Fri, 23 Sep 2011 08:58:00 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8NCvx5R020453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 23 Sep 2011 08:57:59 -0400 Received: from neno.neno (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8NCvZlp021572; Fri, 23 Sep 2011 08:57:58 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 23 Sep 2011 14:57:04 +0200 Message-Id: <8247c5c1b6078349a1c87e3524b3b7d051df9802.1316782367.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 15/23] migration: use global variable directly 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 We are setting a pointer to a local variable in the previous line, just use the global variable directly. We remove the ->file test because it is already done inside qemu_file_set_rate_limit() function. Signed-off-by: Juan Quintela --- migration.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/migration.c b/migration.c index 9bb089a..d5e0eb0 100644 --- a/migration.c +++ b/migration.c @@ -469,7 +469,6 @@ int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data) int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data) { int64_t d; - MigrationState *s; d = qdict_get_int(qdict, "value"); if (d < 0) { @@ -477,9 +476,8 @@ int do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data) } max_throttle = d; - s = current_migration; - if (s && s->file) { - qemu_file_set_rate_limit(s->file, max_throttle); + if (current_migration) { + qemu_file_set_rate_limit(current_migration->file, max_throttle); } return 0;