From nobody Tue May 7 03:24:09 2024 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=1658408761; cv=none; d=zohomail.com; s=zohoarc; b=nbApXpxuDDKQJaXEv0zhTMRldr6fon14wuW4o9gTwM07QAvbwo3gastC/4bwfAvlWvJl06zkMu2PeAEI6dUAXcZcCcB+1mthXqNz0xsY97zrfH8dvb77uoK3nwJ1BA3bvdT7k2mYFVivcaY/H/RxBIu00y6Zq3leHbkQeQxXp8w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658408761; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=tzgGRend98NL25XdR3QstVb/iwfHpJFHvmhHSzMRivo=; b=YD5R0SUnpShKTW/+sesowaTKwRNiNKt+X1tZ2l27984chTQemV/9WLuSYIpBOFsl7BHL9A8wgXtqqJtUhU41Q6M4aCZWVzukXE/tizy1ANpHgZWLFv7UosjHhS9SOVh5/UofhgHLYkzkprec9IdbJI31Xxbfox20d4ZUbYIAcRs= 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 1658408761903317.2701835584912; Thu, 21 Jul 2022 06:06:01 -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-589-9IRnwWuEPDSJlvF9nFZNnw-1; Thu, 21 Jul 2022 09:05:56 -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 023613C0E21E; Thu, 21 Jul 2022 13:05:54 +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 9AA002166B26; Thu, 21 Jul 2022 13:05:53 +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 4E2E91947049; Thu, 21 Jul 2022 13:05:53 +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 EB99A1947043 for ; Thu, 21 Jul 2022 13:05:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C021F2026985; Thu, 21 Jul 2022 13:05:51 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A195D2026D64 for ; Thu, 21 Jul 2022 13:05:51 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 997252405AC; Thu, 21 Jul 2022 15:05:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658408760; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=tzgGRend98NL25XdR3QstVb/iwfHpJFHvmhHSzMRivo=; b=haTh4OEvJdLZn4VZeB5EC4pskKBBOHumJUN7jEyRIaYQs1eFYgFqTsKB8fQ763EoOJ0x55 KCRzADQihQOObLa7uv+WKr1lngkY67A3pJkMvHHRcelI6ZScUAeBGb6dmWecHw4ajUhtXr yulA//CdzxNw/97+/qsjaofJv1WGNKQ= X-MC-Unique: 9IRnwWuEPDSJlvF9nFZNnw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu_migration: Use EnterMonitorAsync in qemuDomainGetMigrationBlockers Date: Thu, 21 Jul 2022 15:05:49 +0200 Message-Id: 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: , 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: 1658408764832100001 Content-Type: text/plain; charset="utf-8" The code is run with an async job and thus needs to make sure a nested job is acquired before entering the monitor. While touching the code in qemuMigrationSrcIsAllowed I also fixed the grammar which was accidentally broken by v8.5.0-140-g2103807e33. Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 5d1e5f987b..d83db3a824 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1418,12 +1418,15 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef= *def) static int qemuDomainGetMigrationBlockers(virQEMUDriver *driver, virDomainObj *vm, + int asyncJob, char ***blockers) { qemuDomainObjPrivate *priv =3D vm->privateData; int rc; =20 - qemuDomainObjEnterMonitor(driver, vm); + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + return -1; + rc =3D qemuMonitorGetMigrationBlockers(priv->mon, blockers); qemuDomainObjExitMonitor(vm); =20 @@ -1458,10 +1461,12 @@ qemuMigrationSrcIsAllowed(virQEMUDriver *driver, bool blockedReasonsCap =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_BLOCKED_RE= ASONS); =20 - /* Ask qemu if it have a migration blocker */ + /* Ask qemu if it has a migration blocker */ if (blockedReasonsCap) { g_auto(GStrv) blockers =3D NULL; - if (qemuDomainGetMigrationBlockers(driver, vm, &blockers) < 0) + if (qemuDomainGetMigrationBlockers(driver, vm, + VIR_ASYNC_JOB_MIGRATION_OUT, + &blockers) < 0) return false; =20 if (blockers && blockers[0]) { --=20 2.35.1