From patchwork Thu Aug 11 11:39:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 658188 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 3s95hq22xLz9t16 for ; Thu, 11 Aug 2016 21:42:03 +1000 (AEST) Received: from localhost ([::1]:47760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoN7-0007fz-9r for incoming@patchwork.ozlabs.org; Thu, 11 Aug 2016 07:42:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoLu-0006nu-Hs for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:40:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bXoLo-0001ib-V8 for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:40:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bXoLo-0001iX-P9 for qemu-devel@nongnu.org; Thu, 11 Aug 2016 07:40:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 2F171B6E70; Thu, 11 Aug 2016 11:40:40 +0000 (UTC) Received: from localhost (ovpn-116-52.phx2.redhat.com [10.3.116.52]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7BBecvG007694; Thu, 11 Aug 2016 07:40:39 -0400 From: Amit Shah To: Peter Maydell Date: Thu, 11 Aug 2016 17:09:41 +0530 Message-Id: <787d134fb164e0395685744ef75829c15f5aee8d.1470915381.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 11 Aug 2016 11:40:40 +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 2.7 3/4] migration: fix live migration failure with compression 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: eyakovlev@virtuozzo.com, Juan Quintela , liang.z.li@intel.com, qemu list , "Dr. David Alan Gilbert" , caoj.fnst@cn.fujitsu.com, Amit Shah , den@openvz.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Liang Li Because of commit 11808bb0c422, which remove some condition checks of 'f->ops->writev_buffer', 'qemu_put_qemu_file' should be enhanced to clear the 'f_src->iovcnt', or 'f_src->iovcnt' may exceed the MAX_IOV_SIZE which will break live migration. This should be fixed. Signed-off-by: Liang Li Reported-by: Jinshi Zhang Reviewed-by: Dr. David Alan Gilbert Message-Id: <1470702146-24399-1-git-send-email-liang.z.li@intel.com> Signed-off-by: Amit Shah --- migration/qemu-file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/qemu-file.c b/migration/qemu-file.c index bbc565e..e9fae31 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -668,6 +668,7 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src) len = f_src->buf_index; qemu_put_buffer(f_des, f_src->buf, f_src->buf_index); f_src->buf_index = 0; + f_src->iovcnt = 0; } return len; }