From nobody Sat Jan 4 23:43:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1734523626300159.4373451265859; Wed, 18 Dec 2024 04:07:06 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3ECE915FC; Wed, 18 Dec 2024 07:07:05 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EF1181544; Wed, 18 Dec 2024 07:05:55 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3A701153B; Wed, 18 Dec 2024 07:05:51 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id ADF0E1539 for ; Wed, 18 Dec 2024 07:05:50 -0500 (EST) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-y98cqBq5MjCzEER-1A3orw-1; Wed, 18 Dec 2024 07:05:49 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 55B971955D62 for ; Wed, 18 Dec 2024 12:05:46 +0000 (UTC) Received: from orkuz (unknown [10.43.3.115]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D19DA300F9B9 for ; Wed, 18 Dec 2024 12:05:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734523550; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=kPEG1HF44prkPYjEYx5GHQti4xa0JK4GZvwtFsYm40g=; b=Pd0rNZ+PL93NWfqHH6HE0il8K4ZHDUxN5ZK+yJYjbTVSgxFtCz9iOXWetgDUHNF4z1Qnhb Ml80ZXhrVGt6LC2cJe8ZLHMbhIyLeG+VOHviLYJsNDdabkqvyeHbHgzjHCPphHcmwrUZas 4J8iiEWCslMoHze9Ur1cYbVB7a7hrbg= X-MC-Unique: y98cqBq5MjCzEER-1A3orw-1 X-Mimecast-MFC-AGG-ID: y98cqBq5MjCzEER-1A3orw From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH 2/3] qemu: Replace qemuDomainCheckMonitor with qemuMigrationJobCheckStatus Date: Wed, 18 Dec 2024 13:05:37 +0100 Message-ID: <669e3588187a90d20e90eef2f301bb9dd380bbe0.1734523378.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DwYWHysGDlROmxim0snWPGxwEWMLTQV7pjBxt_TMwDA_1734523548 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FRJMN3TFYIERHLS22TETUOAJYIQRI25F X-Message-ID-Hash: FRJMN3TFYIERHLS22TETUOAJYIQRI25F X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1734523626517116600 Content-Type: text/plain; charset="utf-8" The function is only used during incoming migration in the beginning of Finish phase to detect if QEMU already died but EOF handler haven't had a chance to do its job yet. It calls query-status QMP command, but ignores the result. By calling query-migrate instead we can achieve the same functionality if QEMU is dead and even get meaningful error from "error-desc" in case the incoming migration failed and QEMU is still running. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 18 ------------------ src/qemu/qemu_domain.h | 3 --- src/qemu/qemu_migration.c | 7 ++++--- src/qemu/qemu_monitor.c | 8 -------- src/qemu/qemu_monitor.h | 1 - 5 files changed, 4 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3366346624..f15ba58179 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9007,24 +9007,6 @@ qemuDomainVcpuPersistOrder(virDomainDef *def) } =20 =20 -int -qemuDomainCheckMonitor(virDomainObj *vm, - virDomainAsyncJob asyncJob) -{ - qemuDomainObjPrivate *priv =3D vm->privateData; - int ret; - - if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) - return -1; - - ret =3D qemuMonitorCheck(priv->mon); - - qemuDomainObjExitMonitor(vm); - - return ret; -} - - bool qemuDomainSupportsVideoVga(const virDomainVideoDef *video, virQEMUCaps *qemuCaps) diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index e810f79599..86e24ad54b 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -968,9 +968,6 @@ bool qemuDomainVcpuHotplugIsInOrder(virDomainDef *def) void qemuDomainVcpuPersistOrder(virDomainDef *def) ATTRIBUTE_NONNULL(1); =20 -int qemuDomainCheckMonitor(virDomainObj *vm, - virDomainAsyncJob asyncJob); - bool qemuDomainSupportsVideoVga(const virDomainVideoDef *video, virQEMUCaps *qemuCaps); =20 diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 26a92d8ee2..f9f40a2b03 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -6850,10 +6850,11 @@ qemuMigrationDstFinishActive(virQEMUDriver *driver, goto error; =20 if (retcode !=3D 0) { - /* Check for a possible error on the monitor in case Finish was ca= lled - * earlier than monitor EOF handler got a chance to process the er= ror + /* Checking the migration status will read the migration error if + * set and QEMU is still alive. If the process died and EOF handler + * was not run yet, the appropriate monitor error will be set. */ - qemuDomainCheckMonitor(vm, VIR_ASYNC_JOB_MIGRATION_IN); + qemuMigrationJobCheckStatus(vm, VIR_ASYNC_JOB_MIGRATION_IN); goto error; } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index df7e0d8997..c198ddb625 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1430,14 +1430,6 @@ qemuMonitorStopCPUs(qemuMonitor *mon) } =20 =20 -int -qemuMonitorCheck(qemuMonitor *mon) -{ - bool running; - return qemuMonitorGetStatus(mon, &running, NULL); -} - - int qemuMonitorGetStatus(qemuMonitor *mon, bool *running, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index d4d9b98ba7..ac3a7b6db3 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -558,7 +558,6 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorVMStatus); int qemuMonitorVMStatusToPausedReason(const char *status); =20 -int qemuMonitorCheck(qemuMonitor *mon); int qemuMonitorGetStatus(qemuMonitor *mon, bool *running, virDomainPausedReason *reason) --=20 2.47.1