From nobody Mon Feb 9 21:19:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1658384483; cv=none; d=zohomail.com; s=zohoarc; b=cWlSLjJ8u2AzTMBagllXp7CFcMNEhlshtVml/9R9JAm4PumETDF6gIaaex7J9M8OBLsB2IThxU4WdQQONHpYN661vkayyxB46HR+UB8h93bt3rLT5doM+j01sWMmOjTkLlIElO4+25B4iM25L80C/xeABNlq0OWq0XaAChC8bCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658384483; 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=vKyBuIIzrEEz5DW1RjiopEu8z74J7wa0nK1K05fXNS8=; b=MmtDh+H9y4Qukh8vxic4zbs9NRN05J5kItFFm8AAwz2LNGdK+85nBYT1aHnSvuiXKrWI77VIoRaqySB88hDkKth6MqlRmkkgj+mTCk1DF4z/oTekdngqkGp3UQYxRvf5HAvz9EorBNgbXbLApvuXck3L959Y3pwvQD/S0VlPyB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 16583844835411002.5938608210049; Wed, 20 Jul 2022 23:21:23 -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-623-D7yGFLcDNceFqeK20YqZpg-1; Thu, 21 Jul 2022 02:21:18 -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 036B0806012; Thu, 21 Jul 2022 06:21:16 +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 A2143401E7B; Thu, 21 Jul 2022 06:21:14 +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 5EE691947051; Thu, 21 Jul 2022 06:21:14 +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 BD4F21947051 for ; Thu, 21 Jul 2022 06:21:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AD8F090A00; Thu, 21 Jul 2022 06:21:13 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 945E118ECB; Thu, 21 Jul 2022 06:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658384481; 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=vKyBuIIzrEEz5DW1RjiopEu8z74J7wa0nK1K05fXNS8=; b=THYBna/7uvN/tj+IKOcsVUvQgin2vaJG4qo5blhJO2UlEm7W7XHdg58V52B9e8aVolpvVv eTroRCJWUV5SLusaWLtjHdA81c0nekVur0Ifbxw3lc+x1h9n7nKYZWLP5GDcO4HQ726hGZ OWnilLvqoHvuARolfdOP5uojYoAmzcY= X-MC-Unique: D7yGFLcDNceFqeK20YqZpg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: don't try to query QEMU about migration blockers during offline migration Date: Thu, 21 Jul 2022 02:21:12 -0400 Message-Id: <20220721062113.254515-2-laine@redhat.com> In-Reply-To: <20220721062113.254515-1-laine@redhat.com> References: <20220721062113.254515-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 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: Eugenio Perez Martin Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: 1658384484986100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The new code that queries QEMU about migration blockers was put at the top of qemuMigrationSrcIsAllowed(), but that function can also be called in the case of offline migration (ie when the domain is inactive / QEMU isn't running). This check should have been put inside the "if (!(flags & VIR_MIGRATE_OFFLINE))" conditional, so let's move it there. Fixes: 156e99f686690855be4e45d9b8b3194191a8bc31 Signed-off-by: Laine Stump --- src/qemu/qemu_migration.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5d1e5f987b..6fc5791f61 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1455,22 +1455,6 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver, int nsnapshots; int pauseReason; size_t i; - bool blockedReasonsCap =3D virQEMUCapsGet(priv->qemuCaps, - QEMU_CAPS_MIGRATION_BLOCKED_RE= ASONS); - - /* Ask qemu if it have a migration blocker */ - if (blockedReasonsCap) { - g_auto(GStrv) blockers =3D NULL; - if (qemuDomainGetMigrationBlockers(driver, vm, &blockers) < 0) - return false; - - if (blockers && blockers[0]) { - g_autofree char *reasons =3D g_strjoinv("; ", blockers); - virReportError(VIR_ERR_OPERATION_INVALID, - _("cannot migrate domain: %s"), reasons); - return false; - } - } =20 /* perform these checks only when migrating to remote hosts */ if (remote) { @@ -1488,6 +1472,24 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver, =20 /* following checks don't make sense for offline migration */ if (!(flags & VIR_MIGRATE_OFFLINE)) { + bool blockedReasonsCap =3D virQEMUCapsGet(priv->qemuCaps, + QEMU_CAPS_MIGRATION_BLOCKE= D_REASONS); + + /* Ask qemu if it has a migration blocker */ + if (blockedReasonsCap) { + g_auto(GStrv) blockers =3D NULL; + + if (qemuDomainGetMigrationBlockers(driver, vm, &blockers) < 0) + return false; + + if (blockers && blockers[0]) { + g_autofree char *reasons =3D g_strjoinv("; ", blockers); + virReportError(VIR_ERR_OPERATION_INVALID, + _("cannot migrate domain: %s"), reasons); + return false; + } + } + if (remote) { /* cancel migration if disk I/O error is emitted while migrati= ng */ if (flags & VIR_MIGRATE_ABORT_ON_ERROR && --=20 2.35.3