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");
if ((tmp = virXMLPropString(cur, "cache")) &&
(def->cachemode = virDomainDiskCacheTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown disk cache mode '%s'"), tmp);
return -1;
if ((tmp = virXMLPropString(cur, "cache"))) {
int cachemode;
if ((cachemode = virDomainDiskCacheTypeFromString(tmp)) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown disk cache mode '%s'"), tmp);
return -1;
}
def->cachemode = cachemode;
}
VIR_FREE(tmp);

View File

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