]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: new function virDomainNetRemoveByObj()
authorLaine Stump <laine@redhat.com>
Fri, 21 May 2021 18:28:10 +0000 (14:28 -0400)
committerLaine Stump <laine@redhat.com>
Tue, 25 May 2021 14:08:00 +0000 (10:08 -0400)
commita52b74e7a379b2a8d42a80908c0c53d8b026327d
tree2d6917a9ea0eae07335662b9877be4515b545648
parent6731a6805ddbdd4e3a67fdb4440ee52226bb493b
conf: new function virDomainNetRemoveByObj()

virDomainNetRemove() requires the index of the net device you want to
remove from the list, but in some cases you may not have the index
handy, only the object itself (or the object may not have been added
to the domain's list). virDomainNetRemoveByObj() first tries to find
the given object in the nets list, and deletes that if it is found.

As with virDomainNetRemove() it always unconditionally tries to remove
the device from the hostdevs list (in case it is the ridiculous
combined net+hostdev device created for <interface type='hostdev'>).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms