From nobody Sun Feb 8 23:41:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1567519742; cv=none; d=zoho.com; s=zohoarc; b=WO3DqkukcxVzPiyf40UMUk6My4sOHEyr4d4Fn7+vBfNDfeBr5v1I8PpyYLVIDdq0Tg5ykgdYG9IPVx4kipwrbp4ycPpGtLe/OHj8N4iOhF1dFCwNGtOu7jAJx0/His6U8tRnr8Gdlr1IPo6/WO/oj5Xfv27lSMA1feADojYhkFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567519742; 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:ARC-Authentication-Results; bh=shEVqL6rmU7NihAjehR0Tm4F6104oaO1a7RX19Q+bGY=; b=K5WoYWhxk10teTXP2Ec67XV3Ijmyi4QGkHAYFjcO1Jg2krnDR8kWcrpmgntP35rE2FbVwRHJN1/Gq3iu7M9If2p6FyzTXizsQg/zGGjOXegI95DtcyMowRE28jyk3STSmBIFu0oviCeg1L6KWNxlOTBSf6j1e0HUbhH1ztpGl+g= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567519742448710.165783181026; Tue, 3 Sep 2019 07:09:02 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3F8FDC065128; Tue, 3 Sep 2019 14:09:01 +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 16272588F; Tue, 3 Sep 2019 14:09:01 +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 C7E6E180BAA6; Tue, 3 Sep 2019 14:09:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x83E8OAX009640 for ; Tue, 3 Sep 2019 10:08:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B4971001B05; Tue, 3 Sep 2019 14:08:24 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id C90DF100197A for ; Tue, 3 Sep 2019 14:08:23 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 3 Sep 2019 16:08:04 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 11/18] qemu: snapshot: Save status and config XMLs only on success 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 03 Sep 2019 14:09:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We changed to always saving the status and config XMLs to simplify code. After a few more refactors it's now possible to move it to the appropriate place and save the XMLs only on success again. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ccbec5408d..fd9dbe854d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15554,17 +15554,17 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverP= tr driver, if (rc < 0) goto cleanup; + if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->cap= s) < 0 || + (vm->newDef && virDomainSaveConfig(cfg->configDir, driver->caps, + vm->newDef) < 0)) + goto cleanup; + ret =3D 0; cleanup: if (ret < 0) virErrorPreserveLast(&orig_err); - if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->cap= s) < 0 || - (vm->newDef && virDomainSaveConfig(cfg->configDir, driver->caps, - vm->newDef) < 0)) - ret =3D -1; - qemuDomainSnapshotDiskDataCleanup(diskdata, ndiskdata, driver, vm); virErrorRestore(&orig_err); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list