From nobody Sun May 19 05:50:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=huawei.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163279696680514.245472072342409; Mon, 27 Sep 2021 19:42:46 -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-300-aKtuc5MOMHW3oSLetViZDg-1; Mon, 27 Sep 2021 22:42:43 -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 D30E51084683; Tue, 28 Sep 2021 02:42:38 +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 59DB85D740; Tue, 28 Sep 2021 02:42:38 +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 687E14EA2A; Tue, 28 Sep 2021 02:42:37 +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 18S2gZtj015015 for ; Mon, 27 Sep 2021 22:42:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 97C75201B06D; Tue, 28 Sep 2021 02:42:35 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92F93201B06C for ; Tue, 28 Sep 2021 02:42:32 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D253C800B24 for ; Tue, 28 Sep 2021 02:42:32 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-8fWneoeTPHeIkO3UqCyLHw-1; Mon, 27 Sep 2021 22:42:30 -0400 Received: from dggeml751-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4HJNWG11hYzRQvw; Tue, 28 Sep 2021 10:19:54 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeml751-chm.china.huawei.com (10.1.199.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Tue, 28 Sep 2021 10:24:10 +0800 X-MC-Unique: aKtuc5MOMHW3oSLetViZDg-1 X-MC-Unique: 8fWneoeTPHeIkO3UqCyLHw-1 From: Jie Wang To: Subject: [PATCH] conf: fix block type CDROM cannot support startupPolicy Date: Tue, 28 Sep 2021 10:21:12 +0800 Message-ID: <20210928022112.688355-1-wangjie88@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeml751-chm.china.huawei.com (10.1.199.150) X-CFilter-Loop: Reflected 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-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 18S2gZtj015015 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, weidong.huang@huawei.com, wangjie88@huawei.com 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: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1632796967649100001 Content-Type: text/plain; charset="utf-8" block type CDROM also support startupPolicy in the past, so let us fix it. Signed-off-by: Jie Wang --- src/conf/domain_conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f7025bffe4..dd374e8ab3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -30853,9 +30853,10 @@ virDomainDiskTranslateSourcePool(virDomainDiskDef = *def) } =20 if (def->startupPolicy !=3D 0 && - virStorageSourceGetActualType(def->src) !=3D VIR_STORAGE_TYPE_FILE= ) { + (virStorageSourceGetActualType(def->src) !=3D VIR_STORAGE_TYPE_FIL= E && + virStorageSourceGetActualType(def->src) !=3D VIR_STORAGE_TYPE_BLO= CK)) { virReportError(VIR_ERR_XML_ERROR, "%s", - _("'startupPolicy' is only valid for 'file' type vo= lume")); + _("'startupPolicy' is only valid for 'file' or 'blo= ck' type volume")); return -1; } =20 --=20 2.24.0.windows.2