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:
parent
8d3aa09283
commit
1130fa3188
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user