Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/conf/domain_conf.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ef1f930a96..3c69f3913a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15706,16 +15706,8 @@ virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt, } VIR_FREE(tmp); - if ((tmp = virXMLPropString(memdevNode, "discard"))) { - if ((val = virTristateBoolTypeFromString(tmp)) <= 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid discard value '%s'"), tmp); - goto error; - } - - def->discard = val; - } - VIR_FREE(tmp); + if (virXMLPropTristateBool(memdevNode, "discard", false, &def->discard) < 0) + goto error; /* Extract NVDIMM UUID. */ if (def->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM && -- 2.26.2