virDomainDiskDef: Change type of error_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:49 +02:00 committed by Michal Privoznik
parent f86e0b4cbc
commit 90a50b98f6
2 changed files with 10 additions and 6 deletions

View File

@ -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);

View File

@ -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;