From nobody Mon Feb 9 02:13:19 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=1658308392; cv=none; d=zohomail.com; s=zohoarc; b=TT0LiFwSifBoN+vImLwuFZqXC2Mhw4MaP/Q32jLfEnHpeESpTmvlRlANfAlfjGOhX+8ci1EJy3ewY188LxFnHtP5DCA9h0TLBlE7R1EnNs8p0Ysmd90LBTW4rwhjwOf5R7t1wfefUoxb92InJjqd+tn0cRabCXSzJVooTz8DshE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658308392; 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=5AECYN4nrfsa5j5uBNk04zLXxJgaYFPsOFLouI1xxe4=; b=YyJglRdVNZcrRC2cJzJxi9T2KnU0RS/Ahjbu1Qmxtf5cVDFvZlOhreoE5zZEejHXZjBnH8+8VjIv0mW4vqd/tz09DILgqX/FCiIA45srutG6zM8LpDP2QYylPTlM2D+AEJqKAVPbM+QU355N6o8x7S81IaGJLjqXugDccSCjNJ0= 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 1658308392368703.5515621655711; Wed, 20 Jul 2022 02:13:12 -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-646-YnsdgO3pMBqtNfurZ6ul3g-1; Wed, 20 Jul 2022 05:12:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B77718001EA; Wed, 20 Jul 2022 09:12:07 +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 A489290A11; Wed, 20 Jul 2022 09:12:07 +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 56B8A1947068; Wed, 20 Jul 2022 09:12:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ECFAB194707F for ; Wed, 20 Jul 2022 09:12:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DE7DE2026614; Wed, 20 Jul 2022 09:12:04 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4F6F2026D64; Wed, 20 Jul 2022 09:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658308391; 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=5AECYN4nrfsa5j5uBNk04zLXxJgaYFPsOFLouI1xxe4=; b=bJAmXt5dpejZxNj20nahHy5bgUdVKvsN4yKDkL0Ewz8jQ3zMey61a7GZNff3FuB1vJ4W1D ezcC7KAeNIPGoA622xDxKSUJlulchJv+PDufWTiHJpmdG+ZkIhhzb5oaNUBqjC5qTsEjbt R7dVy5HfPFmRcjuNVZOp7ygColH0XVA= X-MC-Unique: YnsdgO3pMBqtNfurZ6ul3g-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 v2 5/5] qemu_migrate: Do not forbif vDPA devices if can query blockers Date: Wed, 20 Jul 2022 11:11:54 +0200 Message-Id: <20220720091154.3135061-6-eperezma@redhat.com> In-Reply-To: <20220720091154.3135061-1-eperezma@redhat.com> References: <20220720091154.3135061-1-eperezma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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 , Jiri Denemark , Jaroslav Suchanek Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: 1658308393178100001 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 --- src/qemu/qemu_migration.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4224339f39..2f5c1d8121 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_REAS= ONS); =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) { @@ -1579,7 +1581,8 @@ 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