1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +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; net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
if (virJSONValueObjectHasKey(value, "state")) { if ((tmp = virJSONValueObjectGetString(value, "state")) &&
tmp = virJSONValueObjectGetString(value, "state"); STREQ(tmp, "disconnected")) {
if STREQ(tmp, "disconnected") net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
} }
return 0; return 0;