g_autofree char *authalias = NULL;
g_autofree char *httpcookiealias = NULL;
g_autofree char *tlskeyalias = NULL;
- g_autofree char *thresholdEventWithIndex = NULL;
+ virTristateBool thresholdEventWithIndex;
bool fdsetPresent = false;
unsigned int fdSetID;
int enccount;
if (virStorageSourcePrivateDataParseRelPath(ctxt, src) < 0)
return -1;
- if ((thresholdEventWithIndex = virXPathString("string(./thresholdEvent/@indexUsed)", ctxt)) &&
- virTristateBoolTypeFromString(thresholdEventWithIndex) == VIR_TRISTATE_BOOL_YES)
- src->thresholdEventWithIndex = true;
+ if (virXPathTristateBool("string(./thresholdEvent/@indexUsed)",
+ ctxt, &thresholdEventWithIndex) >= 0) {
+ virTristateBoolToBool(thresholdEventWithIndex, &src->thresholdEventWithIndex);
+ }
if ((nbdkitnode = virXPathNode("nbdkit", ctxt))) {
if (qemuStorageSourcePrivateDataParseNbdkit(nbdkitnode, ctxt, src) < 0)