[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/4] hotplug: Create helper to remove vport



On Wed, Jun 28, 2017 at 07:37:36 -0400, John Ferlan wrote:
> Combine and "clean up" a bit two places that are removing the vport
> 
> Signed-off-by: John Ferlan <jferlan redhat com>
> ---
>  src/qemu/qemu_hotplug.c | 41 +++++++++++++++++++----------------------
>  1 file changed, 19 insertions(+), 22 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index a486fb4..1af85be 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -937,6 +937,23 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
>  }
>  
>  
> +static void
> +qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net)
> +{
> +    virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
> +
> +    if (!vport)
> +        return;
> +
> +    if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_MIDONET) {
> +        ignore_value(virNetDevMidonetUnbindPort(vport));
> +    } else if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
> +        const char *brname = virDomainNetGetActualBridgeName(net);

Declare this variable at the top level along with vport.

> +        ignore_value(virNetDevOpenvswitchRemovePort(brname, net->ifname));
> +    }
> +}

ACK

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]