提交 e01e1e16 编写于 作者: M Michal Privoznik

xenconfig: Properly check retval of virDomainGraphicsListenSetAddress

The function, like others in our code, returns zero on success
and a negative value on error. However, there are two places in
xenconfig source code where we check for non-zero value. While
the function can't currently return a positive value, those
checks look okay, but does not really follow our style.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 5194eb95
...@@ -868,7 +868,7 @@ xenParseSxprGraphicsOld(virDomainDefPtr def, ...@@ -868,7 +868,7 @@ xenParseSxprGraphicsOld(virDomainDefPtr def,
graphics->data.vnc.port = port; graphics->data.vnc.port = port;
if (listenAddr && if (listenAddr &&
virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true)) virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true) < 0)
goto error; goto error;
if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0) if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0)
...@@ -987,7 +987,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def, ...@@ -987,7 +987,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def,
graphics->data.vnc.port = port; graphics->data.vnc.port = port;
if (listenAddr && if (listenAddr &&
virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true)) virDomainGraphicsListenSetAddress(graphics, 0, listenAddr, -1, true) < 0)
goto error; goto error;
if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0) if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册