回复: [PATCH] network: Fix a race condition when shutdown & start vm at the same time

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

 



Thanks for your review, I will fix in version 2.

 

 

 

发件人: Daniel Henrique Barboza
发送时间: 2020616日星期二 上午2:36
收件人: Bingsong Si; libvir-list@xxxxxxxxxx
主题: Re: [PATCH] network: Fix a race condition when shutdown & start vm at the same time

 

 

 

On 6/11/20 6:58 AM, Bingsong Si wrote:

> when shutdown vm, the qemuProcessStop cleanup virtual interface in two steps:

 

s/when/When

 

> 1. qemuProcessKill kill qemu process, and vif disappeared

> 2. ovs-vsctl del-port from the brige

>

> if start a vm in the middle of the two steps, the new vm will reused the vif,

 

s/if/If

 

> but removed from bridge by step 2

>

> Signed-off-by: Bingsong Si <owen.si@xxxxxxxxx>

> ---

>   src/qemu/qemu_process.c | 8 +++++---

>   1 file changed, 5 insertions(+), 3 deletions(-)

>

> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c

> index d36088ba98..706248815a 100644

> --- a/src/qemu/qemu_process.c

> +++ b/src/qemu/qemu_process.c

> @@ -7483,9 +7483,11 @@ void qemuProcessStop(virQEMUDriverPtr driver,

>               if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_MIDONET) {

>                   ignore_value(virNetDevMidonetUnbindPort(vport));

>               } else if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {

> -                ignore_value(virNetDevOpenvswitchRemovePort(

> -                                 virDomainNetGetActualBridgeName(net),

> -                                 net->ifname));

> +                virMacAddr mac;

> +                if (virNetDevGetMAC(net->ifname, &mac) < 0 ||  !virMacAddrCmp(&mac, &net->mac))

 

Extra space between "||" and "!virMacAddrCmp(.."

 

 

With these nits fixed:

 

 

Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>

 

 

> +                    ignore_value(virNetDevOpenvswitchRemovePort(

> +                                     virDomainNetGetActualBridgeName(net),

> +                                     net->ifname));

>               }

>           }

>  

>

 


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux