virDomainDiskDef: Change type of cachemode to virDomainDiskCache

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:48 +02:00 committed by Michal Privoznik
parent 1051c23b51
commit f86e0b4cbc
2 changed files with 10 additions and 6 deletions

View File

@ -8964,11 +8964,15 @@ virDomainDiskDefDriverParseXML(virDomainDiskDef *def,
def->driverName = virXMLPropString(cur, "name"); def->driverName = virXMLPropString(cur, "name");
if ((tmp = virXMLPropString(cur, "cache")) && if ((tmp = virXMLPropString(cur, "cache"))) {
(def->cachemode = virDomainDiskCacheTypeFromString(tmp)) < 0) { int cachemode;
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown disk cache mode '%s'"), tmp); if ((cachemode = virDomainDiskCacheTypeFromString(tmp)) < 0) {
return -1; virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown disk cache mode '%s'"), tmp);
return -1;
}
def->cachemode = cachemode;
} }
VIR_FREE(tmp); VIR_FREE(tmp);

View File

@ -566,7 +566,7 @@ struct _virDomainDiskDef {
char *wwn; char *wwn;
char *vendor; char *vendor;
char *product; char *product;
int cachemode; /* enum virDomainDiskCache */ virDomainDiskCache cachemode;
int error_policy; /* enum virDomainDiskErrorPolicy */ int error_policy; /* enum virDomainDiskErrorPolicy */
int rerror_policy; /* enum virDomainDiskErrorPolicy */ int rerror_policy; /* enum virDomainDiskErrorPolicy */
int iomode; /* enum virDomainDiskIo */ int iomode; /* enum virDomainDiskIo */