]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc: Introduce lxcNetworkParseDataEntry
authorJulio Faracco <jcfaracco@gmail.com>
Mon, 18 Feb 2019 19:09:06 +0000 (16:09 -0300)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 25 Feb 2019 15:41:39 +0000 (10:41 -0500)
commit0ebb057a2abe2df11e1d7c2c2c64cb21fdaa8e2a
tree0fd9cdeaac8601c3fd10d928aba288d687c932b7
parente6cb63d2ef0787bcfa4a29403c59e041e6adbd7f
lxc: Introduce lxcNetworkParseDataEntry

Refactor lxcNetworkWalkCallback to be a simple method to handle
both possible network settings with indexes or the simple one. It is
better the decouple the whole algorithm to parse data to only parse
which entry type libvirt is handling.

The new method is responsible to verify is the settings correspond to
network entry. Right now, it is only verifying "lxc.network.", but in
the future, it can be used to verify "lxc.net.X." too. Any other case
would be rejected.

On the other hand, the idea here is working only with types. If we know
that entry is part of network settings, after we just need to know which
type is. It keeps the handler simple.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/lxc/lxc_native.c