提交 1130fa31 编写于 作者: J John Ferlan 提交者: Peter Krempa

parallels: Need to handle virJSONValueObjectGetString error

上级 8d3aa092
......@@ -513,10 +513,9 @@ parallelsGetNetInfo(virDomainNetDefPtr net,
}
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
if (virJSONValueObjectHasKey(value, "state")) {
tmp = virJSONValueObjectGetString(value, "state");
if STREQ(tmp, "disconnected")
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
if ((tmp = virJSONValueObjectGetString(value, "state")) &&
STREQ(tmp, "disconnected")) {
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册