From nobody Tue May 7 10:35:12 2024 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=1658940839; cv=none; d=zohomail.com; s=zohoarc; b=AtrkFPVDDbVjTT8ME4NTQyy4m/E+o/ToscEcg8hSFamuNUCrSkw1UJbuOicqRRGAut3Frxq0yz1KgJ1nMuRekf1ebd0RIJkPj9No0J3IByY+dc76hnFEqXVBMDc2euZp0KBzWRw8aKqFujIZmAPOHj1q2PqPHYMMHt04r24gjEQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658940839; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=8sSxhX2P1DQYpgyimJOYC8NgKkGPMS5bvLvDiMJ+5qI=; b=jRpmFnCY1bHyBUEIiRTgIS5TRtOpCUEBg09a8Nk17z4RZu2mJeKG2rFSmUM96O5bAUCea1Tv6Y3JgoBt9BgGFeJYSkgkBFH2wL6CF8PHFqfIBkRmnECoZ5W0lHYe+yYb6m6u9lkG7L2nsQNRpehD+8159XizpMViIp8avVOSKLI= 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 1658940839617649.1446213653581; Wed, 27 Jul 2022 09:53:59 -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-546-lMiBW-uyMHSwDD3JQabAzQ-1; Wed, 27 Jul 2022 12:53:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 27759802D2C; Wed, 27 Jul 2022 16:53:51 +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 18A882166B26; Wed, 27 Jul 2022 16:53:48 +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 BB64C1945DAC; Wed, 27 Jul 2022 16:53:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E09121945DA2 for ; Wed, 27 Jul 2022 16:28:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B9A1140315E; Wed, 27 Jul 2022 16:28:24 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.17.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9ED06492C3B; Wed, 27 Jul 2022 16:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658940838; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=8sSxhX2P1DQYpgyimJOYC8NgKkGPMS5bvLvDiMJ+5qI=; b=fxKgZzZplVbvqTT3Sqx6naBsO+Vxy30rN8IK8G3OCjQ6hHQIxw89MMbdgxqRYInrX1s5ma gIiPX7VOWoGws05+H3WdyX3UlqFiSmZSfsXTmZGAamq64fZZgN7YD/89mHyPtERbpuQ/xd BjFWSOqfdDRSrzty7a+M+w+H0YXthRw= X-MC-Unique: lMiBW-uyMHSwDD3JQabAzQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH] qemu: don't call qemuMigrationSrcIsAllowedHostdev() from qemuMigrationDstPrepareFresh() Date: Wed, 27 Jul 2022 12:28:23 -0400 Message-Id: <20220727162823.277305-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: Jiri Denemark Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1658940840427100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This call to qemuMigrationSrcIsAllowedHostdev() (which does a hardcoded fail of the migration if there is any PCI or mdev hostdev device in the domain) while doing the destination side of migration prep was found once the call to that same function was removed from the source side migration prep (commit 25883cd5). According to jdenemar, for the V2 migration protocol, prep of the destination is the first step, so this *was* the proper place to do the check, but for V3 migration this is in a way redundant (since we will have already done the check on the source side (updated by 25883cd5 to query QEMU rather than do a hardcoded fail)). Of course it's possible that the source could support migration of a particular VFIO device, but the destination doesn't. But the current check on the destination side is worthless even in that case, since it is just *always* failing rather than querying QEMU; and QEMU can't be queried at the point where the destination check is happening, since it isn't yet running. Anyway QEMU should complain when it's started if it's going to fail, so removing this check should just move the failure to happen a bit later. So the best solution to this problem is to simply remove the hardcoded check/fail from qemuMigrationDstPrepareFresh() and rely on QEMU to fail if it needs to. Fixes: 25883cd5f0b188f2417f294b7d219a77b219f7c2 Signed-off-by: Laine Stump Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 20dc91f1ce..85b6b12f92 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -3379,9 +3379,6 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver, QEMU_MIGRATION_COOKIE_CAPS; } =20 - if (!qemuMigrationSrcIsAllowedHostdev(*def)) - goto cleanup; - /* Let migration hook filter domain XML */ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { g_autofree char *xml =3D NULL; --=20 2.35.3