提交 c49b9032 编写于 作者: L Luyao Huang 提交者: Martin Kletzander

conf: Report error for unknown shmem ioeventfd value

https://bugzilla.redhat.com/show_bug.cgi?id=1220265

Passing the return value to an enum directly is not safe.  Fix this by
comparing the true integer result of virTristateSwitchTypeFromString().
Signed-off-by: NLuyao Huang <lhuang@redhat.com>
上级 076dd379
......@@ -10829,12 +10829,16 @@ virDomainShmemDefParseXML(xmlNodePtr node,
}
VIR_FREE(tmp);
if ((tmp = virXMLPropString(msi, "ioeventfd")) &&
(def->msi.ioeventfd = virTristateSwitchTypeFromString(tmp)) <= 0) {
virReportError(VIR_ERR_XML_ERROR,
_("invalid msi ioeventfd setting for shmem: '%s'"),
tmp);
goto cleanup;
if ((tmp = virXMLPropString(msi, "ioeventfd"))) {
int val;
if ((val = virTristateSwitchTypeFromString(tmp)) <= 0) {
virReportError(VIR_ERR_XML_ERROR,
_("invalid msi ioeventfd setting for shmem: '%s'"),
tmp);
goto cleanup;
}
def->msi.ioeventfd = val;
}
VIR_FREE(tmp);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册