From nobody Mon May 6 18:22:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617912151; cv=none; d=zohomail.com; s=zohoarc; b=RkFnlp9PasLFbBXgjrp6MrcoXIR4s7lKht8vPmp+Mkb0Vcxv4HdqICxyfUp71OKpWkQqFGZjFipDuaRO2GE37AZTyPuuCKFrXhJGrVL1JmCynEKPNneQVmhgdAa49BZ6PdeaX42mY4Micw9Og1GzCB/TT3l/EevQkJyV+WLYbGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617912151; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HgRhmUllvKBcH+CXsDN0tdx3CaXLmi88a6aEQbJyhDY=; b=bfSmCMEGvYGgV9xNvS7oEmmMcwjGS9mq/46KJp2H2V0RXqVgjgI8l6tsMAkXY4/9oY4aF3tyK4b44c+w7yq+1D96T+woHC0REg4wi3VWI4Fkd7XOPDEjlzVVQsyl7zvlegDDLGgvhBYYVoJCKhI+VCwlJH/YIaLGyW+xZ1dySDA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617912151522511.9172368402227; Thu, 8 Apr 2021 13:02:31 -0700 (PDT) Received: from localhost ([::1]:44066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUarF-0007U1-Uu for importer@patchew.org; Thu, 08 Apr 2021 16:02:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUanL-0004Dg-Of for qemu-devel@nongnu.org; Thu, 08 Apr 2021 15:58:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUanJ-0000Rl-VA for qemu-devel@nongnu.org; Thu, 08 Apr 2021 15:58:27 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-v8CGXjpcNKuX6VjZIgpnNQ-1; Thu, 08 Apr 2021 15:58:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8688C1975B84 for ; Thu, 8 Apr 2021 19:12:13 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-38.ams2.redhat.com [10.36.115.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA4595D9E3; Thu, 8 Apr 2021 19:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617911903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HgRhmUllvKBcH+CXsDN0tdx3CaXLmi88a6aEQbJyhDY=; b=d6qoevzqVX1oCqVsfYavrVRzg1H0pwYaq7pT+OTTUeMNgQ24JGRjfLjzvI0hxUcdY4gdkr 9XsvrDiBns+kEMoG1+iY+fQDS87plttbgR6Gywbj4r2lDC99JdgpkjyMtTXmIg8z+8NiIZ l0tJHwfHLAM4lR5TTZNFMy8YHKImwIE= X-MC-Unique: v8CGXjpcNKuX6VjZIgpnNQ-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, berrange@redhat.com, kraxel@redhat.com, eblake@redhat.com, armbru@redhat.com, pabeni@redhat.com Subject: [RFC PATCH 1/5] channel-socket: Only set CLOEXEC if we have space for fds Date: Thu, 8 Apr 2021 20:11:55 +0100 Message-Id: <20210408191159.133644-2-dgilbert@redhat.com> In-Reply-To: <20210408191159.133644-1-dgilbert@redhat.com> References: <20210408191159.133644-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" MSG_CMSG_CLOEXEC cleans up received fd's; it's really only for Unix sockets, but currently we enable it for everything; some socket types (IP_MPTCP) don't like this. Only enable it when we're giving the recvmsg room to receive fd's anyway. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 --- io/channel-socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index de259f7eed..606ec97cf7 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -487,15 +487,15 @@ static ssize_t qio_channel_socket_readv(QIOChannel *i= oc, =20 memset(control, 0, CMSG_SPACE(sizeof(int) * SOCKET_MAX_FDS)); =20 -#ifdef MSG_CMSG_CLOEXEC - sflags |=3D MSG_CMSG_CLOEXEC; -#endif - msg.msg_iov =3D (struct iovec *)iov; msg.msg_iovlen =3D niov; if (fds && nfds) { msg.msg_control =3D control; msg.msg_controllen =3D sizeof(control); +#ifdef MSG_CMSG_CLOEXEC + sflags |=3D MSG_CMSG_CLOEXEC; +#endif + } =20 retry: --=20 2.31.1 From nobody Mon May 6 18:22:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617913980; cv=none; d=zohomail.com; s=zohoarc; b=BFvRAHe4cu6AsqEXngZZmKCPq0flWNO9sdUHPtw6SIRcq5/I9DWP7I0VqXrSO/2YLcJxE1wVkl3NE66C5oT9BEQhSB7HrfhV3U78+F8db9itemp8jreX5lUpbPxl8BXRfdmUkEPBH2V2kcG/mcy2r3Oxv9dar8/k5hbz4cFQD/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617913980; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GISUZiqcjF8zCPUJdNpDTcmIK6UAeROkndh6d5zb6Co=; b=n5QSBXtFdADo1fzT4BDpPeS9rxI+Kwj0edEPeP7TgK6g9CUZtJ9oM5w1631+k+WXafrLno7+vU0SxhW39ytOzQ7upbYDTKYvabD9ZCmOTGODwMh2QfcxLy0eOxcHElHEph8f7NwaEcLJPsg89dzMj9AB8rAd2YrKdL2GX6HOPds= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161791398044177.31602558390694; Thu, 8 Apr 2021 13:33:00 -0700 (PDT) Received: from localhost ([::1]:52044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUbKl-00079x-2L for importer@patchew.org; Thu, 08 Apr 2021 16:32:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbIr-0005k3-SL for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:31:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56947) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbIq-0001mn-DD for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:31:01 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-n6gNPVrDNLyKqwMyn6z7Dg-1; Thu, 08 Apr 2021 16:30:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BE04519A809F for ; Thu, 8 Apr 2021 19:12:17 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-38.ams2.redhat.com [10.36.115.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id F26805D9F2; Thu, 8 Apr 2021 19:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617913859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GISUZiqcjF8zCPUJdNpDTcmIK6UAeROkndh6d5zb6Co=; b=ebzWFwV3M6p5Lri0zXVn2wVZQ7xBzhMIFs73hivdBF0n3cPQbG8rDDzPHy/12cJNiTs9yY Uv+loDv4n+WbgH84f5mTyQLomF1A3ljOMCLaJCmZyMYf3wjfQAYRCoop/q86V3fIjZh9eA u4SiCBSu5DLKV2X9AFmNspaj4fE4CS8= X-MC-Unique: n6gNPVrDNLyKqwMyn6z7Dg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, berrange@redhat.com, kraxel@redhat.com, eblake@redhat.com, armbru@redhat.com, pabeni@redhat.com Subject: [RFC PATCH 2/5] io/net-listener: Call the notifier during finalize Date: Thu, 8 Apr 2021 20:11:56 +0100 Message-Id: <20210408191159.133644-3-dgilbert@redhat.com> In-Reply-To: <20210408191159.133644-1-dgilbert@redhat.com> References: <20210408191159.133644-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Call the notifier during finalize; it's currently only called if we change it, which is not the intent. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 --- io/net-listener.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/io/net-listener.c b/io/net-listener.c index 46c2643d00..1c984d69c6 100644 --- a/io/net-listener.c +++ b/io/net-listener.c @@ -292,6 +292,9 @@ static void qio_net_listener_finalize(Object *obj) QIONetListener *listener =3D QIO_NET_LISTENER(obj); size_t i; =20 + if (listener->io_notify) { + listener->io_notify(listener->io_data); + } qio_net_listener_disconnect(listener); =20 for (i =3D 0; i < listener->nsioc; i++) { --=20 2.31.1 From nobody Mon May 6 18:22:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617913643; cv=none; d=zohomail.com; s=zohoarc; b=ac4EQ5iZ/gJdz+l/x3EIKOnnJAjNWFSD9qhbOwx3aYKOlOCMdoZiJ0M4sLtFQ+yEoAglGQ9QWCPUmu7FJoOPp2MLa4b0pip/PYRhxHGmnOOarY6t1kyItGKgmvoCu11sLHr+cnj8sdZbhrzomoqzesd2II31f//7Jxtg/f7pRi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617913643; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pOvs/SIf1ZJaSBSgFv/P8FxfxoZdPEqMF+5TY5dZUU8=; b=To1PlnlM4gXyC79VEAZkOybHxTUTHP77wlJ0T58V1gzYD0nmvMW3+k9Tfc2KCKyP9Y1oIJJbtgk7HmU26plrO6JjAJYL/jO6ufBKUAZ6fzo5/ChWJnaktfb/YxKDbNJ42gK4A3x5GSKjStixIlhKJrrGl4Bez99P4B+3vcDR1Oc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617913643690767.3039255487381; Thu, 8 Apr 2021 13:27:23 -0700 (PDT) Received: from localhost ([::1]:43264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUbFJ-0003Hi-Pq for importer@patchew.org; Thu, 08 Apr 2021 16:27:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbEX-0002gA-OA for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:26:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbEN-0007Fk-7K for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:26:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-Ncy4q93-MAqdmHJcNWVapg-1; Thu, 08 Apr 2021 16:26:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F0C6FA0F1D9 for ; Thu, 8 Apr 2021 19:12:21 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-38.ams2.redhat.com [10.36.115.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3393D5D9CC; Thu, 8 Apr 2021 19:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617913580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pOvs/SIf1ZJaSBSgFv/P8FxfxoZdPEqMF+5TY5dZUU8=; b=YsepMManHdFe8xDGd6ulEvwRAhYyXxcc/8xitpC6oz3L31HerWELTM+fcfefEoUTMB8T/P TN+hp3PGts/HlQdUFhg8Pz9453+P3w7Ky89LjqVYApbE8xueeroLRzVPUE1CTTpRYs5oFF T4QROhTCg7Q21oEWF393wUV0D+vDEpA= X-MC-Unique: Ncy4q93-MAqdmHJcNWVapg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, berrange@redhat.com, kraxel@redhat.com, eblake@redhat.com, armbru@redhat.com, pabeni@redhat.com Subject: [RFC PATCH 3/5] migration: Add cleanup hook for inwards migration Date: Thu, 8 Apr 2021 20:11:57 +0100 Message-Id: <20210408191159.133644-4-dgilbert@redhat.com> In-Reply-To: <20210408191159.133644-1-dgilbert@redhat.com> References: <20210408191159.133644-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=216.205.24.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Add a cleanup hook for incoming migration that gets called at the end as a way for a transport to allow cleanup. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/migration.c | 3 +++ migration/migration.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index ca8b97baa5..feaedc382e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -279,6 +279,9 @@ void migration_incoming_state_destroy(void) g_array_free(mis->postcopy_remote_fds, TRUE); mis->postcopy_remote_fds =3D NULL; } + if (mis->transport_cleanup) { + mis->transport_cleanup(mis->transport_data); + } =20 qemu_event_reset(&mis->main_thread_load_event); =20 diff --git a/migration/migration.h b/migration/migration.h index db6708326b..1b4c5da917 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -49,6 +49,10 @@ struct PostcopyBlocktimeContext; struct MigrationIncomingState { QEMUFile *from_src_file; =20 + /* A hook to allow cleanup at the end of incoming migration */ + void *transport_data; + void (*transport_cleanup)(void *data); + /* * Free at the start of the main state load, set as the main thread fi= nishes * loading state. --=20 2.31.1 From nobody Mon May 6 18:22:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617913671; cv=none; d=zohomail.com; s=zohoarc; b=C5l0ziHBOwiU9zgyKvKpiAo0ktn7FErEciNeHDx50OzhZb0vWmUbkpYFxdOrGPmQwlerzBmEZIkR+HZathKFISlrnVhX8N9PUeF9aX3R4KLjISUs8I/SnHM5/Aqyi2b7jyN6o+OiveA2nlvx1X5psS/gZqJ38AryG70jFW8juZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617913671; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GKFQOns4Uybc/3ZXVdsQzg+/YitpDdAbNmwhDNQJtBo=; b=iQTmAi879p5mnMrzvtRb0hM/pZIdOi4RejqprTrwMZCHJgnffnluFFLcv9HpnQh9zyYAE7CRhcNqnmVklp4bsT5Em24dECPA1VR3NIHayzbD4ShQ/Rel2BT8L0FY1EmkcZgvjr/5gE4UF2wvQWSK3W7wANrTC084z+xRduMOEFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617913671810213.09303195286282; Thu, 8 Apr 2021 13:27:51 -0700 (PDT) Received: from localhost ([::1]:44652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUbFl-0003r6-Fg for importer@patchew.org; Thu, 08 Apr 2021 16:27:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbEp-0002yc-Pl for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:26:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60757) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbEe-0007Va-HC for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:26:51 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-518-AOWM5ij7PhGirSOT8Kkytg-1; Thu, 08 Apr 2021 16:26:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B469A19A9A20 for ; Thu, 8 Apr 2021 19:12:30 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-38.ams2.redhat.com [10.36.115.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67CB25D9E3; Thu, 8 Apr 2021 19:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617913599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GKFQOns4Uybc/3ZXVdsQzg+/YitpDdAbNmwhDNQJtBo=; b=EXJ0SMjlqbw/cSPIBTjUkAt38IO5x+US8Zf203PvNgtzUOSCyHazr405Y4xQ0RvMBlNcSX ktZ6F+iD7ba4zbxUC3Cg2D+Mj/dSd3gLem3TfC5Gm8r1lFdyP56/zzmanyuULEe6BI+yDP EruFJHejXlVJ5KJad7XyFMWlpgIOzjk= X-MC-Unique: AOWM5ij7PhGirSOT8Kkytg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, berrange@redhat.com, kraxel@redhat.com, eblake@redhat.com, armbru@redhat.com, pabeni@redhat.com Subject: [RFC PATCH 4/5] migration/socket: Close the listener at the end Date: Thu, 8 Apr 2021 20:11:58 +0100 Message-Id: <20210408191159.133644-5-dgilbert@redhat.com> In-Reply-To: <20210408191159.133644-1-dgilbert@redhat.com> References: <20210408191159.133644-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Delay closing the listener until the cleanup hook at the end; mptcp needs the listener to stay open while the other paths come in. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 --- migration/multifd.c | 5 +++++ migration/socket.c | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index a6677c45c8..cebd9029b9 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -1165,6 +1165,11 @@ bool multifd_recv_all_channels_created(void) return true; } =20 + if (!multifd_recv_state) { + /* Called before any connections created */ + return false; + } + return thread_count =3D=3D qatomic_read(&multifd_recv_state->count); } =20 diff --git a/migration/socket.c b/migration/socket.c index 6016642e04..05705a32d8 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -126,22 +126,31 @@ static void socket_accept_incoming_migration(QIONetLi= stener *listener, { trace_migration_socket_incoming_accepted(); =20 - qio_channel_set_name(QIO_CHANNEL(cioc), "migration-socket-incoming"); - migration_channel_process_incoming(QIO_CHANNEL(cioc)); - if (migration_has_all_channels()) { - /* Close listening socket as its no longer needed */ - qio_net_listener_disconnect(listener); - object_unref(OBJECT(listener)); + error_report("%s: Extra incoming migration connection; ignoring", + __func__); + return; } + + qio_channel_set_name(QIO_CHANNEL(cioc), "migration-socket-incoming"); + migration_channel_process_incoming(QIO_CHANNEL(cioc)); } =20 +static void +socket_incoming_migration_end(void *opaque) +{ + QIONetListener *listener =3D opaque; + + qio_net_listener_disconnect(listener); + object_unref(OBJECT(listener)); +} =20 static void socket_start_incoming_migration_internal(SocketAddress *saddr, Error **errp) { QIONetListener *listener =3D qio_net_listener_new(); + MigrationIncomingState *mis =3D migration_incoming_get_current(); size_t i; int num =3D 1; =20 @@ -156,6 +165,9 @@ socket_start_incoming_migration_internal(SocketAddress = *saddr, return; } =20 + mis->transport_data =3D listener; + mis->transport_cleanup =3D socket_incoming_migration_end; + qio_net_listener_set_client_func_full(listener, socket_accept_incoming_migration, NULL, NULL, --=20 2.31.1 From nobody Mon May 6 18:22:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617913751; cv=none; d=zohomail.com; s=zohoarc; b=fHOBoDBMV9VLKcYSgFTeggJnVlQnJwTpGiGJkzdrXs1Kgq8Mjol9MSPJVhL8vJnRtlRyuJG3r2J+1SP4elmT8mJktb43W5nQS4xD9nqa3J6B4pWFD6QnvOxCU6ZTkKVF4VhAShmdxJ0LVd346egU7Nnm8RVoelDts76/9GVCh+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617913751; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6v0ufZEPZNlTZ23gcFAWmj+A0YVzmAbagmcB2GekwNE=; b=HmNTm0u6GSCFtUI11P1I6cFNiIAYz6qIkZaHtIXQtX46cmx/ybC0pYVZYVXtcsrC2UgmDFhs9ELl37VMn9yITlDEt8TWBlW67w6LUHcx+0xppBoS1ZZPB++1LOutkwNqrXpio6dBe8uwgLphFtF9ZAIiZrr9Snx2Nf/s8ihJ0kw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617913751381927.3942763652377; Thu, 8 Apr 2021 13:29:11 -0700 (PDT) Received: from localhost ([::1]:47370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUbH4-0004y1-Aj for importer@patchew.org; Thu, 08 Apr 2021 16:29:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbEq-0002za-JF for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:26:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUbEe-0007Ve-It for qemu-devel@nongnu.org; Thu, 08 Apr 2021 16:26:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-p1OaxaUYODqXYV3dCcFaZg-1; Thu, 08 Apr 2021 16:26:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EA6221CC2CF for ; Thu, 8 Apr 2021 19:12:34 +0000 (UTC) Received: from dgilbert-t580.localhost (ovpn-115-38.ams2.redhat.com [10.36.115.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A5BF5D9CC; Thu, 8 Apr 2021 19:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617913599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6v0ufZEPZNlTZ23gcFAWmj+A0YVzmAbagmcB2GekwNE=; b=F0wTO25uWCx9/kiIftGzuTkit3//rHQSxKf5cEJoS+Y9RBKAyOGAAZu6F+14AW6nmSOZLh zEVezR9+kQvqN5SHaZ6WsEymX//k7PuAoVl9n25dJw9jVrXe9cmWBWRhRxVzhGeg9lgCkD ZiNkn+hAJcJCMcBW8R8C/h4Upo1NTDI= X-MC-Unique: p1OaxaUYODqXYV3dCcFaZg-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, berrange@redhat.com, kraxel@redhat.com, eblake@redhat.com, armbru@redhat.com, pabeni@redhat.com Subject: [RFC PATCH 5/5] sockets: Support multipath TCP Date: Thu, 8 Apr 2021 20:11:59 +0100 Message-Id: <20210408191159.133644-6-dgilbert@redhat.com> In-Reply-To: <20210408191159.133644-1-dgilbert@redhat.com> References: <20210408191159.133644-1-dgilbert@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Multipath TCP allows combining multiple interfaces/routes into a single socket, with very little work for the user/admin. It's enabled by 'mptcp' on most socket addresses: ./qemu-system-x86_64 -nographic -incoming tcp:0:4444,mptcp Signed-off-by: Dr. David Alan Gilbert --- io/dns-resolver.c | 2 ++ qapi/sockets.json | 5 ++++- util/qemu-sockets.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/io/dns-resolver.c b/io/dns-resolver.c index 743a0efc87..b081e098bb 100644 --- a/io/dns-resolver.c +++ b/io/dns-resolver.c @@ -122,6 +122,8 @@ static int qio_dns_resolver_lookup_sync_inet(QIODNSReso= lver *resolver, .ipv4 =3D iaddr->ipv4, .has_ipv6 =3D iaddr->has_ipv6, .ipv6 =3D iaddr->ipv6, + .has_mptcp =3D iaddr->has_mptcp, + .mptcp =3D iaddr->mptcp, }; =20 (*addrs)[i] =3D newaddr; diff --git a/qapi/sockets.json b/qapi/sockets.json index 2e83452797..43122a38bf 100644 --- a/qapi/sockets.json +++ b/qapi/sockets.json @@ -57,6 +57,8 @@ # @keep-alive: enable keep-alive when connecting to this socket. Not suppo= rted # for passive sockets. (Since 4.2) # +# @mptcp: enable multi-path TCP. (Since 6.0) +# # Since: 1.3 ## { 'struct': 'InetSocketAddress', @@ -66,7 +68,8 @@ '*to': 'uint16', '*ipv4': 'bool', '*ipv6': 'bool', - '*keep-alive': 'bool' } } + '*keep-alive': 'bool', + '*mptcp': 'bool' } } =20 ## # @UnixSocketAddress: diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 8af0278f15..72527972d5 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -206,6 +206,21 @@ static int try_bind(int socket, InetSocketAddress *sad= dr, struct addrinfo *e) #endif } =20 +static int check_mptcp(const InetSocketAddress *saddr, struct addrinfo *ai, + Error **errp) +{ + if (saddr->has_mptcp && saddr->mptcp) { +#ifdef IPPROTO_MPTCP + ai->ai_protocol =3D IPPROTO_MPTCP; +#else + error_setg(errp, "MPTCP unavailable in this build"); + return -1; +#endif + } + + return 0; +} + static int inet_listen_saddr(InetSocketAddress *saddr, int port_offset, int num, @@ -278,6 +293,11 @@ static int inet_listen_saddr(InetSocketAddress *saddr, =20 /* create socket + bind/listen */ for (e =3D res; e !=3D NULL; e =3D e->ai_next) { + if (check_mptcp(saddr, e, &err)) { + error_propagate(errp, err); + return -1; + } + getnameinfo((struct sockaddr*)e->ai_addr,e->ai_addrlen, uaddr,INET6_ADDRSTRLEN,uport,32, NI_NUMERICHOST | NI_NUMERICSERV); @@ -456,6 +476,11 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error= **errp) for (e =3D res; e !=3D NULL; e =3D e->ai_next) { error_free(local_err); local_err =3D NULL; + + if (check_mptcp(saddr, e, &local_err)) { + break; + } + sock =3D inet_connect_addr(saddr, e, &local_err); if (sock >=3D 0) { break; @@ -687,6 +712,15 @@ int inet_parse(InetSocketAddress *addr, const char *st= r, Error **errp) } addr->has_keep_alive =3D true; } + begin =3D strstr(optstr, ",mptcp"); + if (begin) { + if (inet_parse_flag("mptcp", begin + strlen(",mptcp"), + &addr->mptcp, errp) < 0) + { + return -1; + } + addr->has_mptcp =3D true; + } return 0; } =20 --=20 2.31.1