diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-02 10:53:18 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-10-06 19:50:50 +0200 |
commit | bbe694f91f9da1af1fb27f9865b952905c04e5e1 (patch) | |
tree | 76fa35df4b2bac5a1fb5449256373ca36fd009b1 /src/network/networkd-sriov.c | |
parent | network: move link_configure_sr_iov() (diff) | |
download | systemd-bbe694f91f9da1af1fb27f9865b952905c04e5e1.tar.xz systemd-bbe694f91f9da1af1fb27f9865b952905c04e5e1.zip |
network: introduce network_verify_sr_iov()
Diffstat (limited to 'src/network/networkd-sriov.c')
-rw-r--r-- | src/network/networkd-sriov.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/networkd-sriov.c b/src/network/networkd-sriov.c index 6c96ca39d2..d2a389d95d 100644 --- a/src/network/networkd-sriov.c +++ b/src/network/networkd-sriov.c @@ -247,7 +247,7 @@ int link_configure_sr_iov(Link *link) { return 0; } -int sr_iov_section_verify(SRIOV *sr_iov) { +static int sr_iov_section_verify(SRIOV *sr_iov) { assert(sr_iov); if (section_is_invalid(sr_iov->section)) @@ -262,6 +262,16 @@ int sr_iov_section_verify(SRIOV *sr_iov) { return 0; } +void network_verify_sr_iov(Network *network) { + SRIOV *sr_iov; + + assert(network); + + ORDERED_HASHMAP_FOREACH(sr_iov, network->sr_iov_by_section) + if (sr_iov_section_verify(sr_iov) < 0) + sr_iov_free(sr_iov); +} + int config_parse_sr_iov_uint32( const char *unit, const char *filename, |