[PATCH] conf: fix block type CDROM cannot support startupPolicy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



block type CDROM also support startupPolicy in the past, so
let us fix it.

Signed-off-by: Jie Wang <wangjie88@xxxxxxxxxx>
---
 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





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux