On Tue, Sep 28, 2021 at 10:43 AM Jie Wang <wangjie88@huawei.com> wrote:
block type CDROM also support startupPolicy in the past, so
s/block/Block/

"in the past" could be more detailed. It's better if you tell from which version to which version the
startupPolicy of block type cdrom is supported
let us fix it.

Signed-off-by: Jie Wang <wangjie88@huawei.com>
---
 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)
     }

     if (def->startupPolicy != 0 &&
-        virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE) {
+        (virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_FILE &&
+         virStorageSourceGetActualType(def->src) != VIR_STORAGE_TYPE_BLOCK)) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("'startupPolicy' is only valid for 'file' type volume"));
+                       _("'startupPolicy' is only valid for 'file' or 'block' type volume"));
         return -1;
     }

--
2.24.0.windows.2