[libvirt] [PATCH] qemuProcess: update hostdevs before connectting qemu monitor

John Ferlan jferlan at redhat.com
Sat Sep 22 12:01:42 UTC 2018



On 9/20/18 10:33 PM, Wu Zongyong wrote:
> In a following case:
> 
>     virsh start $domain
>     service libvirtd stop
>     <shutdown> the guest from within the $domain
>     service libvirtd start
> 
> Notice that PCI devices which have been assigned to the $domain will
> still be bound to stub drivers instead rebound to host drivers.
> In that case the call stack is like below:
> 
>     libvirtd start
>         qemuProcessReconnect
>             qemuProcessStop
>                 qemuHostdevReAttachDomainDevices
>                     qemuHostdevReAttachPCIDevices
>                         virHostdevReAttachPCIDevices
> 
> qemuHostdevUpdateActiveDomainDevices won't be called because the monitor
> channel is closed. So host devices in $domain will not be added to either
> activePCIHostdevs list or inactivePCIHostdev list. And therefore,
> virHostdevReAttachPCIDevices just neglects these host PCI devices which
> are bound to stub drivers and don't rebind them to host drivers.
> 
> This patch fixs that by moving qemuHostdevUpdateActiveDomainDevices before
> qemuConnectMonitor.
> 
> Signed-off-by: Wu Zongyong <cordius.wu at huawei.com>
> ---
>  src/qemu/qemu_process.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

I cleaned up the commit message a little bit and pushed.

Reviewed-by: John Ferlan <jferlan at redhat.com>

John




More information about the libvir-list mailing list