From patchwork Tue Aug 9 00:22:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liang Li X-Patchwork-Id: 9270029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED16E607D6 for ; Tue, 9 Aug 2016 00:30:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC971281C3 for ; Tue, 9 Aug 2016 00:30:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCDE9281A7; Tue, 9 Aug 2016 00:30:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D136281A7 for ; Tue, 9 Aug 2016 00:30:36 +0000 (UTC) Received: from localhost ([::1]:60989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWuwF-0002De-G3 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 Aug 2016 20:30:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWuvm-0002Ah-V0 for qemu-devel@nongnu.org; Mon, 08 Aug 2016 20:30:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWuvi-0005fz-PH for qemu-devel@nongnu.org; Mon, 08 Aug 2016 20:30:05 -0400 Received: from mga09.intel.com ([134.134.136.24]:24031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWuvi-0005fa-Jg for qemu-devel@nongnu.org; Mon, 08 Aug 2016 20:30:02 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 08 Aug 2016 17:30:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,492,1464678000"; d="scan'208"; a="1010815767" Received: from ll.sh.intel.com (HELO localhost) ([10.239.13.123]) by orsmga001.jf.intel.com with ESMTP; 08 Aug 2016 17:30:00 -0700 From: Liang Li To: qemu-devel@nongnu.org Date: Tue, 9 Aug 2016 08:22:26 +0800 Message-Id: <1470702146-24399-1-git-send-email-liang.z.li@intel.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 Subject: [Qemu-devel] [PATCH] 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: amit.shah@redhat.com, Liang Li , dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Dr. David Alan Gilbert --- 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; }