From nobody Sun Feb 8 07:08:02 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=1658320013; cv=none; d=zohomail.com; s=zohoarc; b=WadN1UfjnMN05ILb/Tk8+09XciVlg7z7nJ9uNwNCDTkKfzgudCI9AVKwn+miHxZGYFTFfGFibpm7dTpqE5sqmJOTkVEqfkobXSrA+vbxlTJAxG+M/Nc6joabXdjf8Dvpd3U0p9Zx9nAHefq95esi7o0V7xhX7pqJjaq32Tg5Nts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658320013; 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=QdDHr0Ak+npuhOVSIjtbTqmrWANAGVMpToc1jRSemaY=; b=e6GgBDMGBQtfhgHNUWxOm7ewur+nE1LQPwPyZGFeGv1Hx6FGr4CcXJHk7Fkjq08j96UMDi2+Qko7M8SZkNN0gKqcbsIAURpddSvWX7uZVwiKde6b6fMMXjNospB5asyV3TG92Lfp2qOUPI/ItTZdvoe12TU0/r8utQdrz5eG2ws= 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 1658320013921984.7138599699789; Wed, 20 Jul 2022 05:26:53 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-oqkoBy23MO2rKmMdYJkBZw-1; Wed, 20 Jul 2022 08:26:50 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B5C913804069; Wed, 20 Jul 2022 12:26:48 +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 C120840CF8ED; Wed, 20 Jul 2022 12:26:46 +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 84F07194706C; Wed, 20 Jul 2022 12:26:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 599A11947066 for ; Wed, 20 Jul 2022 12:16:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 49E45112131B; Wed, 20 Jul 2022 12:16:07 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23D781121314; Wed, 20 Jul 2022 12:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658320012; 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=QdDHr0Ak+npuhOVSIjtbTqmrWANAGVMpToc1jRSemaY=; b=K1qUlEEaM94Dm0GfYPq4ZCMLgbjM/TxS1SfqO/mBa+ThqLNQmJG60OZOAynVBkrkybG9UC nwqTwA754v8crHYg9DFVvxs+NS8MUIkqhMQCbSjO14IKeFFeCleNBhg8unNzB1gvCnXxrj T31eTRC1lIPGLP0DIEDmblE6vkB0Q30= X-MC-Unique: oqkoBy23MO2rKmMdYJkBZw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: libvir-list@redhat.com Subject: [libvirt PATCH v3 4/4] qemu_migration: Do not forbid vDPA devices if can query blockers Date: Wed, 20 Jul 2022 14:15:58 +0200 Message-Id: <20220720121558.3150209-5-eperezma@redhat.com> In-Reply-To: <20220720121558.3150209-1-eperezma@redhat.com> References: <20220720121558.3150209-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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 , Jason Wang , Laine Stump , Jiri Denemark , Jaroslav Suchanek Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658320014788100003 vDPA devices will be migratable soon. Since they are not migratable before qemu 6.0, and qemu pre-6.0 didn't have the capability of asking for migration blockers, let it hardcoded in that case. Otherwise, ask qemu about the explicit blocker. Signed-off-by: Eugenio P=C3=A9rez Reviewed-by: Jiri Denemark --- v3: Fix indentation --- src/qemu/qemu_migration.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 6ac4ef150b..45e16242f0 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1454,9 +1454,11 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver, int pauseReason; size_t i; int r; + bool blockedReasonsCap =3D virQEMUCapsGet(priv->qemuCaps, + QEMU_CAPS_MIGRATION_BLOCKED_RE= ASONS); =20 /* Ask qemu if it have a migration blocker */ - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_BLOCKED_REASONS= )) { + if (blockedReasonsCap) { g_auto(GStrv) blockers =3D NULL; r =3D qemuDomainGetMigrationBlockers(driver, vm, &blockers); if (r !=3D 0) { @@ -1467,7 +1469,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver, } =20 if (blockers && blockers[0]) { - g_autofree char *reasons =3D g_strjoinv(", ", blockers); + g_autofree char *reasons =3D g_strjoinv("; ", blockers); virReportError(VIR_ERR_OPERATION_INVALID, _("cannot migrate domain: %s"), reasons); return false; @@ -1580,7 +1582,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver, virDomainNetDef *net =3D vm->def->nets[i]; qemuSlirp *slirp; =20 - if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_VDPA) { + if (!blockedReasonsCap && net->type =3D=3D VIR_DOMAIN_NET_TYPE= _VDPA) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("vDPA devices cannot be migrated")); return false; --=20 2.31.1