From nobody Mon May 6 16:40:53 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=1575623507; cv=none; d=zohomail.com; s=zohoarc; b=bcU6pzNYECAHErNvy5IAEs5dDIjfzd5eva7UsxffeUwcXCsrnFntt6AvylqJ7JI3pitS/HY87aheceoFWIOmjtrb6h5Fqta87zX+6uPfg5OcprvVkrWbP5VtyYLV1naZ1XY5uKc2vIenYOyRR8wByvX0IYIG+t0y/teCI/wBXvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575623507; 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=fuR3YyJecj8ZfxOLCG8qGQp5GkVWidjeLJNfybt/i8A=; b=jD6tHBtzvGk/BUG6RmZ/+WMQSHMun7rQIyZRhcgGion7U1yIx2qZ7qhGw22ejSbWESTgdie5lPQ+znBtO3ZbT7+/jswXLPt72YrI/HozKPkNqcCDt3FDin3InM40+rcHptq4boigJiZHmPfrV642YIBtO5zWd5Pgcr9xjlxhd/s= 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 1575623507336481.37216173135573; Fri, 6 Dec 2019 01:11:47 -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-34-uNDOLog2N-C52YCpMGIleg-1; Fri, 06 Dec 2019 04:11:44 -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 4F784800D5B; Fri, 6 Dec 2019 09:11:39 +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 020086B8D5; Fri, 6 Dec 2019 09:11:39 +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 20AE118089C8; Fri, 6 Dec 2019 09:11:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB69BYHl025244 for ; Fri, 6 Dec 2019 04:11:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id DE217694A3; Fri, 6 Dec 2019 09:11:34 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FB0F67E52; Fri, 6 Dec 2019 09:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575623506; 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=fuR3YyJecj8ZfxOLCG8qGQp5GkVWidjeLJNfybt/i8A=; b=E5GTD55cXt68AhF0zfIBzgwx1R+jjP2XFmDFkj1Hxq2kPGf+vC2zvzqJ3uX/cfaFutw/io w2kfj02HCjuXlYl+M05yMtl5m4WX0T+I9PNz0IeJ8q4Drby/pWWwmQO4x/tJF0WnfKd93b i1BDipHbt9VmjZ7lzjcT4UXw6jxG3Yo= From: Pavel Mores To: libvir-list@redhat.com Date: Fri, 6 Dec 2019 10:11:27 +0100 Message-Id: <20191206091129.16909-2-pmores@redhat.com> In-Reply-To: <20191206091129.16909-1-pmores@redhat.com> References: <20191206091129.16909-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 1/3] qemu: fix crash due to freeing an uninitialised pointer 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: uNDOLog2N-C52YCpMGIleg-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" The bug was fairly though not 100% reproducible, presumably due to the fact that some of the time, 'safename' might turn out NULL by chance, in which c= ase freeing it is OK. Signed-off-by: Pavel Mores --- src/qemu/qemu_monitor_text.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 9054682d60..b387235821 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -161,7 +161,6 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, con= st char *name) char *cmd =3D NULL; char *reply =3D NULL; int ret =3D -1; - char *safename; =20 cmd =3D g_strdup_printf("loadvm \"%s\"", name); =20 @@ -194,7 +193,6 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, con= st char *name) ret =3D 0; =20 cleanup: - VIR_FREE(safename); VIR_FREE(cmd); VIR_FREE(reply); return ret; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 16:40:53 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=1575623508; cv=none; d=zohomail.com; s=zohoarc; b=FDrwGJD5Bgqker/K+1jK1gPSrqmbeMPvHHUni7Vgqyo7H+bq8KPhadzzWm+ZNnjpXppxKGattaAOUUqPBT4Ls0R5/Bpu4SbNUdnQl3nW9D3pyesp+zUc5LcTKTy39vq9MqqUtJFaWLH4KF0JDfOE2puU8+27inBL9y9hvS3W828= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575623508; 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=F0E7h12GtBjJTzyu6utB1qtyqiubXk/IydPMJ/SZde8=; b=YWRQXHZQziaR45bw/8EqAx15vPCO6WRrMiZg3Lm7IxaCJmWGZDxhtFVNyMtSZl3gw+z7rdoeO4k3DMj9gqGeC1KLtLSIIiD70Q4CT+kcDWWKafa2iUJM5ctdBAmhbuq82owV1uQ+5T+7mUo81uxeif+wEGU1I6pEEo7TesimU60= 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 1575623508022583.4351075633615; Fri, 6 Dec 2019 01:11:48 -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-289-oPLbxGAzOdOZL7JXGjSL4g-1; Fri, 06 Dec 2019 04:11:45 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39F0A107ACC4; Fri, 6 Dec 2019 09:11:39 +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 E5FD86013B; Fri, 6 Dec 2019 09:11:38 +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 62BA265D3C; Fri, 6 Dec 2019 09:11:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB69BZmr025254 for ; Fri, 6 Dec 2019 04:11:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id D723E694A4; Fri, 6 Dec 2019 09:11:35 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3885467E52; Fri, 6 Dec 2019 09:11:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575623506; 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=F0E7h12GtBjJTzyu6utB1qtyqiubXk/IydPMJ/SZde8=; b=UiQM7TKVVsWn1Rq4/E3VsGQpmUOsGSKnnh/lIsvKT52ZTK8XxNLzEaJ2Q/dE4yjTXkjX3t V0geVw7RC8uVzH5IebunGQ+3NeaxNPlwG0S8b4qOu3Njn2gNq3ni6pmaBHXkXsfjg352MU K5/N24sygUOycFTJsxGABgcYZ2hCH4M= From: Pavel Mores To: libvir-list@redhat.com Date: Fri, 6 Dec 2019 10:11:28 +0100 Message-Id: <20191206091129.16909-3-pmores@redhat.com> In-Reply-To: <20191206091129.16909-1-pmores@redhat.com> References: <20191206091129.16909-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 2/3] qemu: use g_autofree instead of VIR_FREE in qemuMonitorTextCreateSnapshot() 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.11 X-MC-Unique: oPLbxGAzOdOZL7JXGjSL4g-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" While at bugfixing, convert the whole function to the new-style memory allocation handling. Signed-off-by: Pavel Mores Reviewed-by: Cole Robinson --- src/qemu/qemu_monitor_text.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index b387235821..7586ba4c54 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -125,14 +125,13 @@ int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name) { - char *cmd =3D NULL; - char *reply =3D NULL; - int ret =3D -1; + g_autofree char *cmd =3D NULL; + g_autofree char *reply =3D NULL; =20 cmd =3D g_strdup_printf("savevm \"%s\"", name); =20 if (qemuMonitorJSONHumanCommand(mon, cmd, &reply)) - goto cleanup; + return -1; =20 if (strstr(reply, "Error while creating snapshot") || strstr(reply, "Could not open VM state file") || @@ -141,19 +140,14 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, (strstr(reply, "Error") && strstr(reply, "while writing VM"))) { virReportError(VIR_ERR_OPERATION_FAILED, _("Failed to take snapshot: %s"), reply); - goto cleanup; + return -1; } else if (strstr(reply, "No block device can accept snapshots")) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("this domain does not have a device to take snaps= hots")); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - VIR_FREE(cmd); - VIR_FREE(reply); - return ret; + return 0; } =20 int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 16:40:53 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=1575623525; cv=none; d=zohomail.com; s=zohoarc; b=JbPIZr7AGNZxbdMrzVI45vly5sGoArez5eiMIVzGFyM/GakyRzWkazk1BIBbwGwjRACTHg2WZHkMJ0vefeCspIx6wtf3V70Pcc92lYeOD66w5XFUh1sZMvBr3pEBqgk7xX2IKxaG8ibh4zvBztm+JOuPAEHLQp6OYZZsCh+brK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575623525; 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=qyBnN6uXEfya/MOH7qcbGQVySV1aW/tAG68wGNRPr8g=; b=gcMe7r+bA4bR8s8wZ5DiUCsy6JEBI9pS3oH9aMLe4vDFp3SKjJMcGR+d3p1QC8A7VRpH5E/gpQcxbW9ADbWC79jZlW0S3+edPXdDxkWIMGrRUIxHHNq89YHULadX3zhWR4n+8GAsZppEB1jCEgsz2zHhoNp0vWHuWzGu1Ja5CuM= 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 1575623525458829.8119455373266; Fri, 6 Dec 2019 01:12:05 -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-105-6sF85EjoOD-M5cNle_ZsMg-1; Fri, 06 Dec 2019 04:12:02 -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 808D7190D341; Fri, 6 Dec 2019 09:11:57 +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 5A5EC19757; Fri, 6 Dec 2019 09:11:57 +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 DEC1A18089D0; Fri, 6 Dec 2019 09:11:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB69BaCq025262 for ; Fri, 6 Dec 2019 04:11:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id D0582694A4; Fri, 6 Dec 2019 09:11:36 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 318D767E52; Fri, 6 Dec 2019 09:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575623524; 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=qyBnN6uXEfya/MOH7qcbGQVySV1aW/tAG68wGNRPr8g=; b=NpjLLib2vxfRQ7YGIh3b6wU8Kj86ElFMGmGLH80yT5OoNSjXQLLvPLu2FQKJO2bE8hqt98 3ZbtchqQkF014BihuRm2vxjgk7DISg/tKQ2uY/JKI+yi+2UlPgCARY2oHE/7T8sPccZlkx 9SYzc2dcYO+hjz665KK1W+2wWkG+waQ= From: Pavel Mores To: libvir-list@redhat.com Date: Fri, 6 Dec 2019 10:11:29 +0100 Message-Id: <20191206091129.16909-4-pmores@redhat.com> In-Reply-To: <20191206091129.16909-1-pmores@redhat.com> References: <20191206091129.16909-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 3/3] qemu: fix concurrency crash bug in snapshot revert 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: 6sF85EjoOD-M5cNle_ZsMg-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" Although qemuDomainRevertToSnapshot() correctly begins a job at the start, the job is implicitly ended if qemuProcessStop() is called because it lives in the QEMU driver's private data that is purged during qemuProcessStop(). This commit restores the job by calling qemuProcessBeginJob() after qemuProcessStop() invocations. The first chunk is meant to fix a reported bug (see below). The bug's reproducibility on my machine was initially way lower than the reported 50% (more like 5%) but could be boosted to pretty much 100% by having virt-manager connected, displaying the testing domain in viewer. With the fix, the bug cannot be reproduced on my machine under any scenario I could think of. The actual crash was due to the thread performing revert which, not acquiring a job properly, was able to change the QEMU monitor structure under the thread performing snapshot delete while it was waiting on a condition variable. An interesting question is whether this commit takes the right approach to the fix. In particular, qemuProcessStop() arguably should not clear jobs, in which case the right thing to do would be to fix qemuProcessStop(). However, qemuProcessStop() has about twenty callers, and while none of them seems vulnerable to the kind of problems caused by clearing jobs (unlike qemuDomainRevertToSnapshot() who starts QEMU again right after stopping it), some of them might rely on jobs being cleared (this is not always easy to check conclusively). All in all, this commit's solution seems to be the least bad fix which doesn't require a potentially risky refactor. https://bugzilla.redhat.com/show_bug.cgi?id=3D1610207 Signed-off-by: Pavel Mores --- src/qemu/qemu_driver.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 18bd0101e7..b3769cc479 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16637,9 +16637,15 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, VIR_DOMAIN_EVENT_STOP= PED, detail); virObjectEventStateQueue(driver->domainEventState, eve= nt); - /* Start after stop won't be an async start job, so - * reset to none */ - jobType =3D QEMU_ASYNC_JOB_NONE; + /* We have to begin a new job as the original one (beg= un + * near the top of this function) was lost during the = purge + * of private data in qemuProcessStop() above. + */ + if (qemuProcessBeginJob(driver, vm, + VIR_DOMAIN_JOB_OPERATION_SNAPS= HOT_REVERT, + flags) < 0) { + goto cleanup; + } goto load; } } @@ -16774,6 +16780,11 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED, detail); + if (qemuProcessBeginJob(driver, vm, + VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVE= RT, + flags) < 0) { + goto cleanup; + } } =20 if (qemuDomainSnapshotRevertInactive(driver, vm, snap) < 0) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list