virDomainDiskDef: Change type of discard to virDomainDiskDiscard

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:52 +02:00 committed by Michal Privoznik
parent de472f7248
commit ea7d0071d5
2 changed files with 10 additions and 6 deletions

View File

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

View File

@ -579,7 +579,7 @@ struct _virDomainDiskDef {
virDomainDeviceInfo info;
virTristateBool rawio;
virDomainDeviceSGIO sgio;
int discard; /* enum virDomainDiskDiscard */
virDomainDiskDiscard discard;
unsigned int iothread; /* unused = 0, > 0 specific thread # */
int detect_zeroes; /* enum virDomainDiskDetectZeroes */
char *domain_name; /* backend domain name */