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 c020bf9124..d4ca60f98c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15764,16 +15764,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 (virXMLPropYesNo(memdevNode, "discard", &def->discard) < 0) + goto error; /* Extract NVDIMM UUID. */ if (def->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM && -- 2.26.2