1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

parallels: Need to handle virJSONValueObjectGetString error

This commit is contained in:
John Ferlan 2013-01-18 09:30:40 -05:00 committed by Peter Krempa
parent 8d3aa09283
commit 1130fa3188

View File

@ -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;