From nobody Sun May 5 05:32:58 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; 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=1598623863; cv=none; d=zohomail.com; s=zohoarc; b=YlJK9oh1pNlERu+Lzm2THcCayZHj3xYCZ+hLzHcqWB1eXfQQbPg7sDrdbx6NDe+dHzSKoTDUYe4Mu4VZsTpiZh8Xq6nUp6R6BV5kIx35GbBH3MbaFKhTKtFKo5p1B1+zQvSHSXVWguM1wQMJnXjjLxtlV/9oD1mOkdfgJGSXqHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623863; 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=mN8t7KTWFusBaRgwd1+S47I+3N18tMxXQf3FSgOe2rE=; b=J9hFaJk8MRlieuunKoOkgFK0ZuG7R+Qaguijvh0Id8ZBR0eiSh46PuuZbPpwyAricrenC3n71aoS5IOqsadiAWkXsMzg7vo74MQk57AMdF2SgGoz5HVVsz/yckZaCV1mnNiTme6HHuVrg6GRm/34m70y8FIIHF0DMGAg1CCh+34= 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 1598623863507153.67661490195974; Fri, 28 Aug 2020 07:11:03 -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-74-KZRvs0fDM3-rPw4tQLgp_Q-1; Fri, 28 Aug 2020 10:10:59 -0400 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 88530AE40D; Fri, 28 Aug 2020 14:10:52 +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 42B4010027A6; Fri, 28 Aug 2020 14:10:52 +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 D66E3181A06B; Fri, 28 Aug 2020 14:10:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEAm6o028106 for ; Fri, 28 Aug 2020 10:10:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37BAD110C573; Fri, 28 Aug 2020 14:10:48 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31503110C576 for ; Fri, 28 Aug 2020 14:10:45 +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 DB0B418AE953 for ; Fri, 28 Aug 2020 14:10:45 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-98-HmEU3g6YMfqcfkqRFoESHg-1; Fri, 28 Aug 2020 10:10:42 -0400 Received: by mail-qk1-f193.google.com with SMTP id o64so1013131qkb.10; Fri, 28 Aug 2020 07:10:42 -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 f92sm1079616qtd.9.2020.08.28.07.10.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:41 -0700 (PDT) X-MC-Unique: KZRvs0fDM3-rPw4tQLgp_Q-1 X-MC-Unique: HmEU3g6YMfqcfkqRFoESHg-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=mN8t7KTWFusBaRgwd1+S47I+3N18tMxXQf3FSgOe2rE=; b=GsaIAoWrF6XJsQosBnv5NF45si5TdGkrqTqk2uBoxGtlZkDYpEyN7aVBz2P6YYrdsd n+mkt7vuWao+hTtbYLoMgUZE8nCEI62xIMuxF96gWmKtM+NeteHRrAUVQ/WRV8hThP3+ GX1Urses3kp3DR2Kpwe58CGkhEiIpmBhvnmycZ7RQrW4iFF/nli8OY8BP/G/ZnsjCM4X RyKEeJnH0ApQ0GqB4+rwT+lRHn4n7YnbLAdugjq1DPB2G1pqq+NnqfWJWgwMfSS1YvVB qFGHkK3YJGvLguQjE9YQtpmzGcC/TdeMehU0QX/fjzmsaUAUR8R7yzagWILTwn3OhpAm xMZg== X-Gm-Message-State: AOAM533XGcXb4cP1iusUf7/gBMUvP3L0FuolpiyyL/xd4MbYyEeYgZ/j Oi/vHXNEbhnqXNCalT+gPD3Zv/dVlMob X-Google-Smtp-Source: ABdhPJypQFZ9vrKy6+SX8YbAPzbsTTxxtBhnwQWeJxfcw3P2B0NZgOtkoQA5Y3Zr6moMTzwDftMiEg== X-Received: by 2002:a37:97c5:: with SMTP id z188mr1316718qkd.185.1598623842190; Fri, 28 Aug 2020 07:10:42 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 1/7] qemuSnapshotDiskPrepareOne: Get available even if snapdisk is NULL Date: Fri, 28 Aug 2020 10:08:30 -0400 Message-Id: <20200828140836.14266-2-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.78 on 10.11.54.3 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.84 on 10.5.11.22 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 Get available even if snapdisk argument is NULL at qemuSnapshotDiskPrepareO= ne() so that the caller can setup dd->src. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_snapshot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 1e8ea80b22..d310e6ff02 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -953,8 +953,9 @@ qemuSnapshotDiskPrepareOne(virQEMUDriverPtr driver, if (qemuDomainStorageSourceValidateDepth(disk->src, 1, disk->dst) < 0) return -1; =20 - if (!(dd->src =3D virStorageSourceCopy(snapdisk->src, false))) - return -1; + if (snapdisk) + if (!(dd->src =3D virStorageSourceCopy(snapdisk->src, false))) + return -1; =20 if (virStorageSourceInitChainElement(dd->src, dd->disk->src, false) < = 0) return -1; --=20 2.27.0 From nobody Sun May 5 05:32:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1598623870; cv=none; d=zohomail.com; s=zohoarc; b=GaFIMCJ85Wli94OgdQXO08ejLeUZB3mcIgOcYmtXOCc94Z/eJqEEXbdDTeAtQIqQwpmjrsKiFtoMoXkYLr2y1ZkovLCaZjOCz7N8UZ/WSLL+EdvtVPdnv6vSUxhP5mmhglaBgRVd7xMRuVnN36LqARC6O8+dpil0uHVc/qD//AA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623870; 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=Kna0yLSi2xgCgzHy9brlJaTF6N8ExYG7T8j+FRl1sB4=; b=F9CpJZAazzFht7rcA3eoSnePdfFtxxzfRSvnEoP3Iugyn8Zcz+hGI64XlWPVFjKsz0lNViSOdzbIEy1/5ZFILr5b3HHcoPURkM/FJ1AYH6eZyPCU6U1DnYY/UE6AOP79pxbS8Vk6E3B886Iw6ScA7PXi3c9M5PxnKMd3NLV1OeU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1598623870747758.2446312350805; Fri, 28 Aug 2020 07:11:10 -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-323-gAIcWGvVM1qK2l0FsHZp6g-1; Fri, 28 Aug 2020 10:11:05 -0400 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 E62C485C737; Fri, 28 Aug 2020 14:10:57 +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 C4FB76716C; Fri, 28 Aug 2020 14:10: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 94F3A7986D; Fri, 28 Aug 2020 14:10:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEAnMe028116 for ; Fri, 28 Aug 2020 10:10:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 696122156A23; Fri, 28 Aug 2020 14:10:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 642832166B27 for ; Fri, 28 Aug 2020 14:10:49 +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 4A644852701 for ; Fri, 28 Aug 2020 14:10:49 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-168-1T0HPj1XMBOcM-F8EXODeQ-1; Fri, 28 Aug 2020 10:10:44 -0400 Received: by mail-qk1-f193.google.com with SMTP id w186so1036778qkd.1; Fri, 28 Aug 2020 07:10:44 -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 y14sm1083153qtc.84.2020.08.28.07.10.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:43 -0700 (PDT) X-MC-Unique: gAIcWGvVM1qK2l0FsHZp6g-1 X-MC-Unique: 1T0HPj1XMBOcM-F8EXODeQ-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=Kna0yLSi2xgCgzHy9brlJaTF6N8ExYG7T8j+FRl1sB4=; b=DHxDd4sf85WqtBWLsjslUqnE3OXpTShz70wTp6c1Gs+ZHEdIfcce3DqdVuY46yEoBL zWt4WLg3RGJPGq2BH39QsBWQ1Liopg+C4mc3DqGbt7hpQHmc6vZK6bBTA8nBN+gzwKnN Xx/wbw1PN2tVT0n/6ChHH3uKoKhWyrZ/mEe6pMrmWHZ1jOQKx3CIGkZ2+SDCM3Hb2KiF 0kmJ0Pyn+Xe8hs2CnCgM9ZUauneTYZ0LLAiB0qtb3wekK9ELF5REM1Aio7TcTpc6oIVC Ic5CTnKlHGmTUkdyzpzliyaA3YFinuX9uiiMR6hdtxLhxygO/3FWJ93YVnxLUoqeeb+m iOWA== X-Gm-Message-State: AOAM5336ja0dG0LPnnSpbpPtCH3R1/mO/MofE44iu8Yq5tzZ8AacPpGB 9Vefb2XOkdH5ow/nNnIJEZdeub2/t6QD X-Google-Smtp-Source: ABdhPJzCO1STDJrf+OhXGHd+o6G6daOH/Twd4Cnfz2r1GXup54ebIsueIS5VWyGj4hMEtobQAnTtKA== X-Received: by 2002:a37:84f:: with SMTP id 76mr1341952qki.251.1598623843568; Fri, 28 Aug 2020 07:10:43 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 2/7] qemu: Introduce functions to handle transient disk Date: Fri, 28 Aug 2020 10:08:31 -0400 Message-Id: <20200828140836.14266-3-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.78 on 10.11.54.6 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.12 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 Here is the implementation of transient option for qcow2 and raw format disk. This gets available directive in domain xml file like as: When the qemu command line options are built, a new qcow2 image is created with backing qcow2 by using blockdev-snapshot command. The backing image is the qcow2 file which is set as . The filename of the new qcow2 image is original-source-file.TRANSIENT. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_snapshot.c | 134 ++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_snapshot.h | 8 +++ src/util/virstoragefile.h | 2 + 3 files changed, 144 insertions(+) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index d310e6ff02..5c61d19f26 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -2265,3 +2265,137 @@ qemuSnapshotDelete(virDomainObjPtr vm, cleanup: return ret; } + +static int +qemuTransientDiskPrepareOne(virQEMUDriverPtr driver, + virDomainObjPtr vm, + qemuSnapshotDiskDataPtr data, + virHashTablePtr blockNamedNodeData, + int asyncJob, + virJSONValuePtr actions) +{ + int rc =3D -1; + virStorageSourcePtr dest; + virStorageSourcePtr src =3D data->disk->src; + qemuDomainObjPrivatePtr priv =3D vm->privateData; + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(priv->dr= iver); + + if (!strlen(src->path)) + return rc; + + if (!(dest =3D virStorageSourceNew())) + return rc; + + dest->path =3D g_strdup_printf("%s.TRANSIENT", src->path); + + if (virFileExists(dest->path)) { + virReportError(VIR_ERR_INVALID_ARG, + _("Transient disk '%s' for '%s' exists"), + dest->path, src->path); + goto cleanup; + } + + dest->type =3D VIR_STORAGE_TYPE_FILE; + dest->format =3D VIR_STORAGE_FILE_QCOW2; + data->src =3D dest; + + if (qemuSnapshotDiskPrepareOne(driver, vm, cfg, data->disk, + NULL, data, blockNamedNodeData, + false, true, asyncJob, actions) <= 0) + goto cleanup; + + rc =3D 0; + cleanup: + if (rc < 0) + g_free(dest->path); + + return rc; +} + +static int +qemuWaitTransaction(virQEMUDriverPtr driver, + virDomainObjPtr vm, + int asyncJob, + virJSONValuePtr *actions) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + return -1; + + if (qemuMonitorTransaction(priv->mon, actions) < 0) + return -1; + + if (qemuDomainObjExitMonitor(driver, vm) < 0) + return -1; + + return 0; +} + +int +qemuTransientCreatetDisk(virQEMUDriverPtr driver, + virDomainObjPtr vm, + int asyncJob) +{ + size_t i; + int rc =3D -1; + size_t ndata =3D 0; + qemuSnapshotDiskDataPtr data =3D NULL; + g_autoptr(virJSONValue) actions =3D NULL; + qemuDomainObjPrivatePtr priv =3D vm->privateData; + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; + bool blockdev =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); + + if (!blockdev) + return rc; + + if (VIR_ALLOC_N(data, vm->def->ndisks) < 0) + return rc; + + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, asyncJob))) + goto cleanup; + + if (!(actions =3D virJSONValueNewArray())) + goto cleanup; + + for (i =3D 0; i < vm->def->ndisks; i++) { + virDomainDiskDefPtr disk =3D vm->def->disks[i]; + + if (disk->src->readonly) + continue; + + if (disk->transient) { + data[ndata].disk =3D disk; + if (qemuTransientDiskPrepareOne(driver, vm, &data[ndata], bloc= kNamedNodeData, + asyncJob, actions) < 0) + goto cleanup; + ndata++; + } + } + + if (qemuWaitTransaction(driver, vm, asyncJob, &actions) < 0) + goto cleanup; + + for (i =3D 0; i < ndata; i++) { + qemuSnapshotDiskDataPtr dd =3D &data[i]; + + qemuSnapshotDiskUpdateSource(driver, vm, dd, blockdev); + dd->disk->src->transientEstablished =3D true; + } + + VIR_FREE(data); + rc =3D 0; + cleanup: + qemuSnapshotDiskCleanup(data, vm->def->ndisks, driver, vm, asyncJob); + + return rc; +} + +void +qemuTransientRemoveDisk(virDomainDiskDefPtr disk) +{ + if (disk->src->transientEstablished) { + VIR_DEBUG("unlink transient disk: %s", disk->src->path); + unlink(disk->src->path); + } +} diff --git a/src/qemu/qemu_snapshot.h b/src/qemu/qemu_snapshot.h index 8b3ebe87b1..aecb1762d2 100644 --- a/src/qemu/qemu_snapshot.h +++ b/src/qemu/qemu_snapshot.h @@ -53,3 +53,11 @@ int qemuSnapshotDelete(virDomainObjPtr vm, virDomainSnapshotPtr snapshot, unsigned int flags); + +int +qemuTransientCreatetDisk(virQEMUDriverPtr driver, + virDomainObjPtr vm, + int asyncJob); + +void +qemuTransientRemoveDisk(virDomainDiskDefPtr disk); diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index f73b3ee005..fd42d017f3 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -383,6 +383,8 @@ struct _virStorageSource { /* these must not be used apart from formatting the output JSON in the= qemu driver */ char *ssh_user; bool ssh_host_key_check_disabled; + + bool transientEstablished; }; =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSource, virObjectUnref); --=20 2.27.0 From nobody Sun May 5 05:32:58 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; 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 From nobody Sun May 5 05:32:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1598623874; cv=none; d=zohomail.com; s=zohoarc; b=hjK8rn9zc3+H6OpfqpCFu3ozziU7eQNy0Snih03fL6g07AxqyIXSpXvQz1aoTF+jmiWVIuw7LKvc7zYeq9OphgBEqa+ZmbTrKMp0vLbfhQzaMAXdSz7GmFoXNuli3l4f6loJW/RRzznov0Pdzz3gf7I2wArosWsPaT72qWFSTnY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623874; 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=yVf0fWOn6OMKCxD5WqaF+MpfG/JuMj495c80z6qsJjg=; b=K/GiVFkMAg2awG/DQ8zw3G9qwzmI8FUJyuJeoYgdSb+kCnyyLtjyfDrE0rY+pL8NenXh1udarc08a1ErzipWOtPp0b1/aE9m2j2lRawtur7VzjatcElGYA1FJwdRCLq01WhJS4ByV5cVxBPcEWTEU/uTQ5rEWZ8KCKeTEpiuzpM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1598623874609421.182072578226; Fri, 28 Aug 2020 07:11:14 -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-80-cuveRlMNO5SvRsCnnBDcyQ-1; Fri, 28 Aug 2020 10:11:11 -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 3CC9EAE412; Fri, 28 Aug 2020 14:11:00 +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 1C4745C1DA; Fri, 28 Aug 2020 14:11:00 +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 DC012181A06D; Fri, 28 Aug 2020 14:10:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEAphT028134 for ; Fri, 28 Aug 2020 10:10:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 81753110C575; Fri, 28 Aug 2020 14:10:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BEA2110C573 for ; Fri, 28 Aug 2020 14:10:51 +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 64301101A56B for ; Fri, 28 Aug 2020 14:10:51 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-9USDJM96PH6QpGMq3FY4GQ-1; Fri, 28 Aug 2020 10:10:46 -0400 Received: by mail-qk1-f193.google.com with SMTP id o196so1019836qke.8; Fri, 28 Aug 2020 07:10:46 -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 j140sm852701qke.110.2020.08.28.07.10.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:45 -0700 (PDT) X-MC-Unique: cuveRlMNO5SvRsCnnBDcyQ-1 X-MC-Unique: 9USDJM96PH6QpGMq3FY4GQ-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=yVf0fWOn6OMKCxD5WqaF+MpfG/JuMj495c80z6qsJjg=; b=oIQiPN9o2slI82Prgir4LHI+vUP5Sb/qlkWQ0qGUz2pijAvmxJ86KUd7mUaSHwpx+c 3whjgC3NZnRXAiGEuWEY7RZkWeI7SqwQx5tjq9uQBN6U9vSTHFWoPaPQ4R/GYzzIKmwV M35qBxnWXQJkWFRBiP8eLeIBrh0hJbe+GDjMiidjimdVEZ64v7h/xZlcX/rNWB597f4q bGofmrJhkKGaDj2cojHuKStkYAl2McSc/DvsRZJQPchEa5BOpMv2AHhFj0Ce3wR+3zyn zhLynWxJzE4gsofhUEPRwzzn85T//DekMZpvT1UK5f5VQWOEx/8EylqVaSlI6S9+hRat mE7A== X-Gm-Message-State: AOAM533M/LO666/Y6GrhAzzaCl5HIyUZEkBzWqHc2bFYvp/7gB60i9i9 kPCx5/IxxgOsPhI9z4agjQcXYTRjchz/ X-Google-Smtp-Source: ABdhPJyQ3wifksajJT/VeYDqLqjuUhfO3jfX8IScVpaQeALzXAPpwQzUDhSG3NQ4gdqwB0kTsbIvdw== X-Received: by 2002:a05:620a:22b5:: with SMTP id p21mr1214300qkh.119.1598623846310; Fri, 28 Aug 2020 07:10:46 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 4/7] qemu: Transient option gets avaiable for qcow2 and raw format disk Date: Fri, 28 Aug 2020 10:08:33 -0400 Message-Id: <20200828140836.14266-5-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.78 on 10.11.54.3 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 Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_validate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 488f258d00..82818a4fdc 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2166,9 +2166,12 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDom= ainDiskDef *disk, } =20 if (disk->transient) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("transient disks not supported yet")); - return -1; + if ((disk->src->format !=3D VIR_STORAGE_FILE_QCOW2) && + (disk->src->format !=3D VIR_STORAGE_FILE_RAW)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("transient disks not supported yet")); + return -1; + } } =20 if (disk->iomode =3D=3D VIR_DOMAIN_DISK_IO_NATIVE && --=20 2.27.0 From nobody Sun May 5 05:32:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1598623880; cv=none; d=zohomail.com; s=zohoarc; b=i4TZudrT/lANdDeRyJjz9zUlpkb4z23vPFDsM0mIXQLNVEGhLWRaNTpXwpzBVmrmTVk0hQTydojhRgu9B87T0SeIACoCwQjcAKlAc9kWmifx2VBhegODMTLg4H5T9v4sW5ywwiZWnejWX4zgpgnP3K7p4bo0+XhTPQvOiiL6m4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623880; 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=y/3rjIz2PEdWBsHyC13TSFhgRrOU+ucyl40h+1hfv5o=; b=gRoX36M3sFkT1VVjyV2BiKVH0MY8nqPHF506s+1u7+fzorQvJL0a8IuwNqsO3Ijc35P5kVYVeolLI8EZRN1otu2PKHdo8pKn3XfiZTNgDzexyjHYr/r1n5+/n0ty4yDKimAadOsiEVCmukXsoaarKJwgiN231qAdhf+3yePcVK0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1598623880261487.730879341799; Fri, 28 Aug 2020 07:11:20 -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-265-o7KULr65Nrqip25qxw4XBw-1; Fri, 28 Aug 2020 10:11:16 -0400 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 BFA0010ABDDA; Fri, 28 Aug 2020 14:11:03 +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 9EDEB702FF; Fri, 28 Aug 2020 14:11:03 +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 6A79D181A07E; Fri, 28 Aug 2020 14:11:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEAtdO028169 for ; Fri, 28 Aug 2020 10:10:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C3C2110C573; Fri, 28 Aug 2020 14:10:55 +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 96710110C575 for ; Fri, 28 Aug 2020 14:10:55 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 7D2B9811E7A for ; Fri, 28 Aug 2020 14:10:55 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-6_nKsESzNY6AcJGB0MmioQ-1; Fri, 28 Aug 2020 10:10:49 -0400 Received: by mail-qk1-f195.google.com with SMTP id u3so1018295qkd.9; Fri, 28 Aug 2020 07:10:49 -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 u41sm1084975qth.42.2020.08.28.07.10.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:48 -0700 (PDT) X-MC-Unique: o7KULr65Nrqip25qxw4XBw-1 X-MC-Unique: 6_nKsESzNY6AcJGB0MmioQ-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=y/3rjIz2PEdWBsHyC13TSFhgRrOU+ucyl40h+1hfv5o=; b=d/vf6xf1kSFeMxxNY04B44eYX5m1KnmAji50VIf6Z8vuEYFwe37ZWVzSLt816yiV5+ 1SedFhi83hmkJrJ+4Qfjck8R572Q5SPaVW1+Pk3YIwsZkY3jO3aXYNBLWpXVyAPpYdfW uPRNLS0DLaCWGz+Bncd/7+BBvqJNfhwq5GwuoY1JyyA5N862Gk32vYVUFYPDl+yAHNf5 SBIjF/Kqbu/hKFpq1iAT477LnWKaUdx1qo1DCb/AHIOzjldlhKwRn7dBs4rTgrmDHask FyMhQedlPMYPHa7iMIRxwiUpHXiqMDC6x5pY4NQk3wIlnopmDUTM+GVxU4iSHTo7V2ae GCbw== X-Gm-Message-State: AOAM5329SdYvik4/YXbCcCpwwNTQZAKDjhQaeAoean70NymHTUsv62K8 Zzih1Y9l7WqpHMdoSVyXUzbEDCFISEUR X-Google-Smtp-Source: ABdhPJyXi9BWiwRkZbn7pds2mWJrQFedGUSTF3+upHHoQOOdINWnUVmpxJcrzqWItIJcfC4Nzk+PDg== X-Received: by 2002:a37:5c1:: with SMTP id 184mr894507qkf.99.1598623849060; Fri, 28 Aug 2020 07:10:49 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 5/7] qemu: Block migration when transient disk option is enabled Date: Fri, 28 Aug 2020 10:08:35 -0400 Message-Id: <20200828140836.14266-7-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.78 on 10.11.54.3 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.11 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 Block migration when transient disk option is enabled because migration requires some blockjobs. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_migration.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 0f2f92b211..6fcf5a3a07 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2949,6 +2949,22 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr drive= r, } =20 =20 +static bool +qemuMigrationTransientDiskExists(virDomainDefPtr def) +{ + size_t i; + + for (i =3D 0; i < def->ndisks; i++) { + virDomainDiskDefPtr disk =3D def->disks[i]; + + if (disk->transient) + return true; + } + + return false; +} + + virDomainDefPtr qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps, @@ -2971,6 +2987,12 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE= ))) goto cleanup; =20 + /* + * transient disk option is a blocker for migration + */ + if (qemuMigrationTransientDiskExists(def)) + goto cleanup; + if (dname) { name =3D def->name; def->name =3D g_strdup(dname); --=20 2.27.0 From nobody Sun May 5 05:32:58 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; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1598623873; cv=none; d=zohomail.com; s=zohoarc; b=I514kkfIi6aS2qBpU8N9SAbj8Bj5AKz0mMXDBBVwzxrRcU9uWRWjv4tDnZNS54hZLJeR4DKmtK3Ndlk6kPtAmbRoF5QOHUJwQFspDe+cZ1X1n2xH0vVUIW3Rm4B8IDmdT48mrZLzRWvgATGxpHmzrKapHtYCiEDTD8LI9BlT+g8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623873; 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=qR5xkX0HSF7ihS9JgBKzBqWFDRXVITNq/EqhMeH+zEk=; b=Z/0Fmm0gNPBqFJKluF2PzeFyBu+KU0C27Ifejxq0aws+CE5xaFyWwb+muEUzrWcXjrkMJdBia8dbAqMsLoWOuuvqkQbvPtSaUciDfsm+IiUiVs1pnAwGOV/dOIqVZGdYAOMqO0q6i1Gn2k4s7l1bX28VY66JTmjyE1YWxWwSkqU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1598623873746175.1393003480065; Fri, 28 Aug 2020 07:11:13 -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-428-22Ds_4WOOpGIrd5etM4F9A-1; Fri, 28 Aug 2020 10:11:10 -0400 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 C6F8D83DBBE; Fri, 28 Aug 2020 14:11:02 +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 A2DA21002D46; Fri, 28 Aug 2020 14:11:02 +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 69280181A07C; Fri, 28 Aug 2020 14:11:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEB1D2028200 for ; Fri, 28 Aug 2020 10:11:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id E400F110C576; Fri, 28 Aug 2020 14:11:00 +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 DE68B110C575 for ; Fri, 28 Aug 2020 14:11:00 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (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 C5E82811E80 for ; Fri, 28 Aug 2020 14:11:00 +0000 (UTC) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-459-UZs-uYE6MLSfhrsztrCacA-1; Fri, 28 Aug 2020 10:10:51 -0400 Received: by mail-qk1-f194.google.com with SMTP id m7so1011363qki.12; Fri, 28 Aug 2020 07:10:50 -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 z10sm1092983qtb.17.2020.08.28.07.10.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:50 -0700 (PDT) X-MC-Unique: 22Ds_4WOOpGIrd5etM4F9A-1 X-MC-Unique: UZs-uYE6MLSfhrsztrCacA-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=qR5xkX0HSF7ihS9JgBKzBqWFDRXVITNq/EqhMeH+zEk=; b=I2RgJ+oos2JLPLXT1t8akdQ+sFVQ//59mOqJx3aExtf5peBCsC8UEEooIQYoDefBWr RZPNK2jYAlGkXb+ucGgXXkPtBoQohR8BjbWZDm9pyWwol1zMVlj2qF0OEOzjGhbQiGCX sw52pyP5t4cTPHTU50+9H2l0Vabwev5JRvK5sdKIuSkfUf40y44iyWL7dTymyMPhzLMm n3IclWz+0XiuuS6vyN1cG4TGr3g+QDt8n7lVpWtcqALyyOZNZidKLSQ6tJHD9DKhISW0 g6xRWV3VOgBvRD79zdMXW9fzkAc2fag8l+8NUeFdtK/1BZZJMRRmDa826yJVSS8e9AzJ 7w/Q== X-Gm-Message-State: AOAM532wKBZP15fEdmxEgTlv/bBmW9bJbrBTvIqInfeHXBht5sjyDwC1 hPp0diafZ8keCvdqAKY6RNydfuFku7xw X-Google-Smtp-Source: ABdhPJzUS6/xkSSk8+PRBAlHTx0F4TP3rXfCtBSBfQYv2LoqNuvYjxYGKBOlllW+vWsFgrEDsLY13w== X-Received: by 2002:ae9:e507:: with SMTP id w7mr1331985qkf.264.1598623850352; Fri, 28 Aug 2020 07:10:50 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 6/7] qemu: Block disk hotplug when transient disk option is enabled Date: Fri, 28 Aug 2020 10:08:36 -0400 Message-Id: <20200828140836.14266-8-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.78 on 10.11.54.3 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.84 on 10.5.11.22 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 Block disk hotplug when transient disk option is enabled so far. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_hotplug.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 2c6c30ce03..1c1b6c3acf 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1031,6 +1031,12 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver= Ptr driver, return -1; } =20 + if (disk->transient) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("transient disk hotplug isn't supported")); + return -1; + } + if (virDomainDiskTranslateSourcePool(disk) < 0) goto cleanup; =20 --=20 2.27.0 From nobody Sun May 5 05:32:58 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; 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=1598623878; cv=none; d=zohomail.com; s=zohoarc; b=fOfBdBIj5W7uU+YnHaMjEQ2OSBehrpWV4lejU/mwWG57lv0wy5vrOqcITGdatWFcD3LZd0DOcXkTB04/OaobOjb2U0bOCIE5Py1aA0BBwBxoH0Bv2AUr+U7S646/jKjOk4CVxIH1Hp5KlAd2SqpBkIUYorVxDcvg2xueTR+aqqk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598623878; 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=sl0ecYHQ4yUqIsvD/YpjRe0Byew+z3XNvgRaEwuZZwY=; b=S84UR8MnyOUoHVSInHdpwP/tbqmvgJHN04SRVElET7NGE2Xl+s9Flz4MpZZa+vQY3By0nZr8ddqzf4X/8BYQfiAcMU/fslViQYFRYHOKfbYQI27D6FSyzeg21WrOgcKm0sqxcG897la5D+xNRtrVf/0tE09SNq6m0exIq3kT5zo= 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 1598623878107951.9809353124788; Fri, 28 Aug 2020 07:11:18 -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-348-95v4rOfTOtWGV9LJEBvjzw-1; Fri, 28 Aug 2020 10:11:13 -0400 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 48D07801AAC; Fri, 28 Aug 2020 14:11:06 +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 281928092A; Fri, 28 Aug 2020 14:11:06 +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 E6AF8181A272; Fri, 28 Aug 2020 14:11:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07SEAu25028179 for ; Fri, 28 Aug 2020 10:10:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 68D712156A2D; Fri, 28 Aug 2020 14:10:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 633482156A23 for ; Fri, 28 Aug 2020 14:10:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (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 496C3901841 for ; Fri, 28 Aug 2020 14:10:56 +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-366-4bxULPNiPxatnGvlGSQgJg-1; Fri, 28 Aug 2020 10:10:48 -0400 Received: by mail-qk1-f196.google.com with SMTP id z3so1023519qkz.7; Fri, 28 Aug 2020 07:10:48 -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 d47sm1094341qta.63.2020.08.28.07.10.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2020 07:10:47 -0700 (PDT) X-MC-Unique: 95v4rOfTOtWGV9LJEBvjzw-1 X-MC-Unique: 4bxULPNiPxatnGvlGSQgJg-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=sl0ecYHQ4yUqIsvD/YpjRe0Byew+z3XNvgRaEwuZZwY=; b=H7zV/A1qN006XEVlNDVUJh3ElpG1jV5mjreSPXZK+TmzFDpsC8DNarJu5u0vbK9w6E adnC0RrORpv0BnxpvUOP2QzhjEGl2NK1uxiYISp8XotpfAVhnbGgrdSNmH77/M0JZCEo /885X2nuK9wRuyhZ4xrNn7soFDTD1rkxk7rQA5WMMnlz6wiKUe2fvaDnU9BH0lxbtvTs cXsh5xhsJKQcH1ru2ES8MDZ3e40iWERIoubZ4XOGWGIJyeGDTjO5IpI8qyZnCBb0tTl4 NyIbADYz3agPPbW90EBNYsuTqLiyU3f6OlQsL068+zkpFa8y0IcG4RURV/Lc9I4Qts6L 2dNw== X-Gm-Message-State: AOAM533I8heKnPYU3j+qS3bx6FiDtRubF31TwUYKsmAtCF4Rh7Wufnz5 VrePZDgWoSYuM+sVNm5wtyA70ITwOYDv X-Google-Smtp-Source: ABdhPJzWtENzTgfDZ4iHeXJo++kOUXWYOW6SrqnMwsoaV0lMHTiOoXBsB3Vtt88vWGdveKqvSeEl5Q== X-Received: by 2002:a05:620a:2224:: with SMTP id n4mr1397392qkh.18.1598623847736; Fri, 28 Aug 2020 07:10:47 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v2 7/7] qemu: Block blockjobs when transient disk option is enabled Date: Fri, 28 Aug 2020 10:08:34 -0400 Message-Id: <20200828140836.14266-6-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.78 on 10.11.54.6 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.15 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 Block blockjobs when transient disk option is enabled so far. Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_domain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e28f704dba..98a52e5476 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10678,6 +10678,13 @@ qemuDomainDiskBlockJobIsSupported(virDomainObjPtr = vm, return false; } =20 + if (disk->transient) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("block jobs are not supported on transient disk '= %s'"), + disk->dst); + return false; + } + return true; } =20 --=20 2.27.0