提交 d343e820 编写于 作者: J John Ferlan

conf: Remove ATTRIBUTE_NONNULL for virDomainQemuMonitorEventNew

Commit 17561eb3 modified the logic to check "if (!event)" for an
attribute that was not supposed to be passed as NULL.  This causes
the static checker/Coverity build to fail. Since the check is made,
alter the header.

Also add an error message since returning -1 without some sort of
error message as previously would have happened with the failed
VIR_STRDUP so that the eventual error doesn't get the default
for some reason message.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 18a1ce77
......@@ -1935,8 +1935,12 @@ virDomainQemuMonitorEventNew(int id,
return NULL;
/* event is mandatory, details are optional */
if (!event)
if (!event) {
virReportError(VIR_ERR_INVALID_ARG,
_("unexpected event=NULL name=%s uuid=%s details=%s"),
name, uuidstr, NULLSTR(details));
goto error;
}
ev->event = g_strdup(event);
ev->seconds = seconds;
......
......@@ -321,4 +321,4 @@ virDomainQemuMonitorEventNew(int id,
long long seconds,
unsigned int micros,
const char *details)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册