Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 430CE606A31A for ; Tue, 1 Dec 2026 10:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aBCkbKBQ Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYLUA-0001Ve-6G; Tue, 01 Dec 2026 05:53:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYLTe-0001I5-AV for qemu-devel@nongnu.org; Tue, 01 Dec 2026 05:52:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYLTa-0006Y4-QV for qemu-devel@nongnu.org; Tue, 01 Dec 2026 05:52:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796122366; 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=VrQKdoqEIV2FPaVVHooDABduETReV+r2A6KTobrBqt8=; b=aBCkbKBQQKKfwWVm7JaHp+HG4TVHOZFGNIFL+KlCDEZHMjxpxnKh4GtIHXpv6sqakUh0fM ssbHFzSnPRq8YnAk7g3mm58JTZzYE01HxDAzchRTR321am0UjNIC3Dyq/ad5cEvB6JfpX8 m7sjvl5Rs71zpTGNXdBxyvuCaUIJ8jI= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-Gws0Bj_GPL6LG3npxEo2og-1; Tue, 1 Dec 2026 10:52:42 +0000 X-MC-Unique: Gws0Bj_GPL6LG3npxEo2og-1 X-Mimecast-MFC-AGG-ID: Gws0Bj_GPL6LG3npxEo2og_1796122361 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5C788180047B; Tue, 1 Dec 2026 10:52:41 +0000 (UTC) Received: from circe.redhat.com (unknown [10.44.48.27]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D21DB30002D3; Tue, 1 Dec 2026 10:52:39 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Oguzhan KAYNAK , qemu-stable@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 7/7] vfio-user: block migration Date: Tue, 1 Dec 2026 11:52:24 +0100 Message-ID: <20261201105224.175168-8-clg@redhat.com> In-Reply-To: <20261201105224.175168-1-clg@redhat.com> References: <20261201105224.175168-1-clg@redhat.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-20.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Oguzhan KAYNAK vfio-user devices lack a migration blocker, so migration can complete successfully without transferring device state. The destination VM is left with an unconfigured device, for example with its BARs unassigned, and -only-migratable does not reject such a device. Block migration until vfio-user migration support is implemented. Block all migration modes because vfio-user does not support CPR either. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/5002 Cc: qemu-stable@nongnu.org Signed-off-by: Oguzhan KAYNAK Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/20261127165922.66105-1-kaynak.oguzhan0@gmail.com Signed-off-by: Cédric Le Goater --- hw/vfio-user/pci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index e3749cdd3939..d3ae2c150a1d 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -11,6 +11,7 @@ #include "qapi/qapi-type-infos-sockets.h" #include "qapi-visit-sockets.h" #include "qemu/error-report.h" +#include "migration/blocker.h" #include "hw/core/qdev-properties.h" #include "hw/vfio/pci.h" @@ -284,6 +285,13 @@ static void vfio_user_pci_realize(PCIDevice *pdev, Error **errp) return; } vbasedev->proxy = proxy; + + error_setg(&vbasedev->migration_blocker, + "%s: migration is not supported", vbasedev->name); + if (migrate_add_blocker(&vbasedev->migration_blocker, errp) < 0) { + goto error; + } + vfio_user_set_handler(vbasedev, vfio_user_pci_process_req, vdev); if (udev->send_queued) { @@ -358,6 +366,7 @@ out_teardown: vfio_pci_teardown_msi(vdev); vfio_pci_bars_exit(vdev); error: + migrate_del_blocker(&vbasedev->migration_blocker); error_prepend(errp, VFIO_MSG_PREFIX, vdev->vbasedev.name); vfio_pci_put_device(vdev); } -- 2.56.1