[libvirt PATCH 02/10] virDomainDiskDef: Change type of error_policy to virDomainDiskErrorPolicy

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 14 +++++++++-----
 src/conf/domain_conf.h |  2 +-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 33c6412642..4a0358831b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8976,11 +8976,15 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
     }
     VIR_FREE(tmp);
 
-    if ((tmp = virXMLPropString(cur, "error_policy")) &&
-        (def->error_policy = virDomainDiskErrorPolicyTypeFromString(tmp)) <= 0) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("unknown disk error policy '%s'"), tmp);
-        return -1;
+    if ((tmp = virXMLPropString(cur, "error_policy"))) {
+        int error_policy;
+
+        if ((error_policy = virDomainDiskErrorPolicyTypeFromString(tmp)) <= 0) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                           _("unknown disk error policy '%s'"), tmp);
+            return -1;
+        }
+        def->error_policy = error_policy;
     }
     VIR_FREE(tmp);
 
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3675e26eb0..cacb9d0430 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -567,7 +567,7 @@ struct _virDomainDiskDef {
     char *vendor;
     char *product;
     virDomainDiskCache cachemode;
-    int error_policy;  /* enum virDomainDiskErrorPolicy */
+    virDomainDiskErrorPolicy error_policy;
     int rerror_policy; /* enum virDomainDiskErrorPolicy */
     int iomode; /* enum virDomainDiskIo */
     virTristateSwitch ioeventfd;
-- 
2.26.3




[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