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

View File

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