From patchwork Fri Jun 10 07:00:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 633550 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rQtRF10jgz9sdQ for ; Fri, 10 Jun 2016 17:02:49 +1000 (AEST) Received: from localhost ([::1]:38697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBGSt-0000dn-31 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2016 03:02:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBGRQ-0007vq-T9 for qemu-devel@nongnu.org; Fri, 10 Jun 2016 03:01:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBGRL-0005Vb-1I for qemu-devel@nongnu.org; Fri, 10 Jun 2016 03:01:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBGRK-0005VX-SU for qemu-devel@nongnu.org; Fri, 10 Jun 2016 03:01:10 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B7CD71096; Fri, 10 Jun 2016 07:01:10 +0000 (UTC) Received: from localhost (ovpn-116-20.sin2.redhat.com [10.67.116.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5A718o4016786; Fri, 10 Jun 2016 03:01:09 -0400 From: Amit Shah To: Peter Maydell Date: Fri, 10 Jun 2016 12:30:45 +0530 Message-Id: <4f2de508a7668a5c70ee586c9cc4b3e570fb833b.1465541858.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 10 Jun 2016 07:01:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/8] Postcopy: Avoid 0 length discards X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu list , Amit Shah , "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Dr. David Alan Gilbert" The discard code in migration/ram.c would send request for zero length discards in the case where no discards were needed. It doesn't appear to have had any bad effect. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Denis V. Lunev Message-Id: <1463489755-30703-2-git-send-email-dgilbert@redhat.com> Signed-off-by: Amit Shah --- migration/ram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migration/ram.c b/migration/ram.c index 844ea46..5f929d6 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1557,7 +1557,9 @@ static int postcopy_send_discard_bm_ram(MigrationState *ms, } else { discard_length = zero - one; } - postcopy_discard_send_range(ms, pds, one, discard_length); + if (discard_length) { + postcopy_discard_send_range(ms, pds, one, discard_length); + } current = one + discard_length; } else { current = one;