From nobody Fri May 3 06:26:25 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; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1600349603; cv=none; d=zohomail.com; s=zohoarc; b=TCVwUpGzjQVhwRWi/tuyHSwIx8KeVdx1HQ+nEqTjohelRvs5Ad+86i+48orV/vyIw20zPIpFA7uyoM8Y2CBPpPiXT5Aeun1+o3XF2jr10SVWVSjLHa36sD8aVCZ4iVKRhDdzWXmhdQJXKXPPMN3/WssSSObUWaaL1oSlbdOPkdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600349603; 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=gc4bPfkdVah5CeXmJyl/rwckN5docj/c1JhbMds3NvI=; b=IEZ1tNv6GVVNIb17isK0RDObVhh5uffDmi7T9Ret0W3i5PKiZ4Duqw3bkZ1qP6ZnEP4hP33UBMM2kYu+3+DWbKdjfYYcf0TEvKgSRt7YgqOg9zIjbRyXpKfIoH490VDZpJLJKulBzxV0s7lROiGTqbPtFuZLBYarkIVE5s/T7Bo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600349603891659.5775989698034; Thu, 17 Sep 2020 06:33:23 -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-425-dLiwVZ6ZPrmyb0V0rZkrQA-1; Thu, 17 Sep 2020 09:33:20 -0400 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 004BF104D3E8; Thu, 17 Sep 2020 13:33:14 +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 CBE6819D7C; Thu, 17 Sep 2020 13:33:13 +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 91E4D183D044; Thu, 17 Sep 2020 13:33:13 +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 08HDVC8n006208 for ; Thu, 17 Sep 2020 09:31:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6AAB8100C286; Thu, 17 Sep 2020 13:31:12 +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 5FBD6115D7BC for ; Thu, 17 Sep 2020 13:31:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 7EAAB85828D for ; Thu, 17 Sep 2020 13:31:07 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-GKUD2WSyMnSKaYhWE0kPZw-1; Thu, 17 Sep 2020 09:30:59 -0400 Received: by mail-qt1-f194.google.com with SMTP id b2so1798551qtp.8; Thu, 17 Sep 2020 06:30:59 -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 n1sm1602224qte.91.2020.09.17.06.30.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 06:30:58 -0700 (PDT) X-MC-Unique: dLiwVZ6ZPrmyb0V0rZkrQA-1 X-MC-Unique: GKUD2WSyMnSKaYhWE0kPZw-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=gc4bPfkdVah5CeXmJyl/rwckN5docj/c1JhbMds3NvI=; b=L54IKbDyIUYa2eSm1Fe+fJb2oO+kx8pqbob3VCgmpe58rmQIG9KJXkG0uTLEYG6XJb RlrkQ25aomdUZoyjlK5VyN8irMN9jZgzOouamgEirXW9fn5NIeTx/XI6UsdnwtbhFVcd lH9lOsCc6a9n/ieWqtXkjsOuVcygl8IRdd8aKqDyUiP4hnDA/HXOhh7G/QyEpoqJlb4C cc92jwL/cbSIWfC79dRfcrUiKqgNCBLVqFDhTEKPm4nzxPltBU+YK1pZ0hFojf4w1qqt TSPZfG0Sa/j0dph0+lKs395D4aQr3yoDvTu69otbsPEfZVu+SBt0LlNezKOfx0LT+wce Iq1g== X-Gm-Message-State: AOAM5308fLrms44oJgfQ5w/4nTUSUbjPbtVyXPJPkh5a7ABXddqx0RJR U9YHIPT4rJgxPZp3hvO9CXBYwu/SZA== X-Google-Smtp-Source: ABdhPJx6EBkeJDpCwB82CvUqFIVxcaguEnxHgj1ozTnAYf3sx/QDDnqLEB56TkCOYjl5Omw7VCfj8Q== X-Received: by 2002:aed:3584:: with SMTP id c4mr26522772qte.84.1600349458888; Thu, 17 Sep 2020 06:30:58 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v3 1/6] qemu: Block blockjobs when transient disk option is enabled Date: Thu, 17 Sep 2020 09:30:40 -0400 Message-Id: <20200917133045.5719-2-msys.mizuma@gmail.com> In-Reply-To: <20200917133045.5719-1-msys.mizuma@gmail.com> References: <20200917133045.5719-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.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 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 Reviewed-by: Peter Krempa --- 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 785cee6f18..1ce0f70971 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -10794,6 +10794,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 From nobody Fri May 3 06:26:25 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=1600349654; cv=none; d=zohomail.com; s=zohoarc; b=Li/jaARFxhkpAukuQWckll18YdvYOM5N3m63TPpFNbpcAu1d6tGvaAoTbJXD2V5zbpaoqrqQpGwBwFylGDFeaRCbQqyRZq76nmihhIeE3arZBNcy82vmjdrbvnBXv89NSFgsge+g5yo3jOlPGZuwVEk9VruB+JqBrs1GWDCMGi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600349654; 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=+NfPJssv0hF6KN2XvYrjBa+x0UVGqAqoaorkTFEMrM8=; b=fUbMaR1ZogIANDrsY7Fw49Se7CpoqEBs2eRCobGKJiTIS4K0Y1gPD2HZgHJR4J0gP4Cay+sPdL2JgsTQE2/5NB1PbBjUnklekdOZGnIKy3QPrJajzwyedBiIYio9nfLnNwZbvmWDzLLMcbZw1IbpxHEHeOc2EHVd0NEnqOF2PAc= 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 1600349654439126.61923641786655; Thu, 17 Sep 2020 06:34: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-194-tWK7EznKM0Cza3DmaKWYDA-1; Thu, 17 Sep 2020 09:34:02 -0400 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 B960F18BA292; Thu, 17 Sep 2020 13:33:56 +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 8B5B419930; Thu, 17 Sep 2020 13:33: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 4AF80183D041; Thu, 17 Sep 2020 13:33:56 +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 08HDV74n006165 for ; Thu, 17 Sep 2020 09:31:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D45010FF00; Thu, 17 Sep 2020 13:31:07 +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 26AA010FF21 for ; Thu, 17 Sep 2020 13:31:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.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 0CE7888FA2B for ; Thu, 17 Sep 2020 13:31:07 +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-288-YA9Wz4wkPAaKC21Qr61ObQ-1; Thu, 17 Sep 2020 09:31:02 -0400 Received: by mail-qk1-f196.google.com with SMTP id q63so2172063qkf.3; Thu, 17 Sep 2020 06:31:01 -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 i62sm22180825qkf.36.2020.09.17.06.30.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 06:31:00 -0700 (PDT) X-MC-Unique: tWK7EznKM0Cza3DmaKWYDA-1 X-MC-Unique: YA9Wz4wkPAaKC21Qr61ObQ-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=+NfPJssv0hF6KN2XvYrjBa+x0UVGqAqoaorkTFEMrM8=; b=rXjcxjJ6+PQ6PBI063ho6Z4ekENvpHushRKyJ0MS+4Om69xUGybRWgGO2aLNkLONij 8hJcevaX7hJg4sH9JcEu5/5t1nFHkurl6OlSLapu+dv5Zm67N8UCKK2mRNqa/bAVUo5S j9NACNJpCzQS42J/wQ5oEcOMSTkU8K+rV1VrCysd4T8V69hqZOPiriNKF5MaHzcv/MuM ky7u5EkX6iqJ+nendAf74biglM7HkdR46w7/lAwT2uVBRFMOoOfK+TcQ8U0++kbeGd/L Ja46VwbRdsvFrtv+uauPdUIALBwNq7RcWU8k+ahRLkcodrfpd3g9W81sDM6TJl6XQC4h h21w== X-Gm-Message-State: AOAM530WpUY30Fe1G7rHzS6F99oXJJkKL0yW468JsCBiTA4xV5AYbo87 4AIF3Aknk3JkAv1tsk1NfDcAF+M1CQ== X-Google-Smtp-Source: ABdhPJxz7821QlBgZzeaQwFBY40D7cWD+Tg+/WBgyrgLiAbbPIjMHAT6fsVQjN3WyFwOSFaCy0wAeQ== X-Received: by 2002:a37:9442:: with SMTP id w63mr27185467qkd.398.1600349460834; Thu, 17 Sep 2020 06:31:00 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v3 2/6] qemu: Block disk hotplug when transient disk option is enabled Date: Thu, 17 Sep 2020 09:30:41 -0400 Message-Id: <20200917133045.5719-3-msys.mizuma@gmail.com> In-Reply-To: <20200917133045.5719-1-msys.mizuma@gmail.com> References: <20200917133045.5719-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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 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 Reviewed-by: Peter Krempa --- 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 e2c6e14c2e..20dcec7b65 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 Fri May 3 06:26:25 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=1600349590; cv=none; d=zohomail.com; s=zohoarc; b=oGeSa7czXnp4Vd4Lo8xVoSzQ8k6Oc1OlU2J6bRnMbqkZxpe3htNAtiCWDZblvxbRSYbGWduFjDsm0cW6nuNWtRrIz9DSBOaJ8lUA+sQdqAbIoBLa7EZe58wVeSnemt4KcMRDnWiq42kVCKwUWHj29ibFEODxRh9iFUmRqzg1Zxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600349590; 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=i3VCBtO/16wacmfLC+ofvS7zR4hU8QC8uYpnDlI6VUE=; b=FqI2ed9vGoWF40/ZC6jneErA6m0LTRL2ZqWioS3PeXUUspUSFvJx9f8KwoSzh/GamPllOfZelvUCINRKiquVOqOvUDLSYr8WgdhgTeN7EhnGAT6V9SRdvkcyz4lpj86sJC37bJnjDtSXSQNxy+9g0exc7p53lTJH26PH18Jm6V0= 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 1600349590032755.8387849573814; Thu, 17 Sep 2020 06:33: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-181-2ionKMfxMkinaEQFJFl0Ug-1; Thu, 17 Sep 2020 09:33:06 -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 C65051019635; Thu, 17 Sep 2020 13:32: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 D4E3E67CF0; Thu, 17 Sep 2020 13:32:55 +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 5859744A77; Thu, 17 Sep 2020 13:32:54 +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 08HDV8Fi006172 for ; Thu, 17 Sep 2020 09:31:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 031F510FF21; Thu, 17 Sep 2020 13:31:08 +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 F07DA10FF1C for ; Thu, 17 Sep 2020 13:31:07 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 D7F10900C61 for ; Thu, 17 Sep 2020 13:31:07 +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-381-uVngs3dCOZyoAsF-Sqy8Mg-1; Thu, 17 Sep 2020 09:31:03 -0400 Received: by mail-qk1-f193.google.com with SMTP id f142so2117709qke.13; Thu, 17 Sep 2020 06:31:03 -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 p187sm11940425qkd.129.2020.09.17.06.31.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 06:31:01 -0700 (PDT) X-MC-Unique: 2ionKMfxMkinaEQFJFl0Ug-1 X-MC-Unique: uVngs3dCOZyoAsF-Sqy8Mg-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=i3VCBtO/16wacmfLC+ofvS7zR4hU8QC8uYpnDlI6VUE=; b=B7H9l7tKn8x9qdyIn2huQIU/984p0IVvZk9neCD8/LN1rQEMxh4yrX4TymRg5Whsrh QOQQS/AMl2D6yDScPp9SqKng6YswZIT/zyGLo0Ca4TaWu/pKbVbH7ipvYBjSvikp1rwE tNtTX2SqMfKa/iz4eK9bQFaLidlvD8nTQgkhXaiulmYb4R4FjkTGSBlCt/LlMhiYDNya cgB99DvdvZNgCLF8+qNEC4itMYVQ9UnA81agEu8YCXW8ULHq1potMjzVKTYbCpH0brYS uNpf4ZJnZWm7+2xlTL+c/T2kyo2uLNVMENeL3bHSAep1e/zFbYTBK56/U2C8erinmq54 NQxQ== X-Gm-Message-State: AOAM533ItXC9Hma7Xxdxm9E2xe4ZH/e2AXRVDXtESgdp100JvP1Danpd OFGDIf7RtZVGPu7ud5Ceqy43kgF7XQ== X-Google-Smtp-Source: ABdhPJyQsM8bfWKH+CZEwNgblXIqOIABgH+lhWuaMJRzRfapwc/JYFtzBmNmrTMJ9dg7jOwWLX1+Sw== X-Received: by 2002:a37:bcc:: with SMTP id 195mr27381518qkl.287.1600349462347; Thu, 17 Sep 2020 06:31:02 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v3 3/6] qemu: Block migration when transient disk option is enabled Date: Thu, 17 Sep 2020 09:30:42 -0400 Message-Id: <20200917133045.5719-4-msys.mizuma@gmail.com> In-Reply-To: <20200917133045.5719-1-msys.mizuma@gmail.com> References: <20200917133045.5719-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 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 Reviewed-by: Peter Krempa --- src/qemu/qemu_migration.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a530c17582..7316d74677 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1397,6 +1397,16 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, _("cannot migrate this domain without dbus-vmst= ate support")); return false; } + + for (i =3D 0; i < vm->def->ndisks; i++) { + virDomainDiskDefPtr disk =3D vm->def->disks[i]; + + if (disk->transient) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("migration with transient disk is not support= ed")); + return false; + } + } } =20 return true; --=20 2.27.0 From nobody Fri May 3 06:26:25 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; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1600349601; cv=none; d=zohomail.com; s=zohoarc; b=bvjnnMXovypocpFpf/2LpSKT2SMgmvs2iO28G0x+RosdTfmYP9+4UL8Krv7gg4Z91YtzEAdDjgPojwq29c7jztx8rdZxV7VRzzxhahiSYWiC65NpUfJ61yIX1IHWGhhmn8uyR7/2WtrupfWux6FduTLswc8iYgKqx6UricxGCNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600349601; 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=ebtsZjjVjxRPBXRvbDRi68g+mNUvv3nY1aP3qRQSGew=; b=LyuMvy40sWH2n/eu1kJ9aINVWlkfi5X+vD71yDPxmAAvL/QM7EhDwTQXXV5lKUYw95Dnye3CL+tqHPQ09xIwdFuHAw8VUePGCI6gSQvL2ZBFBTPQr82YWyoSJAgqLO8UqADFatg2f4C2/+pHU1ewVviY2nFhbVpJDp2HVbBjMq0= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1600349601657189.560345190372; Thu, 17 Sep 2020 06:33:21 -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-267-EZ1uHOF-MtKyttnbfKLoiw-1; Thu, 17 Sep 2020 09:33:18 -0400 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 D49F080EDA4; Thu, 17 Sep 2020 13:33:10 +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 AD9EE73662; Thu, 17 Sep 2020 13:33:10 +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 70BA1183D040; Thu, 17 Sep 2020 13:33:10 +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 08HDV8p5006181 for ; Thu, 17 Sep 2020 09:31:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB6DE10FF21; Thu, 17 Sep 2020 13:31:08 +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 A5D5F10FF00 for ; Thu, 17 Sep 2020 13:31:08 +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 8E598182CDA8 for ; Thu, 17 Sep 2020 13:31:08 +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-296-Jg5b15AqOx246KJBxwiAGw-1; Thu, 17 Sep 2020 09:31:05 -0400 Received: by mail-qk1-f195.google.com with SMTP id w16so2152177qkj.7; Thu, 17 Sep 2020 06:31:04 -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 w6sm21229546qti.63.2020.09.17.06.31.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 06:31:03 -0700 (PDT) X-MC-Unique: EZ1uHOF-MtKyttnbfKLoiw-1 X-MC-Unique: Jg5b15AqOx246KJBxwiAGw-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=ebtsZjjVjxRPBXRvbDRi68g+mNUvv3nY1aP3qRQSGew=; b=nvRNoQH62UYbV9npAhcgLhk8RChCdSpZLJ5YTJOk+6xkhR1Vswh/pHl159wn+8HiD/ 60G0z5Fe7SkSQ5G6el663mo2vNR57w30d9e9PiAbIlM87HJRI1QhmT37gQMszkqAx3EO ibNclVXnPNWEmedriNLGBIfQE3RW9nTNVvokeABAxTC3jl9lU8FzeYaS16XPQGuhsK6Q EoenUiLcLrdK8+Wmvx40r7TTu9sZ2Goce7lD8EGCXT6B9Y2Rhc2WFrEqcVtpW44WKyr+ in3U/nkPoGykyMUCfH69FIKSVX8sIe/JdoXDuU4giBnOroUCbka4WfwFTEPdeRHl8els bjdQ== X-Gm-Message-State: AOAM530wNrnJljNgsr6x3hZ1MNtz9k1OUOeJQGWbH11pq1gOdRcnqus7 JT5+Dxr+LQTDhUfjeEqunjS8uedB2A== X-Google-Smtp-Source: ABdhPJzoX1x8ZPr0NjW0IX5WiAQfeaHktMBLfqYPu1bEwCCAN2l1G8un5FeKX9Nrq97jyfNHaDHvZg== X-Received: by 2002:a05:620a:134f:: with SMTP id c15mr26578335qkl.316.1600349464257; Thu, 17 Sep 2020 06:31:04 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v3 4/6] qemu: update the validation for transient disk option Date: Thu, 17 Sep 2020 09:30:43 -0400 Message-Id: <20200917133045.5719-5-msys.mizuma@gmail.com> In-Reply-To: <20200917133045.5719-1-msys.mizuma@gmail.com> References: <20200917133045.5719-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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Masayoshi Mizuma Update validation of transient disk option. The option for qemu is supported with under condistions. - qemu has blockdev feature=20 - the type is file and the format is qcow2 and raw - writable disk Signed-off-by: Masayoshi Mizuma --- src/qemu/qemu_validate.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 070f1c962b..9cf78ca0c9 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2002,6 +2002,28 @@ qemuValidateDomainDeviceDefDiskSerial(const char *va= lue) } =20 =20 +static int +qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk, + virQEMUCapsPtr qemuCaps) +{ + if ((!qemuCaps) || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) + return false; + + if (disk->src->readonly) + return false; + + if ((disk->src->format !=3D VIR_STORAGE_FILE_QCOW2) && + (disk->src->format !=3D VIR_STORAGE_FILE_RAW) && + (disk->src->type !=3D VIR_STORAGE_TYPE_FILE)) { + return false; + } + + if (virStorageSourceIsEmpty(disk->src)) + return false; + + return true; +} + static int qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, virQEMUCapsPtr qemuCaps) @@ -2186,7 +2208,8 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDoma= inDiskDef *disk, } } =20 - if (disk->transient) { + if ((disk->transient) && + !qemuValidateDomainDeviceDefDiskTransient(disk, qemuCaps)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("transient disks not supported yet")); return -1; --=20 2.27.0 From nobody Fri May 3 06:26:25 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=1600349649; cv=none; d=zohomail.com; s=zohoarc; b=DDM1EObI5y3029oC9EJZTCVgiu7LpdxLnO4te8FHygqwX9Ul03rgFV+FiU1gleNrHkTD3mtNa4PXdtxXiKxf3hBE20oUxYEwV/mXXK7pEpUk/WQtrZxvok1qn34zQWl2SfOeJZgRa/iO94sX9+TLaTUC26KWAZdaPTjkKWoE7BU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600349649; 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=FYSlf4YsUjWY8YE2BmB2JpTz0jjf1CbOYRrbGGAXy5w=; b=lmRUhsK6dHgiAz6rxdsHHPW6fMF4eX9ZCExk7UyuYx46gEHOR77obihDL7LWe1g3jB/awWemKxV0O0lJv7gNnNBrAetgQHE6+ToxhsCewTwuOM7JccG2pfCkfjUQNQrJxPDF5LbTJPy2cTpzIrSy516MoYqOlVRumCBGxvRfTi4= 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 1600349649251547.9666027669693; Thu, 17 Sep 2020 06:34:09 -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-238-lQHpX423Ph6BgDpL2grBhQ-1; Thu, 17 Sep 2020 09:34:05 -0400 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 78840801E53; Thu, 17 Sep 2020 13:33:59 +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 52F935DEB8; Thu, 17 Sep 2020 13:33:59 +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 195B044A7C; Thu, 17 Sep 2020 13:33:59 +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 08HDVB6A006200 for ; Thu, 17 Sep 2020 09:31:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7D22A10FF37; Thu, 17 Sep 2020 13:31:11 +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 757131108C1 for ; Thu, 17 Sep 2020 13:31:11 +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 5D4E888FA1E for ; Thu, 17 Sep 2020 13:31:11 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-9-qRU0I0MXi8HjvazbKkiA-1; Thu, 17 Sep 2020 09:31:06 -0400 Received: by mail-qt1-f196.google.com with SMTP id n10so1824887qtv.3; Thu, 17 Sep 2020 06:31:06 -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 201sm21666021qkf.103.2020.09.17.06.31.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 06:31:05 -0700 (PDT) X-MC-Unique: lQHpX423Ph6BgDpL2grBhQ-1 X-MC-Unique: 9-qRU0I0MXi8HjvazbKkiA-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=FYSlf4YsUjWY8YE2BmB2JpTz0jjf1CbOYRrbGGAXy5w=; b=FS3fGA7x4hy0Ph7XHwHmZo6c4/hYxZdDJRy+3J9UrCbuDzxHlAgdrTiqcY4o9yiiYm bzRIN+4n0OBCXTlalamQLj1PgFKaaH2q48sjXGzKuqcXcsUpHB2ToAqDIN09c9J5ZdC9 1NZebv2kGPBOG34k/0CaseqKfaT+z5lEJgaecRjEdsT5Tdjy8j53n9cwBISs9nutcXLM GyApgqia9IWdT9Y10t236iRiXQcTyoOotUkZ1RKJRJR3uiKXmqQ6k2Uynd8snIEusciA h6uGdZGqjK4AMP10c2j8i8H7nMXpclPQMTNX3AZQnB2T6+Qaw2qZ9P60YIZrhCW3aFWu 1Zig== X-Gm-Message-State: AOAM532vvNXJMfqe5b4rdU/3g0DeYbvzdpq/f05X/HVDoV/sToxA/stF arbUD1cYwVePY7pR5IP/Qng4JutXYQ== X-Google-Smtp-Source: ABdhPJxrCWayG3Yl/1MEc+QJnjCbkyKuIOg5zdlvSiPMhGJUUZhmk8UqZb3MvuIcotXhgnt6sp5bZg== X-Received: by 2002:ac8:bc9:: with SMTP id p9mr15896806qti.50.1600349465847; Thu, 17 Sep 2020 06:31:05 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v3 5/6] qemu: Introduce to handle transient disk Date: Thu, 17 Sep 2020 09:30:44 -0400 Message-Id: <20200917133045.5719-6-msys.mizuma@gmail.com> In-Reply-To: <20200917133045.5719-1-msys.mizuma@gmail.com> References: <20200917133045.5719-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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 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 | 103 +++++++++++++++++++++++++++++++++++--- src/qemu/qemu_snapshot.h | 5 ++ src/util/virstoragefile.c | 2 + src/util/virstoragefile.h | 4 ++ 4 files changed, 107 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 1e8ea80b22..67fdc488e0 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1158,7 +1158,8 @@ qemuSnapshotCreateDiskActive(virQEMUDriverPtr driver, virHashTablePtr blockNamedNodeData, unsigned int flags, virQEMUDriverConfigPtr cfg, - qemuDomainAsyncJob asyncJob) + qemuDomainAsyncJob asyncJob, + bool domSave) { qemuDomainObjPrivatePtr priv =3D vm->privateData; g_autoptr(virJSONValue) actions =3D NULL; @@ -1201,17 +1202,26 @@ qemuSnapshotCreateDiskActive(virQEMUDriverPtr drive= r, =20 virDomainAuditDisk(vm, dd->disk->src, dd->src, "snapshot", rc >=3D= 0); =20 - if (rc =3D=3D 0) + if (rc =3D=3D 0) { qemuSnapshotDiskUpdateSource(driver, vm, dd, blockdev); + + if (dd->disk->transient) { + /* Mark the transient working is completed to make sure we= can */ + /* remove the transient disk when the guest is shutdown. */ + dd->disk->src->transientEstablished =3D true; + } + } } =20 if (rc < 0) goto cleanup; =20 - if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0 || - (vm->newDef && virDomainDefSave(vm->newDef, driver->xmlopt, - cfg->configDir) < 0)) - goto cleanup; + if (domSave) { + if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0 || + (vm->newDef && virDomainDefSave(vm->newDef, driver->xmlopt, + cfg->configDir) < 0)) + goto cleanup; + } =20 ret =3D 0; =20 @@ -1349,7 +1359,7 @@ qemuSnapshotCreateActiveExternal(virQEMUDriverPtr dri= ver, =20 if ((ret =3D qemuSnapshotCreateDiskActive(driver, vm, snap, blockNamedNodeData, flags, cfg, - QEMU_ASYNC_JOB_SNAPSHOT)) < 0) + QEMU_ASYNC_JOB_SNAPSHOT, true)= ) < 0) goto cleanup; =20 /* the snapshot is complete now */ @@ -2264,3 +2274,82 @@ qemuSnapshotDelete(virDomainObjPtr vm, cleanup: return ret; } + + +static int +qemuSnapshotSetupTransientDisk(virDomainSnapshotDiskDefPtr def, + virStorageSourcePtr src) +{ + g_autoptr(virStorageSource) trans =3D NULL; + + if (!(trans =3D virStorageSourceNew())) + return -1; + + trans->path =3D g_strdup_printf("%s.TRANSIENT", src->path); + if (virFileExists(trans->path)) { + virReportError(VIR_ERR_INVALID_ARG, + _("Transient disk '%s' for '%s' exists"), + trans->path, src->path); + return -1; + } + + trans->type =3D VIR_STORAGE_TYPE_FILE; + trans->format =3D VIR_STORAGE_FILE_QCOW2; + + def->src =3D g_steal_pointer(&trans); + + return 0; +} + + +int +qemuSnapshotCreateTransientDisk(virQEMUDriverPtr driver, + virDomainObjPtr vm, + int asyncJob) +{ + int rc; + size_t i; + virDomainMomentObjPtr snap =3D NULL; + g_autoptr(virDomainSnapshotDef) snapdef =3D NULL; + g_autoptr(virHashTable) blockNamedNodeData =3D NULL; + qemuDomainObjPrivatePtr priv =3D vm->privateData; + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(priv->dr= iver); + + if (!(snapdef =3D virDomainSnapshotDefNew())) + return -1; + + snapdef->parent.name =3D g_strdup_printf("transient"); + + snapdef->ndisks =3D vm->def->ndisks; + if (VIR_ALLOC_N(snapdef->disks, snapdef->ndisks) < 0) + return -1; + + for (i =3D 0; i < vm->def->ndisks; i++) { + virDomainDiskDefPtr disk =3D vm->def->disks[i]; + virDomainSnapshotDiskDefPtr snapdisk =3D &(snapdef->disks[i]); + + if (disk->transient) { + if ((rc =3D qemuSnapshotSetupTransientDisk(snapdisk, disk->src= )) < 0) + return -1; + + } else { + snapdisk->snapshot =3D VIR_DOMAIN_SNAPSHOT_LOCATION_NONE; + } + } + + if (!(snap =3D virDomainSnapshotAssignDef(vm->snapshots, snapdef))) + return -1; + + if (!(blockNamedNodeData =3D qemuBlockGetNamedNodeData(vm, asyncJob))) + goto cleanup; + + /* The last argument domSave is false here because transient disk conf= ig */ + /* is volatile so we don't need to save it. */ + rc =3D qemuSnapshotCreateDiskActive(driver, vm, snap, blockNamedNodeDa= ta, + 0, cfg, asyncJob, false); + + cleanup: + virDomainSnapshotObjListRemove(vm->snapshots, snap); + + return rc; +} diff --git a/src/qemu/qemu_snapshot.h b/src/qemu/qemu_snapshot.h index 8b3ebe87b1..d57ef4b8a4 100644 --- a/src/qemu/qemu_snapshot.h +++ b/src/qemu/qemu_snapshot.h @@ -53,3 +53,8 @@ int qemuSnapshotDelete(virDomainObjPtr vm, virDomainSnapshotPtr snapshot, unsigned int flags); + +int +qemuSnapshotCreateTransientDisk(virQEMUDriverPtr driver, + virDomainObjPtr vm, + int asyncJob); diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 97a346db28..636f27ef09 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2456,6 +2456,8 @@ virStorageSourceCopy(const virStorageSource *src, def->ssh_host_key_check_disabled =3D src->ssh_host_key_check_disabled; def->ssh_user =3D g_strdup(src->ssh_user); =20 + def->transientEstablished =3D src->transientEstablished; + return g_steal_pointer(&def); } =20 diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 87763cf389..0dc275c11e 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -384,6 +384,10 @@ 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; + + /* set to true if the storage source is setup as a transient disk. */ + /* The changes to the disk are dropped after the guest machine is shut= down. */ + bool transientEstablished; }; =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSource, virObjectUnref); --=20 2.27.0 From nobody Fri May 3 06:26:25 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=1600349606; cv=none; d=zohomail.com; s=zohoarc; b=Xb4ubx6M+mY8/5ZvSd2OcVrPU0052se2U75qlNrIIXfxBtRJ8j72CXCpIk4Y3dRZDEZkd5CGVUr6PZLEHnUy89kK3Leh0s3Pi8gbMibBE+RuqdLZCumPE+gMlQlCwffsxuc8ZecMh47qLij/n2cc2S1dmIsfm3IiFnjp/SuC2b0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600349606; 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=rrogj3J4wH7/EXjt0KY/YKMYhMWwYAmtkBmy3TasUms=; b=ir7MQ1WJLevLyKjqVz0ogSoiXwU4O90Qxb0lJ/+saJSQzq9NUO56o2rAbsRw8MOGIEbn73MCrq1qbXmwOwGaoPZPvX1rBG7Cqf0NX6rPlDugTaMWhGYJBdy5QdH1nb526A1WrJ8+UK0rQ1f8WtKU0qKyTQJY/pMvVANlF62Qm8I= 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 1600349606450499.93213148081645; Thu, 17 Sep 2020 06:33:26 -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-295-tyjI5t4QPPmVhlciCwv_Iw-1; Thu, 17 Sep 2020 09:33:23 -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 C8B72871803; Thu, 17 Sep 2020 13:33:16 +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 A29461000239; Thu, 17 Sep 2020 13:33:16 +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 69991183D048; Thu, 17 Sep 2020 13:33:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08HDVFYj006223 for ; Thu, 17 Sep 2020 09:31:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2E4202028DCC; Thu, 17 Sep 2020 13:31:15 +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 280472026F94 for ; Thu, 17 Sep 2020 13:31:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 D971488FA2E for ; Thu, 17 Sep 2020 13:31:10 +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-261-Jj2MVXw4PHam2SwltS9iCg-1; Thu, 17 Sep 2020 09:31:08 -0400 Received: by mail-qk1-f193.google.com with SMTP id d20so2173051qka.5; Thu, 17 Sep 2020 06:31:07 -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 x197sm20675296qkb.17.2020.09.17.06.31.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 06:31:06 -0700 (PDT) X-MC-Unique: tyjI5t4QPPmVhlciCwv_Iw-1 X-MC-Unique: Jj2MVXw4PHam2SwltS9iCg-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=rrogj3J4wH7/EXjt0KY/YKMYhMWwYAmtkBmy3TasUms=; b=qeH+3UYMRi9sW70tTi29ujhIwcn5aF88VIi+Mft8NBVKVRq2OV0ewULqghbUrZvsv4 UuN+zwz0YZC7UQkMFRwgw3lR44wMaaPZwLM/opHY0VekFX5jXWYKaJAakG8uy0OdE+Lr 1B5on+vb2ciYif8RF6joY3aO/UvajPcP0fPX8ML2lzilx7pm3xgSpi8KGSAt09Sr7RDD +jk/qquYw8t/ZCXVE94t3SLZXIZKXIgrNLTT7o6OW9vM2cV4CgIqTqj/ZVmMQvlHtBq5 sAaZxv4YsVqgNfymVTBE205Fv9kju8YG5Qctb20X2q6y2+r2ZgEHdxKAX5zdMXeEe5oj z3JA== X-Gm-Message-State: AOAM531nw0F9ajwAJ/RXsISM4uwVqDZZ7uBRdm1sYBkhetZ7Q2dYfiBn WctETw72Qs1zwddzxbmcK1fUrg0yyQ== X-Google-Smtp-Source: ABdhPJx6/sGLTZlm2ja+kapRH/Yd9SdV0Co987gQmi66u9q82keoL/R8TD+ND+1TC7oK3Pv0hp0SWQ== X-Received: by 2002:a37:6108:: with SMTP id v8mr27781719qkb.264.1600349467281; Thu, 17 Sep 2020 06:31:07 -0700 (PDT) From: Masayoshi Mizuma To: libvirt-list@redhat.com, Eric Blake , Peter Krempa Subject: [PATCH v3 6/6] qemu: Add transient disk handler to start and stop the guest Date: Thu, 17 Sep 2020 09:30:45 -0400 Message-Id: <20200917133045.5719-7-msys.mizuma@gmail.com> In-Reply-To: <20200917133045.5719-1-msys.mizuma@gmail.com> References: <20200917133045.5719-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.4 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 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b1af35b933..387b8071f4 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" @@ -7053,6 +7054,10 @@ qemuProcessLaunch(virConnectPtr conn, qemuProcessAutoDestroyAdd(driver, vm, conn) < 0) goto cleanup; =20 + VIR_DEBUG("Setting up transient disk"); + if (qemuSnapshotCreateTransientDisk(driver, vm, asyncJob) < 0) + goto cleanup; + ret =3D 0; =20 cleanup: @@ -7689,6 +7694,11 @@ void qemuProcessStop(virQEMUDriverPtr driver, } =20 qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src); + + if ((disk->transient) && (disk->src->transientEstablished)) { + VIR_DEBUG("unlink transient disk: %s", disk->src->path); + unlink(disk->src->path); + } } } =20 --=20 2.27.0