On Tue, Apr 02, 2019 at 09:53:57PM -0400, Laine Stump wrote:
On 3/19/19 8:46 AM, Daniel P. Berrangé wrote:
> Separate network port deletion code from the domain driver network
> callback implementation.
>
> Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
> ---
> src/network/bridge_driver.c | 91 ++++++++++++++++++++++++-------------
> 1 file changed, 59 insertions(+), 32 deletions(-)
> +static int
> +networkReleaseActualDevice(virNetworkPtr net,
> + virDomainDefPtr dom,
> + virDomainNetDefPtr iface)
> +{
> + virNetworkDriverStatePtr driver = networkGetDriver();
> + virNetworkObjPtr obj;
> + virNetworkPortDefPtr port = NULL;
> + int ret = -1;
> +
> + obj = virNetworkObjFindByName(driver->networks, net->name);
> + if (!obj) {
> + virReportError(VIR_ERR_NO_NETWORK,
> + _("no network with matching name '%s'"),
> + net->name);
> + goto cleanup;
> + }
> +
> + if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK) {
> + virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> + _("Expected a interface for a virtual network"));
s/a interface/an interface/ (yeah, I know you're just moving existing bad
grammar, but may as well fix it now)
This got fixed already as its just code movement from earlier patch
where you already pointed it out.
> + goto cleanup;
> + }
> +
> + if (iface->data.network.actual == NULL) {
> + ret = 0;
> + goto cleanup;
> + }
> +
> + if (!(port = virDomainNetDefActualToNetworkPort(dom, iface)))
> + goto cleanup;
> +
> + if (networkReleasePort(obj, port) < 0)
> + goto cleanup;
> ret = 0;
> cleanup:
Reivewed-by: Laine Stump <laine(a)laine.org>
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|