virInterfaceDefDevFormat: Add missing error handling

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2022-01-12 12:17:39 +01:00
parent fdc5f5d7ac
commit c5860d177b
1 changed files with 6 additions and 3 deletions

View File

@ -1089,13 +1089,16 @@ virInterfaceDefDevFormat(virBuffer *buf,
virBufferAsprintf(buf, "<mac address='%s'/>\n", def->mac);
break;
case VIR_INTERFACE_TYPE_BRIDGE:
virInterfaceBridgeDefFormat(buf, def);
if (virInterfaceBridgeDefFormat(buf, def) < 0)
return -1;
break;
case VIR_INTERFACE_TYPE_BOND:
virInterfaceBondDefFormat(buf, def);
if (virInterfaceBondDefFormat(buf, def) < 0)
return -1;
break;
case VIR_INTERFACE_TYPE_VLAN:
virInterfaceVlanDefFormat(buf, def);
if (virInterfaceVlanDefFormat(buf, def) < 0)
return -1;
break;
}