From nobody Tue Dec 16 11:08:40 2025 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=1673027596; cv=none; d=zohomail.com; s=zohoarc; b=W494pExY8S2RHV1+wGxwIz/ef8VPTPDRb3pzWlqOEvlwcbu36A1aDnMb18D5ixk9GD/yHL7WS9JrD4dW+6iQ0RQ4V0fv8oNLjsdLeT1MaCNXuW9G6qdyzv4TiKLElZ9GQ0VZtkUtWo6Mf1xPfG+Efpy4aZvrOUXLztJD6LKVdZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673027596; h=Content-Type:Content-Transfer-Encoding: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=93PFEPbei97oAHMj59QFPbLRfX87smO5C0k1qu7pUmg=; b=hzHGXynHXReSTy38dYWPD8QOD4PAJCWhwb9OWUSUWtBfiEJYcW3gLX0jddVXgQ4vkjQ//rSi2XUuGd/GCRtftR0JsbX4haDe/TSgr+I7LVxke9P/GDO93an9duMi+kzaNygin1lGxX7O4ERWwSFDvFfj209hOOZTUCdDf898vx4= 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 167302759623618.07479661722175; Fri, 6 Jan 2023 09:53:16 -0800 (PST) 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-484-B_GRkSvXPTi_a51s44DEwQ-1; Fri, 06 Jan 2023 12:52:30 -0500 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 6C89C3C0ED44; Fri, 6 Jan 2023 17:52:25 +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 3FA5940C200B; Fri, 6 Jan 2023 17:52:25 +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 325EE19459D1; Fri, 6 Jan 2023 17:52:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0FFFB1947077 for ; Fri, 6 Jan 2023 17:52:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0484E40C200A; Fri, 6 Jan 2023 17:52:22 +0000 (UTC) Received: from antique-work.redhat.com (ovpn-193-172.brq.redhat.com [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9465C40C2064 for ; Fri, 6 Jan 2023 17:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673027594; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=93PFEPbei97oAHMj59QFPbLRfX87smO5C0k1qu7pUmg=; b=dLUERbJyP+hdFW2BSHx62cAzIaEFYj+aKqswtTQY2x2PcdCD3vIy00J8puvSErLN4FzOKd PPYoM9+6qhuHAWAefc9OEhJT6/fRwhiEzfhqpc6mRymaItFV5R5dFzLV4MlQmtsJ7CR3EG bPW9EWSkRdJM3Jec5+JEoOHEQNW2Rro= X-MC-Unique: B_GRkSvXPTi_a51s44DEwQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH v3 11/32] qemu_blockjob: process QEMU_MONITOR_JOB_STATUS_PENDING signal Date: Fri, 6 Jan 2023 18:51:46 +0100 Message-Id: <23fde2d52ae4970da7c80019c03391bc7b6e18f1.1673027206.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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 3.1 on 10.11.54.1 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: 1673027597326100003 Content-Type: text/plain; charset="utf-8"; x-default="true" QEMU emits this signal when the job finished its work and is about to be finalized. If the job is started with autofinalize disabled the job waits for user input to finalize the job. This will be used by snapshot delete code. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_backup.c | 1 + src/qemu/qemu_blockjob.c | 21 ++++++++++++++++++++- src/qemu/qemu_blockjob.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index c7721812a5..6a5aacd9f6 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -1035,6 +1035,7 @@ qemuBackupNotifyBlockjobEnd(virDomainObj *vm, case QEMU_BLOCKJOB_STATE_NEW: case QEMU_BLOCKJOB_STATE_RUNNING: case QEMU_BLOCKJOB_STATE_ABORTING: + case QEMU_BLOCKJOB_STATE_PENDING: case QEMU_BLOCKJOB_STATE_PIVOTING: case QEMU_BLOCKJOB_STATE_LAST: default: diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index a7aa7b3940..cb2d05d71d 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -55,6 +55,7 @@ VIR_ENUM_IMPL(qemuBlockjobState, "running", "concluded", "aborting", + "pending", "pivoting"); =20 VIR_ENUM_IMPL(qemuBlockjob, @@ -531,6 +532,8 @@ qemuBlockJobRefreshJobs(virDomainObj *vm) if (job->state =3D=3D QEMU_BLOCKJOB_STATE_NEW || job->state =3D=3D QEMU_BLOCKJOB_STATE_RUNNING) job->newstate =3D newstate; + } else if (newstate =3D=3D QEMU_BLOCKJOB_STATE_PENDING) { + job->newstate =3D newstate; } /* don't update the job otherwise */ } @@ -1563,6 +1566,19 @@ qemuBlockJobEventProcess(virQEMUDriver *driver, job->newstate =3D -1; break; =20 + case QEMU_BLOCKJOB_STATE_PENDING: + /* Similarly as for 'ready' state we should handle it only when + * previous state was 'new' or 'running' as there are other cases + * when it can be emitted by QEMU. Currently we need this only when + * deleting non-active external snapshots. */ + if (job->state =3D=3D QEMU_BLOCKJOB_STATE_NEW || + job->state =3D=3D QEMU_BLOCKJOB_STATE_RUNNING) { + job->state =3D job->newstate; + qemuDomainSaveStatus(vm); + } + job->newstate =3D -1; + break; + case QEMU_BLOCKJOB_STATE_NEW: case QEMU_BLOCKJOB_STATE_RUNNING: case QEMU_BLOCKJOB_STATE_LAST: @@ -1684,13 +1700,16 @@ qemuBlockjobConvertMonitorStatus(int monitorstatus) ret =3D QEMU_BLOCKJOB_STATE_CONCLUDED; break; =20 + case QEMU_MONITOR_JOB_STATUS_PENDING: + ret =3D QEMU_BLOCKJOB_STATE_PENDING; + break; + case QEMU_MONITOR_JOB_STATUS_UNKNOWN: case QEMU_MONITOR_JOB_STATUS_CREATED: case QEMU_MONITOR_JOB_STATUS_RUNNING: case QEMU_MONITOR_JOB_STATUS_PAUSED: case QEMU_MONITOR_JOB_STATUS_STANDBY: case QEMU_MONITOR_JOB_STATUS_WAITING: - case QEMU_MONITOR_JOB_STATUS_PENDING: case QEMU_MONITOR_JOB_STATUS_ABORTING: case QEMU_MONITOR_JOB_STATUS_UNDEFINED: case QEMU_MONITOR_JOB_STATUS_NULL: diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 741d8df6c5..e9b283da20 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -41,6 +41,7 @@ typedef enum { QEMU_BLOCKJOB_STATE_CONCLUDED, /* job has finished, but it's unknown whether it has failed or not */ QEMU_BLOCKJOB_STATE_ABORTING, + QEMU_BLOCKJOB_STATE_PENDING, QEMU_BLOCKJOB_STATE_PIVOTING, QEMU_BLOCKJOB_STATE_LAST } qemuBlockjobState; --=20 2.39.0