From nobody Sat Nov 8 05:02:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550663925397733.494928048065; Wed, 20 Feb 2019 03:58:45 -0800 (PST) Received: from localhost ([127.0.0.1]:38798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwQWO-0008FX-Ec for importer@patchew.org; Wed, 20 Feb 2019 06:58:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwQUV-000719-Fh for qemu-devel@nongnu.org; Wed, 20 Feb 2019 06:56:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwQUR-0000nz-3P for qemu-devel@nongnu.org; Wed, 20 Feb 2019 06:56:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwQUQ-0000UU-Td for qemu-devel@nongnu.org; Wed, 20 Feb 2019 06:56:39 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DEED63DE0B for ; Wed, 20 Feb 2019 11:56:34 +0000 (UTC) Received: from localhost.localdomain (ovpn-117-2.ams2.redhat.com [10.36.117.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBBAD60141; Wed, 20 Feb 2019 11:56:32 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 20 Feb 2019 12:56:04 +0100 Message-Id: <20190220115611.3192-2-quintela@redhat.com> In-Reply-To: <20190220115611.3192-1-quintela@redhat.com> References: <20190220115611.3192-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 20 Feb 2019 11:56:34 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PATCH v2 1/8] multifd: Only send pages when packet are not empty 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: Laurent Vivier , Thomas Huth , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We send packages without pages sometimes for sysnchronizanion. The iov functions do the right thing, but we will be changing this code in future patches. Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/ram.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 59191c1ed2..8b5fd67d66 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1025,9 +1025,12 @@ static void *multifd_send_thread(void *opaque) break; } =20 - ret =3D qio_channel_writev_all(p->c, p->pages->iov, used, &loc= al_err); - if (ret !=3D 0) { - break; + if (used) { + ret =3D qio_channel_writev_all(p->c, p->pages->iov, + used, &local_err); + if (ret !=3D 0) { + break; + } } =20 qemu_mutex_lock(&p->mutex); @@ -1254,9 +1257,12 @@ static void *multifd_recv_thread(void *opaque) p->num_pages +=3D used; qemu_mutex_unlock(&p->mutex); =20 - ret =3D qio_channel_readv_all(p->c, p->pages->iov, used, &local_er= r); - if (ret !=3D 0) { - break; + if (used) { + ret =3D qio_channel_readv_all(p->c, p->pages->iov, + used, &local_err); + if (ret !=3D 0) { + break; + } } =20 if (flags & MULTIFD_FLAG_SYNC) { --=20 2.20.1