From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw9xe-0001XA-GB for qemu-devel@nongnu.org; Fri, 29 Apr 2016 11:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw9xS-0005Nr-U3 for qemu-devel@nongnu.org; Fri, 29 Apr 2016 11:04:01 -0400 Received: from mail-am1on0107.outbound.protection.outlook.com ([157.56.112.107]:43530 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw9xR-0005K0-JZ for qemu-devel@nongnu.org; Fri, 29 Apr 2016 11:03:54 -0400 References: <1461941263-9523-1-git-send-email-dgilbert@redhat.com> <1461941263-9523-2-git-send-email-dgilbert@redhat.com> From: "Denis V. Lunev" Message-ID: <572377CA.5030702@openvz.org> Date: Fri, 29 Apr 2016 18:03:38 +0300 MIME-Version: 1.0 In-Reply-To: <1461941263-9523-2-git-send-email-dgilbert@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/5] Postcopy: Avoid 0 length discards List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org, quintela@redhat.com, amit.shah@redhat.com Cc: aarcange@redhat.com, marcel.a@redhat.com, eblake@redhat.com On 04/29/2016 05:47 PM, Dr. David Alan Gilbert (git) wrote: > 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 > --- > migration/ram.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 3f05738..e96c2af 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; Reviewed-by: Denis V. Lunev