From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1574781471; cv=none; d=zohomail.com; s=zohoarc; b=Udd3SmckRPtzVilv8Y3AZ4Fcf6KEiAaA0mwWhy/QZxmY/R7AiqjbN72LloY17pBw8/SekXAroHylSVNQE2yLoOnjNKIrAipgoP2hE9SusIQywr3ySi5Hew9kzEUGNo6UMAZzhDIcNIcPQcr2OjG6gcXCv+gXTYF6JWbH68XxycE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781471; 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=r6W3MjZqIUvI94WOCQhBMl9zyinxNlGYEIIdbDcnafo=; b=kYFc1LrIDQZgNt956Dp+BlXmZvDgRVUCom2RoHZxuhxtA2cl6xYvKK/DXbim8n0LrslNAryT5rR1d8+346tE7SyKiqLtfCdtRNHqVUlWa6IZMDN64omc+bGfHDZFnQNmsPYXaJPXmhxvD/AAuYaXnJ0DtER/bUVdvp+0yrJv1wg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1574781470999488.80502666785173; Tue, 26 Nov 2019 07:17:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-Eg9EF2HwNKGMIWfHYgck3A-1; Tue, 26 Nov 2019 10:17:47 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8FDC8024FA; Tue, 26 Nov 2019 15:17:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9ED4E5C28C; Tue, 26 Nov 2019 15:17:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 540734BB78; Tue, 26 Nov 2019 15:17:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHcf4011785 for ; Tue, 26 Nov 2019 10:17:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id E946760BE2; Tue, 26 Nov 2019 15:17:38 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7122F60BEC for ; Tue, 26 Nov 2019 15:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781469; 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=r6W3MjZqIUvI94WOCQhBMl9zyinxNlGYEIIdbDcnafo=; b=f6Ap6JhVNHfZd7LnTIouKKhKfVt/ASCrCNnWVUml72MY3LdFr+BqBmTN0XrUxUUJ3cQEtT Yg/BRj8gYbP2ow2OgzVlSqCs0R+QcUSVPpeGw2n5q3sMjY2rO8of2rg7KaSKf7fCU34W+u kFiQEU135jIOhUhRKE1ky7IlT6SwuPk= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:25 +0100 Message-Id: <71203b53945cb7e287da260f40b4ffb7f1b9b729.1574781325.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/10] qemu: monitor: Finish implementation of infrastructure for 'query-jobs' X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: Eg9EF2HwNKGMIWfHYgck3A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Commit ed56851f1bc6f5 didn't wire up fetching of the statistics for the job which are reported by 'query-jobs'. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_monitor.h | 4 ++-- src/qemu/qemu_monitor_json.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index a17d7200c2..e2bfc420bb 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -154,8 +154,8 @@ struct _qemuMonitorJobInfo { qemuMonitorJobType type; qemuMonitorJobStatus status; char *error; - long long progressCurrent; - long long progressTotal; + unsigned long long progressCurrent; + unsigned long long progressTotal; }; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 4d38030179..9f3783ab70 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -9221,6 +9221,12 @@ qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data) job->id =3D g_strdup(id); job->error =3D g_strdup(errmsg); + /* failure to fetch progress stats is not fatal */ + ignore_value(virJSONValueObjectGetNumberUlong(data, "current-progress", + &job->progressCurrent)); + ignore_value(virJSONValueObjectGetNumberUlong(data, "total-progress", + &job->progressTotal)); + return g_steal_pointer(&job); } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1574781498; cv=none; d=zohomail.com; s=zohoarc; b=MRmgxRcXPh/bFMZHdpKs6Bsv2ersWfJ7rmq+UVt8+iPjmWcbSSxL+2EmJ1fSPSKlAcI+lNP7cj6ZCKWu3e5cwqmIYO61XRokfbFf8A/av1NU7w4NJzwgTKmmX1QpvATgJuHFXnxuOPzD7jnkJX1eoZrdJDkk9c4myV2H395dVQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781498; 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=ft4rRbFSmX0i6Zx11BUqmpVyLHmzYbaX/0lEtC0WVlQ=; b=HF5I61sp8cjTiRo5xGwJWNHXHIpM04ayl2bdTVR9zP7NP5YEDHT0jCtkLY/rGKWExVObqmXk6TC8XIt/mG68ZbUAu2pHkndE6D11TzQfzW5ckfwt7654M40mvhBoOyEMEoWxMJHqVGokAwEhqliBe+v5MO4emqAZXc2fc3NRpVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15747814981211018.8080247300236; Tue, 26 Nov 2019 07:18:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-mrCpZpI8NxOOCpnddKst4w-1; Tue, 26 Nov 2019 10:18:10 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8642F1007286; Tue, 26 Nov 2019 15:18:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A50B1000328; Tue, 26 Nov 2019 15:18:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 150064E562; Tue, 26 Nov 2019 15:18:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHfoc011805 for ; Tue, 26 Nov 2019 10:17:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id C683E60C80; Tue, 26 Nov 2019 15:17:41 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C00160BE2 for ; Tue, 26 Nov 2019 15:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781496; 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=ft4rRbFSmX0i6Zx11BUqmpVyLHmzYbaX/0lEtC0WVlQ=; b=YSQKApyu6dlBTxUfAoBozDJjQXea98ml+3osSGMhLsleFzKw8lnfcYk8NeEhP1iw4MlTHw rmzp85ka7v4ErdUtPkIJ1vVHQhESFg5E76zzdNqifLc4fDzWtBethRKg+UcsACltITGZ8C lcE0sdqhQ8vNlVCSCxa93mR/x7DgG+c= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:26 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/10] qemu: blockjob: Properly propagate cancellation of blockjobs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: mrCpZpI8NxOOCpnddKst4w-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" qemu returns an error message in the job statistics even if the job was cancelled to emphasize it was not successful. Libvirt didn't properly transform it into QEMU_BLOCKJOB_STATE_CANCELLED though. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 92e4d391c9..2283d49c61 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1313,7 +1313,8 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr= job, if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) goto cleanup; - if (job->newstate =3D=3D QEMU_BLOCKJOB_STATE_COMPLETED && + if ((job->newstate =3D=3D QEMU_BLOCKJOB_STATE_COMPLETED || + job->newstate =3D=3D QEMU_BLOCKJOB_STATE_FAILED) && job->state =3D=3D QEMU_BLOCKJOB_STATE_ABORTING) job->newstate =3D QEMU_BLOCKJOB_STATE_CANCELLED; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1574781506; cv=none; d=zohomail.com; s=zohoarc; b=QlQ7GxQ6AMN2KyaK5d4hoZcejwFbiw1WPJEKzP2eT8oPw+OqL6kAvyToL2WwN6rHy0fxiDOleN3outSfzCV09cJhvN5jRobc+F3Q2GJQzATGrpPCpvrmNcBrJyXVJoLZKXgPhsajWRyfL6vF9onPDOUZU3/vZuLxKvq2SASA0hM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781506; 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=9rWCp4Ja76A2Iv2pyliWK567+KaXvFPIHkf4JzhdpX0=; b=nXV4iaQFaBMGi82DYrsFvt80mGCiTe6RULfv9YU9mRC/deSYJejuz/8/NbCkojqVZGM8ClrPSgeBDI+o9Q4zy4U25yfNYgI3JBTQ/tVN6xqkBkpPir1JlkaBm/xHZnCLrr1Ai21X2ZXGaVaJIbjNsA691CDji6nB5jZqn9tgtOE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574781506476718.2558213951868; Tue, 26 Nov 2019 07:18:26 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-ievCLLMBP_G32aSvdzb6xg-1; Tue, 26 Nov 2019 10:18:23 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7494180381E; Tue, 26 Nov 2019 15:18:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87B4160BEC; Tue, 26 Nov 2019 15:18:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 49CAA1803C41; Tue, 26 Nov 2019 15:18:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHihd011817 for ; Tue, 26 Nov 2019 10:17:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6E09660C80; Tue, 26 Nov 2019 15:17:44 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id E91A460BE2 for ; Tue, 26 Nov 2019 15:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781505; 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=9rWCp4Ja76A2Iv2pyliWK567+KaXvFPIHkf4JzhdpX0=; b=cjb4WM2qxVdUrZ4GVc/jlLiD21EfuQiPCeSHT0KRBaNnadxBqMRd5eS9orV1g2WkATRGxS cj44y8o+6bM9012uPNOY3OdVk8S6uBp84/w1IiCrypIIZBmf/IZeCY785Q/CZ7ndzURDwq oE1qzI344HRNPTqMr66cnaybLvWgdOk= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:27 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/10] qemu: process: Move block job refresh after async job recovery X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: ievCLLMBP_G32aSvdzb6xg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Block jobs may be members of async jobs so it makes more sense to refresh block job state after we do steps for async job recovery. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_process.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index cb11da2401..a588ee25f8 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8143,9 +8143,6 @@ qemuProcessReconnect(void *opaque) qemuBlockNodeNamesDetect(driver, obj, QEMU_ASYNC_JOB_NONE) < 0) goto error; - if (qemuProcessRefreshBlockjobs(driver, obj) < 0) - goto error; - if (qemuRefreshVirtioChannelState(driver, obj, QEMU_ASYNC_JOB_NONE) < = 0) goto error; @@ -8158,6 +8155,9 @@ qemuProcessReconnect(void *opaque) if (qemuProcessRecoverJob(driver, obj, &oldjob, &stopFlags) < 0) goto error; + if (qemuProcessRefreshBlockjobs(driver, obj) < 0) + goto error; + if (qemuProcessUpdateDevices(driver, obj) < 0) goto error; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1574781478; cv=none; d=zohomail.com; s=zohoarc; b=K+HoT929okZBkon3IELGaAQQG52Rp1MLO94RqUSr0ieZz9u64Fg8NuTMlgnfDNB1/mImrGO+wsVaHI+PjZeehrcCrxN3fPQXrKNp2tpI3cRV2M0v73sMEjgkqpawoKRGjhc2RpeChEWJByLKzOH87IUPSsrjJARIKR1v434Yo3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781478; 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=9ByoiEseir+dJrLih+rgKX6sGafnIzAG9wwkMBFKSs0=; b=Qx4kGNrFxxliWjw35t1kmCd5/0TDVFK4v4+jlPK27Tz8R49iVVzkiLJ0/FP+b9Gl81NINqJLo8qadPeP/vkGCHYzlS2AEusNkEOZD2kKLd1gRwu7keJp9hkU1N8MvH8v6ePLo2LGbKprV27YnOr2LOCzYYatU2zO9m6Xq8v2HZ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1574781478423525.7653832772017; Tue, 26 Nov 2019 07:17:58 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-LhbNzTlVMY6mV4FV3WJk-g-1; Tue, 26 Nov 2019 10:17:55 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1702CDBB2; Tue, 26 Nov 2019 15:17:49 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E58925C241; Tue, 26 Nov 2019 15:17:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D42F1803C37; Tue, 26 Nov 2019 15:17:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHlGE011828 for ; Tue, 26 Nov 2019 10:17:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4DE8160C80; Tue, 26 Nov 2019 15:17:47 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA28D60BE2 for ; Tue, 26 Nov 2019 15:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781477; 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=9ByoiEseir+dJrLih+rgKX6sGafnIzAG9wwkMBFKSs0=; b=RUvNyPPEoQRVRYxRxTPx/MRm6EgxS1WKK1IAmY5fM414PwP12ilhYdpcIScrr4e5W2DARq yES/DrAJS3kpvvYuFw0HA7S342XcfR3cdFgM17hAwMNDicp1I5A/j/DgNMGZ/sUSIeHAXt S5NWO9KpjlQ9OphfNBP3t84mgCUWDAU= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:28 +0100 Message-Id: <498ac5a83badb16d44723923d91d0fee8204fd53.1574781325.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/10] qemu: blockjob: Fix deadlock when terminating job with invalid data X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: LhbNzTlVMY6mV4FV3WJk-g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We must exit the monitor prior to refusing other work, otherwise the VM object will become unusable. This bug was introduced in commit v5.5.0-244-gc412383796 but thankfully the code path was not excercised without QEMU_CAPS_BLOCKDEV. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 2283d49c61..818e36435c 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1305,14 +1305,14 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataP= tr job, dismissed =3D true; } + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + goto cleanup; + if (job->invalidData) { VIR_WARN("terminating job '%s' with invalid data", job->name); goto cleanup; } - if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) - goto cleanup; - if ((job->newstate =3D=3D QEMU_BLOCKJOB_STATE_COMPLETED || job->newstate =3D=3D QEMU_BLOCKJOB_STATE_FAILED) && job->state =3D=3D QEMU_BLOCKJOB_STATE_ABORTING) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1574781510; cv=none; d=zohomail.com; s=zohoarc; b=WHK6Ri8vDBkncJbUOjBT4JAznAWJpcLoUCPaFZGEFT1IjjyQGEH9rOm7fUc6fOnV0H+dC6GogqbwXZRxGLggWaaEJDoqnrbnvy10WeRU3CK1KgqnMrUUjAk2LzwTDM7E4GIa1hFHUd6UTjwXM3nCO2WqVc65upFuDVtXxPFy7M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781510; 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=vZNPccIV3YayJ5YAQPEyq1IhRhAMIxCcJQNsF44UdIM=; b=FYBVosNXM592KlDeuAqP1hat0ZjAGt0SkUvyuER1HoLHdG4E5P0uNmyJr7ILWwd9KfW5aAyT3MhAjEhEElnhccdl7aG3mJUI1cFjJLH0I+QPG+D7kterHoe/sgNokBzzi3bRhIhF6vOL+VyaRLO1SSpS8pqz5tvWAZqcqfDPoqg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574781510477881.2202825957844; Tue, 26 Nov 2019 07:18:30 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-GAx3fwW9P0qmfj4SSCQ0ig-1; Tue, 26 Nov 2019 10:18:27 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9626BA3A8B; Tue, 26 Nov 2019 15:18:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68A0981746; Tue, 26 Nov 2019 15:18:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 23B9A4E56D; Tue, 26 Nov 2019 15:18:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHobk011838 for ; Tue, 26 Nov 2019 10:17:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 90D8F60C80; Tue, 26 Nov 2019 15:17:50 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14CB960BE2 for ; Tue, 26 Nov 2019 15:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781509; 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=vZNPccIV3YayJ5YAQPEyq1IhRhAMIxCcJQNsF44UdIM=; b=RWw1PLFvNIrjtb2LFUmIlUYAdDmnsrW9qslMOMF3MrVNlSd1vovB2I6002PHPHof71SjBm 6VTgYx+kNdpj+mcTUCI7LyleBKLYS3WEctENLkQKES62a0eeA6AuukEUNDqDiFSSC6CZZe BYlHVI8F00sAbEAzZsGAXYpv2/ajnOc= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:29 +0100 Message-Id: <7c44085e06592da78f5f376b71349c623efb5658.1574781325.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/10] qemu: blockjob: Log blockjobs which are dropped when untracked by qemu X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: GAx3fwW9P0qmfj4SSCQ0ig-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since we don't know what happened to the job we can't do much about it but we can at least log that this happened. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 818e36435c..b83d681f06 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -501,8 +501,10 @@ qemuBlockJobRefreshJobs(virQEMUDriverPtr driver, /* remove data for job which qemu didn't report (the algorithm is * inefficient, but the possibility of such jobs is very low */ - while ((job =3D virHashSearch(priv->blockjobs, qemuBlockJobRefreshJobs= FindInactive, NULL, NULL))) + while ((job =3D virHashSearch(priv->blockjobs, qemuBlockJobRefreshJobs= FindInactive, NULL, NULL))) { + VIR_WARN("dropping blockjob '%s' untracked by qemu", job->name); qemuBlockJobUnregister(job, vm); + } ret =3D 0; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1574781497; cv=none; d=zohomail.com; s=zohoarc; b=TmSr5WdqW+ShM4CEbTNarW1VGcNY7IeiAMCpTbJb48TvpvWGOWpuY1rC9MGmZnLf7X3bbjTgvQh+yFApfAgly5jfeYw+5inX50SL/Y+AblBTdRR6xYnxafob8JPZI4RxbJHK2gABApIMiSrUGJGgjI9CusZ7ev2lEGH0DRdYeYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781497; 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=vUqjkgVvt+r4YgFfUBDvnjVY7/RRbDta++uoWgS6o08=; b=bCTKgVjtXY3aUi87uFwjGC/NdyvAM/bW96olyO7WoeVPISlC5L3sLnQeQ2wWiDepWu4sBAJc64KI8ZLOWUs9PwcYXQh2PiTLOrr4UCwE7N+wHQJiMaCQEUjsVxxOMz5M1CROmsO7T8o7x+yaW1CzSPMZwVztxh6ISVHbq0Ul5Fo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574781497674626.5976393316847; Tue, 26 Nov 2019 07:18:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-jANOJY1nN0OOMAxkHZpZlQ-1; Tue, 26 Nov 2019 10:18:14 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8D52911EB; Tue, 26 Nov 2019 15:18:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9602481741; Tue, 26 Nov 2019 15:18:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3A9874E566; Tue, 26 Nov 2019 15:18:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHrIV011858 for ; Tue, 26 Nov 2019 10:17:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 607AD6106B; Tue, 26 Nov 2019 15:17:53 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEB9D60BE2 for ; Tue, 26 Nov 2019 15:17:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781496; 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=vUqjkgVvt+r4YgFfUBDvnjVY7/RRbDta++uoWgS6o08=; b=VZZcPrX/IFwCfgX+dFh9yXfw5lEHoMqP7emqhE4cyCVK06qSKAhTW3L8FyXET67n2urgLc /7rxtw5AFave6XxU5LpEssZR098iSem0aV6k8fnAjWtRupqVNZWROOOTDwshGU9D5e3Elt t9zBUx6PcuWSrKEWUZhw4FgyGFH5bWE= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:30 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/10] qemu: blockjob: Mark job with broken data but tracked by qemu as reconnected X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: jANOJY1nN0OOMAxkHZpZlQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Otherwise it would get dropped later on as untracked despite us knowing about it. Additionally since we cancelled it we must wait to dismiss it which would not be possible if we unregister it. This also opened a window for a race condition since the job state change event of the just-cancelled job might be delivered prior to us unregistering the job in which case everything would work properly. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index b83d681f06..4d14c3d27c 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -465,6 +465,8 @@ qemuBlockJobRefreshJobs(virQEMUDriverPtr driver, if (rc < 0) qemuBlockJobUnregister(job, vm); + else + job->reconnected =3D true; continue; } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1574781507; cv=none; d=zohomail.com; s=zohoarc; b=FdPfYSNHphelrZEvwPrnYVdbf4UFO37LaJ5b6T+Il6oWxvFndFlq5CYtvGpj3PlqHHFIcxDevvf0aQ06MGdFFqjCjYPHkSmWy0iS5V6/VtNW0gXKuulynVmT0YDtXDLELUD0PriAHqjPeyzWeV/OwhdGew1LEfPi5HDkpFxEuck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781507; 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=CWLRnchFAMKKAzOTcLJV2PYg8Amrt8xEYcPWfaSH4pA=; b=iSMz1O1SQ5IEbXYr+/AcegljP8U6aDOiT/7VM+ubqxywX8bQt+YowBeYZ3R62ECz38cfYV8B9e6qcd84XQLqfW/8DmUL7UitLnmA5MbFTm3pLUwOCaiK/x1HEn13Hep9v8rP7CXwNoOZh7eAwp11QLEaa2QOXQlzFLtCEcmaQSE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574781507370595.892846772777; Tue, 26 Nov 2019 07:18:27 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-133-KgrPwBi-MA6Pakp04sHZOA-1; Tue, 26 Nov 2019 10:18:24 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5CDD802D6F; Tue, 26 Nov 2019 15:18:15 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B175D19C69; Tue, 26 Nov 2019 15:18:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4AB811803B48; Tue, 26 Nov 2019 15:18:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHuTe011882 for ; Tue, 26 Nov 2019 10:17:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id AC0E160C18; Tue, 26 Nov 2019 15:17:56 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 33B6A60BEC for ; Tue, 26 Nov 2019 15:17:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781506; 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=CWLRnchFAMKKAzOTcLJV2PYg8Amrt8xEYcPWfaSH4pA=; b=fgWfCJMJbQBzjRrLJS+EG+6BVox13plooG87sk88S3ptkYKR2HoU6yUa0eaFVz+WnKGwCf MQe4OOEKojs+h2+OEyI3I0aDT9LZn/dJluz60GthGIpKzZieJgZ8P7s5E4P2NN907sxlsO 3ZJJ5NQn4k2D746netBNaMCmC64kves= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:31 +0100 Message-Id: <6973f4844be1f8a54f3317971cecf1cd5d0f9b64.1574781325.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/10] qemu: blockjob: Don't stop processing the finished job early X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: KgrPwBi-MA6Pakp04sHZOA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Both failure to refresh and to dismiss the job are very unlikely but if they happen there's not much we can do about the blockjob. The concluded job handlers treat it as if the job failed if we don't update the state to 'QEMU_BLOCKJOB_STATE_COMPLETED' which is probably the safest thing to do here. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 4d14c3d27c..5a6c5542a6 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1270,8 +1270,6 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr= job, qemuMonitorJobInfoPtr *jobinfo =3D NULL; size_t njobinfo =3D 0; size_t i; - int rc =3D 0; - bool dismissed =3D false; bool refreshed =3D false; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) @@ -1279,7 +1277,7 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr= job, /* we need to fetch the error state as the event does not propagate it= */ if (job->newstate =3D=3D QEMU_BLOCKJOB_STATE_CONCLUDED && - (rc =3D qemuMonitorGetJobInfo(qemuDomainGetMonitor(vm), &jobinfo, = &njobinfo)) =3D=3D 0) { + qemuMonitorGetJobInfo(qemuDomainGetMonitor(vm), &jobinfo, &njobinf= o) =3D=3D 0) { for (i =3D 0; i < njobinfo; i++) { if (STRNEQ_NULLABLE(job->name, jobinfo[i]->id)) @@ -1297,19 +1295,14 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataP= tr job, break; } - if (i =3D=3D njobinfo) { + if (i =3D=3D njobinfo) VIR_WARN("failed to refresh job '%s'", job->name); - rc =3D -1; - } } /* dismiss job in qemu */ - if (rc >=3D 0) { - if ((rc =3D qemuMonitorJobDismiss(qemuDomainGetMonitor(vm), job->n= ame)) >=3D 0) - dismissed =3D true; - } + ignore_value(qemuMonitorJobDismiss(qemuDomainGetMonitor(vm), job->name= )); - if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) + if (qemuDomainObjExitMonitor(driver, vm) < 0) goto cleanup; if (job->invalidData) { @@ -1340,10 +1333,8 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPt= r job, } cleanup: - if (dismissed) { - qemuBlockJobUnregister(job, vm); - qemuDomainSaveConfig(vm); - } + qemuBlockJobUnregister(job, vm); + qemuDomainSaveConfig(vm); for (i =3D 0; i < njobinfo; i++) qemuMonitorJobInfoFree(jobinfo[i]); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1574781512; cv=none; d=zohomail.com; s=zohoarc; b=MMlDCffn65ZqBP0RdKQTGOYa53W8QFk7V4KeoMPY0oQrSYzh+VFMAt1NvOINOTtWlT+1UlGO+7D8maaqqkYgzlrgvXUG0ytSGxocvHzFed4Xbl3o3piWHQoBjXstuuQX6ufYv4Quk5UWNCJH7ry/qNNCAUKa4f+7V3yJ3Tr2DYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781512; 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=IlU5kMPRyVjLaOppbUUFXv4yyrfp9C8AHzM8DoL+k8o=; b=IDVEqXMj//spEd//a+NJGjciMlXzyZIcLTXH14T6ZsP4PV/hI6ZvkEzRktoEozGJ7PFyGbBZlmXd82MXWhiClqws4ieOsjzi9bZFnWhdW2fPhVR8xZu/X2zlSodGw1Y1nIxNdnMS86ZQR6qFkuqS3yZGREKyScFkXQGJ2eu+k14= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574781512386711.4681302580696; Tue, 26 Nov 2019 07:18:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-CODEzE6hM86KpD9F7MHUGg-1; Tue, 26 Nov 2019 10:18:29 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B9DB100E361; Tue, 26 Nov 2019 15:18:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7940F5C1D8; Tue, 26 Nov 2019 15:18:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3CDAD4E570; Tue, 26 Nov 2019 15:18:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHvPs011889 for ; Tue, 26 Nov 2019 10:17:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7C97A60C18; Tue, 26 Nov 2019 15:17:57 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04E1E60BEC for ; Tue, 26 Nov 2019 15:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781511; 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=IlU5kMPRyVjLaOppbUUFXv4yyrfp9C8AHzM8DoL+k8o=; b=eICei/KO5Q0JMgGNpR1DlaK6B6c/OLf/0Us2eU0U3rCFW9H6JUzbVk4ICOOoKNTt7+2OQj 0hUC1ws5I4YKOVTss3ubdqbTek/c43tvSi6LZT3FJ5l4H8XVCo36KGLmasyTwx0VVEFfGu h+zucMMWsdlT6R8wVYWAzw6ITN/jRtY= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:32 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/10] qemu: blockjob: Separate clearing of per-job data X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: CODEzE6hM86KpD9F7MHUGg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We will need to clear per-job type data when we will be marking a blockjob as broken in the new way. Extract the code for future reuse. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 5a6c5542a6..6db3e0ca84 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -70,6 +70,13 @@ VIR_ENUM_IMPL(qemuBlockjob, static virClassPtr qemuBlockJobDataClass; +static void +qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job) +{ + if (job->type =3D=3D QEMU_BLOCKJOB_TYPE_CREATE) + virObjectUnref(job->data.create.src); +} + static void qemuBlockJobDataDispose(void *obj) @@ -79,8 +86,7 @@ qemuBlockJobDataDispose(void *obj) virObjectUnref(job->chain); virObjectUnref(job->mirrorChain); - if (job->type =3D=3D QEMU_BLOCKJOB_TYPE_CREATE) - virObjectUnref(job->data.create.src); + qemuBlockJobDataDisposeJobdata(job); g_free(job->name); g_free(job->errmsg); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1574781523; cv=none; d=zohomail.com; s=zohoarc; b=jrt49P3iWqRB+Vh9NtaQ5dYZaxn6K1GOCUWI9ZuOwtgcgpQFHoHxIRCtFeA2/EVd4S9+WI7wakQmq8DVWl4aBN7TofQpgikz/tgeNCUvoPPL09mh+GMjjti7hg1iswIDNC+MBdnHLSgaTlJHqy2xq2cXo+rbmqXxWKVxV4x0XXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781523; 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=045LZuR28y0baPHw85sd9owQEkIfI9q4cbGCjqYXcQ0=; b=OZ7M1JJfCwZm3ANWmJgoKwFSoseG00Y1DXqEmgW+OHw+HvHvq7lSIbf49sutRc0FgO22PwJjI8CQ/cHXIxkrwYOQeslOd1vEryb3lMhs4gRFTNjLUa9mzRFKzbBiH8zmQN37urwYJsKSCnNm+CcICPz6J6Kn+2ealVMnn7pCuUw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574781523880252.98217161888851; Tue, 26 Nov 2019 07:18:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-iKz6qshYMnCdvw3CWL7NOA-1; Tue, 26 Nov 2019 10:18:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25E0B184CAC8; Tue, 26 Nov 2019 15:18:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F11C660BEC; Tue, 26 Nov 2019 15:18:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A112618034F9; Tue, 26 Nov 2019 15:18:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHwAh011897 for ; Tue, 26 Nov 2019 10:17:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 512C260BE2; Tue, 26 Nov 2019 15:17:58 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA74B60BEC for ; Tue, 26 Nov 2019 15:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781520; 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=045LZuR28y0baPHw85sd9owQEkIfI9q4cbGCjqYXcQ0=; b=hnZpOp5z82Tdq8x9hKkePWgbAwDv2uHBt8QEmynfB0NVxC1Ljm8jldHK8tXF8nuKjPyuKO y0BpEvjmHecxczFLEyicHoLJ3xCtwLn2hEXVbJp9y15cJm9Oz0tdPd3fbrD/gVUzJWOhjY +iYJfb3C17i6L1EcqI533jgOJK+7UEs= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:33 +0100 Message-Id: <0cd099ecd77eb44805ac9eb3b4ef5ee77cf120d5.1574781325.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/10] qemu: blockjob: Introduce "broken" block job type X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: iKz6qshYMnCdvw3CWL7NOA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" To better track jobs we couldn't parse let's introduce a new job type which will clarify semantics internally in few places. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 25 ++++++++++++++++++- src/qemu/qemu_blockjob.h | 3 +++ src/qemu/qemu_domain.c | 13 +++++++++- src/qemu/qemu_driver.c | 1 + .../blockjob-blockdev-in.xml | 1 + 5 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 6db3e0ca84..d957e3175e 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -66,7 +66,8 @@ VIR_ENUM_IMPL(qemuBlockjob, "commit", "active-commit", "", - "create"); + "create", + "broken"); static virClassPtr qemuBlockJobDataClass; @@ -127,6 +128,23 @@ qemuBlockJobDataNew(qemuBlockJobType type, } +/** + * qemuBlockJobMarkBroken: + * @job: job to mark as broken + * + * In case when we are unable to parse the block job data from the XML + * successfully we'll need to mark the job as broken and then attempt to a= bort + * it. This function marks the job as broken. + */ +static void +qemuBlockJobMarkBroken(qemuBlockJobDataPtr job) +{ + qemuBlockJobDataDisposeJobdata(job); + job->brokentype =3D job->type; + job->type =3D QEMU_BLOCKJOB_TYPE_BROKEN; +} + + /** * qemuBlockJobRegister: * @job: job to register @@ -460,6 +478,9 @@ qemuBlockJobRefreshJobs(virQEMUDriverPtr driver, * in qemu and just forget about it in libvirt because there's not= much * we coud do besides killing the VM */ if (job->invalidData) { + + qemuBlockJobMarkBroken(job); + qemuDomainObjEnterMonitor(driver, vm); rc =3D qemuMonitorJobCancel(priv->mon, job->name, true); @@ -1254,6 +1275,8 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlock= JobDataPtr job, qemuBlockJobProcessEventConcludedCopyAbort(driver, vm, job, as= yncJob); break; + + case QEMU_BLOCKJOB_TYPE_BROKEN: case QEMU_BLOCKJOB_TYPE_NONE: case QEMU_BLOCKJOB_TYPE_INTERNAL: case QEMU_BLOCKJOB_TYPE_LAST: diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index d8da918f2f..fdfe2c57ec 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -63,6 +63,7 @@ typedef enum { /* Additional enum values local to qemu */ QEMU_BLOCKJOB_TYPE_INTERNAL, QEMU_BLOCKJOB_TYPE_CREATE, + QEMU_BLOCKJOB_TYPE_BROKEN, QEMU_BLOCKJOB_TYPE_LAST } qemuBlockJobType; verify((int)QEMU_BLOCKJOB_TYPE_INTERNAL =3D=3D VIR_DOMAIN_BLOCK_JOB_TYPE_L= AST); @@ -131,6 +132,8 @@ struct _qemuBlockJobData { int newstate; /* qemuBlockjobState, subset of events emitted by qemu */ + int brokentype; /* the previous type of a broken blockjob qemuBlockJob= Type */ + bool invalidData; /* the job data (except name) is not valid */ bool reconnected; /* internal field for tracking whether job is live a= fter reconnect to qemu */ }; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c233a4ba96..d1596a28ca 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2475,6 +2475,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, virBufferEscapeString(&attrBuf, " type=3D'%s'", qemuBlockjobTypeToStri= ng(job->type)); virBufferEscapeString(&attrBuf, " state=3D'%s'", state); virBufferEscapeString(&attrBuf, " newstate=3D'%s'", newstate); + if (job->brokentype !=3D QEMU_BLOCKJOB_TYPE_NONE) + virBufferEscapeString(&attrBuf, " brokentype=3D'%s'", qemuBlockjob= TypeToString(job->brokentype)); virBufferEscapeString(&childBuf, "%s", job->errmsg); if (job->disk) { @@ -2536,6 +2538,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, virBufferAddLit(&attrBuf, " shallownew=3D'yes'"); break; + + case QEMU_BLOCKJOB_TYPE_BROKEN: case QEMU_BLOCKJOB_TYPE_NONE: case QEMU_BLOCKJOB_TYPE_INTERNAL: case QEMU_BLOCKJOB_TYPE_LAST: @@ -3100,6 +3104,8 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemu= BlockJobDataPtr job, } break; + + case QEMU_BLOCKJOB_TYPE_BROKEN: case QEMU_BLOCKJOB_TYPE_NONE: case QEMU_BLOCKJOB_TYPE_INTERNAL: case QEMU_BLOCKJOB_TYPE_LAST: @@ -3125,6 +3131,7 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObj= Ptr vm, g_autoptr(qemuBlockJobData) job =3D NULL; g_autofree char *name =3D NULL; g_autofree char *typestr =3D NULL; + g_autofree char *brokentypestr =3D NULL; int type; g_autofree char *statestr =3D NULL; int state =3D QEMU_BLOCKJOB_STATE_FAILED; @@ -3146,13 +3153,17 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainO= bjPtr vm, * clean it up */ if (!(typestr =3D virXPathString("string(./@type)", ctxt)) || (type =3D qemuBlockjobTypeFromString(typestr)) < 0) { - type =3D QEMU_BLOCKJOB_TYPE_NONE; + type =3D QEMU_BLOCKJOB_TYPE_BROKEN; invalidData =3D true; } if (!(job =3D qemuBlockJobDataNew(type, name))) return -1; + if ((brokentypestr =3D virXPathString("string(./@brokentype)", ctxt)) = && + (job->brokentype =3D qemuBlockjobTypeFromString(brokentypestr)) < = 0) + job->brokentype =3D QEMU_BLOCKJOB_TYPE_NONE; + if (!(statestr =3D virXPathString("string(./@state)", ctxt)) || (state =3D qemuBlockjobStateTypeFromString(statestr)) < 0) invalidData =3D true; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 669c12d6ca..fa8a948568 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17418,6 +17418,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, case QEMU_BLOCKJOB_TYPE_COMMIT: case QEMU_BLOCKJOB_TYPE_INTERNAL: case QEMU_BLOCKJOB_TYPE_CREATE: + case QEMU_BLOCKJOB_TYPE_BROKEN: virReportError(VIR_ERR_OPERATION_INVALID, _("job type '%s' does not support pivot"), qemuBlockjobTypeToString(job->type)); diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/q= emustatusxml2xmldata/blockjob-blockdev-in.xml index 4f6930001e..67ab099bd9 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -300,6 +300,7 @@ + --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 09:01:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1574781531; cv=none; d=zohomail.com; s=zohoarc; b=i1j/PlTW331cW2YvnsjtLTyVkAJLSwRd9kGCcvNcj8GO9DhWvXYl9k8ZvNKSMm4wu+XqRQfDeXCpvdFVfEAqHRt9WLVDEh0TNaxnl247H9PZW4N/dT8kLiS5bBFX85Dm7euONL/wP1wvrHfYTpt/Je7c4S0iX1plHhmm08oymt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574781531; 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=TFbPSD5CdbG/oQFt0rfgWXslQ1jOWWB3tUghlnEQKiQ=; b=CpiLd97cqixSJtCTrtY2EkydNLhQIPe8DkGfgMi5Sp4SYWtGPe1cOMIfQU57UWd3HZ8chxEY9Lp7h1XwlOO+9X7ABgFeXiau35bRS6UBBiyMIDhzglnTzzqV6OwtA6ijB0Rj41+BVYcRdz4j/XutazDXPO94pDsX1Q/jEfdTh08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1574781531721198.9202173447112; Tue, 26 Nov 2019 07:18:51 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-Lktu9lSjMge0R7oqh5TDIg-1; Tue, 26 Nov 2019 10:18:48 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E680803DA6; Tue, 26 Nov 2019 15:18:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 351605D6D6; Tue, 26 Nov 2019 15:18:42 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E96B34E576; Tue, 26 Nov 2019 15:18:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAQFHx37011910 for ; Tue, 26 Nov 2019 10:17:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id 22A1F60BEC; Tue, 26 Nov 2019 15:17:59 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C98360BE2 for ; Tue, 26 Nov 2019 15:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574781530; 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=TFbPSD5CdbG/oQFt0rfgWXslQ1jOWWB3tUghlnEQKiQ=; b=VWZYSba5IcnncBlH+0MbhNRELK5q4uOQjY1I8Jd68YYPefKprAnOgPkXp5E+EF3VMUuqaI p4TOx7R9uVVzh0UQjN+e974p9IclqL1RE3u29T1sx3FJi+VYpPBqiEqdWgAjD43CmFecg5 NZppNe0pB/Jd+QI7GvmRttTU/suiAcs= From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 26 Nov 2019 16:17:34 +0100 Message-Id: <883565335774aa476edb50e8a1a667908d0ba778.1574781325.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/10] qemu: blockjob: Finish handling job with broken data X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: Lktu9lSjMge0R7oqh5TDIg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that we have a separate job type which will not trigger normal code paths for terminating job we can remove the ad-hoc handling. This possibly fixes the issue of a broken job inheriting the disk and then finishing in which case we'd not detach the backing chain. Signed-off-by: Peter Krempa Reviewed-by: Cole Robinson --- src/qemu/qemu_blockjob.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index d957e3175e..2c51367c67 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1334,11 +1334,6 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPt= r job, if (qemuDomainObjExitMonitor(driver, vm) < 0) goto cleanup; - if (job->invalidData) { - VIR_WARN("terminating job '%s' with invalid data", job->name); - goto cleanup; - } - if ((job->newstate =3D=3D QEMU_BLOCKJOB_STATE_COMPLETED || job->newstate =3D=3D QEMU_BLOCKJOB_STATE_FAILED) && job->state =3D=3D QEMU_BLOCKJOB_STATE_ABORTING) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list