From nobody Sat Feb 7 06:20:43 2026 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=1579795048; cv=none; d=zohomail.com; s=zohoarc; b=n07qBljMOe4xEcp0P47t12FpwKfL1DJhEWfzXqz4OmrkmAXkjk9JpJ8JQkzspzT+/NKqulu6LqN4l4fIQzA62SrRa7heRI7rCjU6ksFzAFDW6izdFfGWueE665uVocVD0Ee4xd6TJLvBVmFOF2DarS8lwNGKTdPcV73BDCO58EY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579795048; 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=Hx3IgAhYtORLJptT32pGtQGVmAH1aiSiRNOlYy7DgLU=; b=Dttqr7NdIl4eHiSLwGh4Re0ym/yro1Ur4+UKP5ODg/jRHJCwt+N/qpKz5ZJUlhHYI91BOcVxl1uAMFvhvuK0iTvNqD6SDgJQ7gyC8//kp6mfvB6kXqXQ3c3vOwQp7hbWDd7MV3O/gDmv0h3ZRD8jTuBqVg+LD2RDcm+xwkeK7ao= 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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579795048446443.65720987838415; Thu, 23 Jan 2020 07:57:28 -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-316-9PDcQwybPoCKD1x6Yd1__g-1; Thu, 23 Jan 2020 10:57:24 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD6B9107ACC4; Thu, 23 Jan 2020 15:57:18 +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 4E4B65D9E2; Thu, 23 Jan 2020 15:57:18 +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 BB8DD8594A; Thu, 23 Jan 2020 15:57:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00NFvDAj012634 for ; Thu, 23 Jan 2020 10:57:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1F60E28990; Thu, 23 Jan 2020 15:57:13 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 75EBB38F; Thu, 23 Jan 2020 15:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579795047; 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=Hx3IgAhYtORLJptT32pGtQGVmAH1aiSiRNOlYy7DgLU=; b=Yrm7vaFwaWi3moiZOcnIwBrLmsqg6w1eJjRkqMBJjEXVPj/9wW4DGnJcq3PFtW/m92BQWC LXhIcxN3yw9qAWmypV1csUj9bzn8jN4JfDV3sFjEFZUAWsbKkTk8+akYB65GTxKIIzzzBk g/clkrBB2QPtX1yM7U4N4TIAa7xsp0I= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/4] qemu: blockcopy: Actually unplug unused images when mirror job fails to start Date: Thu, 23 Jan 2020 16:57:02 +0100 Message-Id: <4076e76ab8218a7759e2e491a970bbd4eabe6f4c.1579794423.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: Peter Krempa 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.14 X-MC-Unique: 9PDcQwybPoCKD1x6Yd1__g-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If a mirror job fails to start in -blockdev mode we'd not unplug the backing files we added first because the code on the error path checked the wrong value. 'rc' is used as status of the code which added the images, but the state of the 'block(dev)-mirror' call is stored in 'ret' at that point. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0a1dc414ae..3218dc0e23 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18413,7 +18413,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, qemuBlockJobStarted(job, vm); endjob: - if (rc < 0 && + if (ret < 0 && virDomainObjIsActive(vm) && (data || crdata)) { qemuDomainObjEnterMonitor(driver, vm); --=20 2.24.1