From nobody Mon Feb 9 19:37:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1690204096; cv=none; d=zohomail.com; s=zohoarc; b=OYPnQbD+aBFmFeYTzPMoWnffXs+Gk22uCY9hyfpw6lLYV/ra+ySfsq7ewjAd/RzyZsgZlZF2QhPITes97rzS86i8nRyXj1dtNZX6sLq4YOMNqRxYtABFDJ3iotJEftGSkhMEdeAq+zoL5vOZ8BEo6X3KFSV3uaodLDo6ppsEIKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1690204096; 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=b0o4U99LJ9kK5FwaBfgO5EQigxi+V8F9l3IWjv5C77I=; b=EmaQ85V1FE/V00cGjcg8iKaWs4vD3WMiS14ncNKpIyvVGC6ckN0Z8f6NJVWpiIXlSyKqP1qoI08UnobcSIbCe0bx2c0z5WuIFGe7TRJQzfsyNVdcRy8Bviws0PIohl7Fx4rkip1uWQSbeCGRpRG6Euh/YFsVmqAxL5gSosCOwWA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1690204096424432.22255161480257; Mon, 24 Jul 2023 06:08:16 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-58-mcwZLQWuMOqNYfn4scN-dg-1; Mon, 24 Jul 2023 09:07:29 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 628EF8870D3; Mon, 24 Jul 2023 13:07:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 487A8492C13; Mon, 24 Jul 2023 13:07:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2FD6E194658D; Mon, 24 Jul 2023 13:07:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 49E9D194658F for ; Mon, 24 Jul 2023 13:07:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3A33DF783A; Mon, 24 Jul 2023 13:07:23 +0000 (UTC) Received: from secure.mitica (unknown [10.39.194.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 644DBF782D; Mon, 24 Jul 2023 13:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690204095; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b0o4U99LJ9kK5FwaBfgO5EQigxi+V8F9l3IWjv5C77I=; b=HbN6aebIY+KV50RBF/qoyzhsp/EtMQFZOHhIQxvNtuFIq2LxmGKVk2sO59IXZ2ufMEWibw c5jxLy2ssjj1Dz4uwC1CUmbyJ1upnhDU3SocUp/1nNBZq5UrurFw61lOH69QW/kcUeHXxg v4zYjy7J2aoO7nGGYzHqEoUtOMj2IPo= X-MC-Unique: mcwZLQWuMOqNYfn4scN-dg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Juan Quintela To: qemu-devel@nongnu.org Subject: [PATCH 19/26] migration: enforce multifd and postcopy preempt to be set before incoming Date: Mon, 24 Jul 2023 15:06:32 +0200 Message-Id: <20230724130639.93135-20-quintela@redhat.com> In-Reply-To: <20230724130639.93135-1-quintela@redhat.com> References: <20230724130639.93135-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Juan Quintela , libvir-list@redhat.com, Markus Armbruster , Peter Xu , Wei Wang , Leonardo Bras , Paolo Bonzini , Eric Blake Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1690204264692100001 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Wei Wang qemu_start_incoming_migration needs to check the number of multifd channels or postcopy ram channels to configure the backlog parameter (i.e. the maximum length to which the queue of pending connections for sockfd may grow) of listen(). So enforce the usage of postcopy-preempt and multifd as below: - need to use "-incoming defer" on the destination; and - set_capability and set_parameter need to be done before migrate_incoming Otherwise, disable the use of the features and report error messages to remind users to adjust the commands. Signed-off-by: Wei Wang Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Message-ID: <20230606101910.20456-2-wei.w.wang@intel.com> Signed-off-by: Juan Quintela Acked-by: Juan Quintela --- migration/options.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/migration/options.c b/migration/options.c index 7d83f190d6..1d1e1321b0 100644 --- a/migration/options.c +++ b/migration/options.c @@ -441,6 +441,11 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snap= shot, MIGRATION_CAPABILITY_VALIDATE_UUID, MIGRATION_CAPABILITY_ZERO_COPY_SEND); =20 +static bool migrate_incoming_started(void) +{ + return !!migration_incoming_get_current()->transport_data; +} + /** * @migration_caps_check - check capability compatibility * @@ -564,6 +569,12 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) error_setg(errp, "Postcopy preempt not compatible with compres= s"); return false; } + + if (migrate_incoming_started()) { + error_setg(errp, + "Postcopy preempt must be set before incoming start= s"); + return false; + } } =20 if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { @@ -571,6 +582,10 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) error_setg(errp, "Multifd is not compatible with compress"); return false; } + if (migrate_incoming_started()) { + error_setg(errp, "Multifd must be set before incoming starts"); + return false; + } } =20 if (new_caps[MIGRATION_CAPABILITY_SWITCHOVER_ACK]) { --=20 2.40.1