virDomainDiskDef: Change type of rerror_policy to virDomainDiskErrorPolicy

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-22 12:32:50 +02:00 committed by Michal Privoznik
parent 90a50b98f6
commit 7a3bf2589d
2 changed files with 11 additions and 7 deletions

View File

@ -8988,13 +8988,17 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
} }
VIR_FREE(tmp); VIR_FREE(tmp);
if ((tmp = virXMLPropString(cur, "rerror_policy")) && if ((tmp = virXMLPropString(cur, "rerror_policy"))) {
(((def->rerror_policy = virDomainDiskErrorPolicyTypeFromString(tmp)) <= 0) || int rerror_policy;
(def->rerror_policy == VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE))) {
if (((rerror_policy = virDomainDiskErrorPolicyTypeFromString(tmp)) <= 0) ||
(rerror_policy == VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown disk read error policy '%s'"), tmp); _("unknown disk read error policy '%s'"), tmp);
return -1; return -1;
} }
def->rerror_policy = rerror_policy;
}
VIR_FREE(tmp); VIR_FREE(tmp);
if ((tmp = virXMLPropString(cur, "io")) && if ((tmp = virXMLPropString(cur, "io")) &&

View File

@ -568,7 +568,7 @@ struct _virDomainDiskDef {
char *product; char *product;
virDomainDiskCache cachemode; virDomainDiskCache cachemode;
virDomainDiskErrorPolicy error_policy; virDomainDiskErrorPolicy error_policy;
int rerror_policy; /* enum virDomainDiskErrorPolicy */ virDomainDiskErrorPolicy rerror_policy;
int iomode; /* enum virDomainDiskIo */ int iomode; /* enum virDomainDiskIo */
virTristateSwitch ioeventfd; virTristateSwitch ioeventfd;
virTristateSwitch event_idx; virTristateSwitch event_idx;