From nobody Wed May 1 19:40:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15016444009041021.3747676296515; Tue, 1 Aug 2017 20:26:40 -0700 (PDT) Received: from localhost ([::1]:45288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dckIw-0003pa-Hd for importer@patchew.org; Tue, 01 Aug 2017 23:26:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dckHu-0003KU-Gm for qemu-devel@nongnu.org; Tue, 01 Aug 2017 23:25:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dckHt-0000fc-PA for qemu-devel@nongnu.org; Tue, 01 Aug 2017 23:25:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60318) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dckHt-0000f2-J9 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 23:25:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A249123E1C for ; Wed, 2 Aug 2017 03:25:32 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-15-224.nay.redhat.com [10.66.15.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AFD166D21; Wed, 2 Aug 2017 03:25:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A249123E1C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=peterx@redhat.com From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 2 Aug 2017 11:25:20 +0800 Message-Id: <1501644321-17721-2-git-send-email-peterx@redhat.com> In-Reply-To: <1501644321-17721-1-git-send-email-peterx@redhat.com> References: <1501644321-17721-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 02 Aug 2017 03:25:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] migration: fix comment disorder in RAMState 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 , "Dr . David Alan Gilbert" , peterx@redhat.com, Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Comments for "migration_dirty_pages" and "bitmap_mutex" are switched. Fix it. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- migration/ram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 1b08296..e18b3e2 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -188,9 +188,9 @@ struct RAMState { uint64_t iterations_prev; /* Iterations since start */ uint64_t iterations; - /* protects modification of the bitmap */ - uint64_t migration_dirty_pages; /* number of dirty bits in the bitmap */ + uint64_t migration_dirty_pages; + /* protects modification of the bitmap */ QemuMutex bitmap_mutex; /* The RAMBlock used in the last src_page_requests */ RAMBlock *last_req_rb; --=20 2.7.4 From nobody Wed May 1 19:40:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501644414881563.7961151518472; Tue, 1 Aug 2017 20:26:54 -0700 (PDT) Received: from localhost ([::1]:45289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dckJA-0003yo-Vh for importer@patchew.org; Tue, 01 Aug 2017 23:26:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dckI0-0003NK-Dj for qemu-devel@nongnu.org; Tue, 01 Aug 2017 23:25:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dckHz-0000kB-GY for qemu-devel@nongnu.org; Tue, 01 Aug 2017 23:25:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56476) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dckHz-0000jc-39 for qemu-devel@nongnu.org; Tue, 01 Aug 2017 23:25:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 23D7416BAFA for ; Wed, 2 Aug 2017 03:25:38 +0000 (UTC) Received: from pxdev.xzpeter.org.com (dhcp-15-224.nay.redhat.com [10.66.15.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AB9166D21; Wed, 2 Aug 2017 03:25:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 23D7416BAFA Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=peterx@redhat.com From: Peter Xu To: qemu-devel@nongnu.org Date: Wed, 2 Aug 2017 11:25:21 +0800 Message-Id: <1501644321-17721-3-git-send-email-peterx@redhat.com> In-Reply-To: <1501644321-17721-1-git-send-email-peterx@redhat.com> References: <1501644321-17721-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 02 Aug 2017 03:25:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] io: fix qio_channel_socket_accept err handling 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 , "Dr . David Alan Gilbert" , peterx@redhat.com, Juan Quintela Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When accept failed, we should setup errp with the reason. More importantly, the caller may assume errp be non-NULL when error happens, and not setting the errp may crash QEMU. At the same time, move the trace_qio_channel_socket_accept_fail() after the if check on EINTR. Two reasons: 1. when EINTR happened, it's not really a fault (we should just try again), so we should not log with an "accept failure". 2. trace_*() functions may overwrite errno, then the old errno will be missing. We need to either check errno before trace_*() calls, or reserve the errno. Signed-off-by: Peter Xu Reviewed-by: Juan Quintela --- io/channel-socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index 53386b7..442f230 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -340,10 +340,11 @@ qio_channel_socket_accept(QIOChannelSocket *ioc, cioc->fd =3D qemu_accept(ioc->fd, (struct sockaddr *)&cioc->remoteAddr, &cioc->remoteAddrLen); if (cioc->fd < 0) { - trace_qio_channel_socket_accept_fail(ioc); if (errno =3D=3D EINTR) { goto retry; } + trace_qio_channel_socket_accept_fail(ioc); + error_setg_errno(errp, errno, "Unable to accept connection"); goto error; } =20 --=20 2.7.4