mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
conf: interface: Preparation for g_auto
These changes make the g_auto-ification in the next commit clearer. Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
c5860d177b
commit
77eb77ef4a
@ -453,14 +453,12 @@ virInterfaceDefParseIfAdressing(virInterfaceDef *def,
|
|||||||
}
|
}
|
||||||
proto->family = tmp;
|
proto->family = tmp;
|
||||||
if (STREQ(tmp, "ipv4")) {
|
if (STREQ(tmp, "ipv4")) {
|
||||||
ret = virInterfaceDefParseProtoIPv4(proto, ctxt);
|
if (virInterfaceDefParseProtoIPv4(proto, ctxt) != 0) {
|
||||||
if (ret != 0) {
|
|
||||||
virInterfaceProtocolDefFree(proto);
|
virInterfaceProtocolDefFree(proto);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (STREQ(tmp, "ipv6")) {
|
} else if (STREQ(tmp, "ipv6")) {
|
||||||
ret = virInterfaceDefParseProtoIPv6(proto, ctxt);
|
if (virInterfaceDefParseProtoIPv6(proto, ctxt) != 0) {
|
||||||
if (ret != 0) {
|
|
||||||
virInterfaceProtocolDefFree(proto);
|
virInterfaceProtocolDefFree(proto);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -741,10 +739,12 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VIR_INTERFACE_TYPE_ETHERNET:
|
case VIR_INTERFACE_TYPE_ETHERNET: {
|
||||||
if ((tmp = virXPathString("string(./mac/@address)", ctxt)))
|
char *mac = virXPathString("string(./mac/@address)", ctxt);
|
||||||
def->mac = tmp;
|
if (mac != NULL)
|
||||||
|
def->mac = mac;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case VIR_INTERFACE_TYPE_BRIDGE: {
|
case VIR_INTERFACE_TYPE_BRIDGE: {
|
||||||
xmlNodePtr bridge;
|
xmlNodePtr bridge;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user