From nobody Mon Feb 9 03:12:16 2026 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; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1598623867; cv=none; d=zohomail.com; s=zohoarc; b=mVHDw28/2gd6+4W4uCSOwl55Q5brnLvq9E2VqS+reovkI4OpUYOc3sFnHSydRgoacuVZjxiv85Wj9kklEQCQH0X81EDU4Ypm+y7TanGD+fKFD4geNuByR6nW86F0N+vG1ctbeszQmxbp5Zdpzd5WRiQuWfICkemNxmGryVUX47c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623867; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=vLOol/6UbI16gLx2NUf92wk+EZ0YwlErfnFJ06LmTjg=; b=nsyB11NSV3urZy1xRkPDR8ZydmYCHRzDOFm44iOqOOQsEJdkHjs7vn853RRUpbz3JpMAikaO7flKS2hWvzdy66ZIT1ILlO5uweWx4aDw1a31VGpzpvNItfAHxCbfpGBnTYuVykdnfQwuZ1u8j6DrW9DCjaxXxzB0nih86q/QZZk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 159862386716482.13633724747922; Fri, 28 Aug 2020 07:11:07 -0700 (PDT) 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-530-2y3l2_y9NrWV6_xT5JdUXA-1; Fri, 28 Aug 2020 10:11:03 -0400 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 357E910ABDCE; Fri, 28 Aug 2020 14:10:56 +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 16D485C1DA; Fri, 28 Aug 2020 14:10:56 +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 D944A7986B; Fri, 28 Aug 2020 14:10:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEAqKP028143 for ; Fri, 28 Aug 2020 10:10:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id A4F3410FF15; Fri, 28 Aug 2020 14:10:52 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EFDC10FF14 for ; Fri, 28 Aug 2020 14:10:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6AB2C811E7A for ; Fri, 28 Aug 2020 14:10:50 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-WijKUep8Pnq2XOkrRZ6-xw-1; Fri, 28 Aug 2020 10:10:45 -0400 Received: by mail-qk1-f196.google.com with SMTP id p25so1037628qkp.2; Fri, 28 Aug 2020 07:10:45 -0700 (PDT) Received: from localhost (209-6-122-159.s2973.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [209.6.122.159]) by smtp.gmail.com with ESMTPSA id d8sm1017576qtn.70.2020.08.28.07.10.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:44 -0700 (PDT) X-MC-Unique: 2y3l2_y9NrWV6_xT5JdUXA-1 X-MC-Unique: WijKUep8Pnq2XOkrRZ6-xw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vLOol/6UbI16gLx2NUf92wk+EZ0YwlErfnFJ06LmTjg=; b=sq7uupkbcHdQ8/wTFTQHPy7xn+ztOwJ0/opRe87v/LAxxGb7m4dIWC2+CZ61mmaFPy D8rJIbBhvDS+/WPFOn9ojqel4RukBtKP6jre6NN9zUYY0Htwh48Gw4L1bduaXl7A8coZ kfW+/6qh5QbY+bdml/Fo7r4vuilGtGT76gK3unf3We+D8SSyAGlm/HCF8NSIYurEUOyJ MbAq+GXH+CyXmDakH8LdtFbebq5bHC614nEqUC0dlrgBWjCli9bzea+vMrBeIYNqLWb4 aFcYdai7kPPc7ITHos0n1Y5ReYQluYsGEYOu2mX8m+6JN7GY2ewU+mY2r9wl3uyhyqaf nHkQ== X-Gm-Message-State: AOAM532Jh9fEEp+vxWUCUuoQBCB1uakgglEkmXK+ps8Uzldy3fzf/iUa 5Y5L/SuSOo2y3HIq87jRp0xn7+EfVJ0w X-Google-Smtp-Source: ABdhPJwoLP5NifAc2gjZiTAP706Jq+zDjJxoLxeddwk+KeotJEij4zFj/dCgDkS+LFnhnpPmOn5qKg== X-Received: by 2002:a37:48c2:: with SMTP id v185mr1348879qka.57.1598623844863; Fri, 28 Aug 2020 07:10:44 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 3/7] qemu: Add transient disk handler to start and stop the guest Date: Fri, 28 Aug 2020 10:08:32 -0400 Message-Id: <20200828140836.14266-4-msys.mizuma@gmail.com> In-Reply-To: <20200828140836.14266-1-msys.mizuma@gmail.com> References: <20200828140836.14266-1-msys.mizuma@gmail.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Masayoshi Mizuma , Masayoshi Mizuma , qemu-block@nongnu.org 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Masayoshi Mizuma The transient disk is attached before the guest starts. Remove the transient disk when the guest does shutdown. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_process.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 126fabf5ef..5753258135 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -60,6 +60,7 @@ #include "qemu_firmware.h" #include "qemu_backup.h" #include "qemu_dbus.h" +#include "qemu_snapshot.h" =20 #include "cpu/cpu.h" #include "cpu/cpu_x86.h" @@ -7000,6 +7001,10 @@ qemuProcessLaunch(virConnectPtr conn, qemuProcessAutoDestroyAdd(driver, vm, conn) < 0) goto cleanup; =20 + VIR_DEBUG("Setting up transient disk"); + if (qemuTransientCreatetDisk(driver, vm, asyncJob) < 0) + goto cleanup; + ret =3D 0; =20 cleanup: @@ -7636,6 +7641,9 @@ void qemuProcessStop(virQEMUDriverPtr driver, } =20 qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src); + + if (disk->transient) + qemuTransientRemoveDisk(disk); } } =20 --=20 2.27.0