[libvirt] [PATCH v2 4/4] qemu: remove pointless connect retry logic in agent

John Ferlan jferlan at redhat.com
Fri Apr 20 14:23:27 UTC 2018



On 04/18/2018 01:30 PM, Daniel P. Berrangé wrote:
> When the agent code was first introduced back in
> 
>   commit c160ce3316852a797d7b06b4ee101233866e69a9
>   Author: Daniel P. Berrange <berrange at redhat.com>
>   Date:   Wed Oct 5 18:31:54 2011 +0100
> 
>     QEMU guest agent support
> 
> there was code that would loop and retry the connection when opening
> the agent socket. At this time, the only thing done in between the
> opening of the monitor socket & opening of the agent socket was a
> call to set the monitor capabilities. This was a no-op on non-QMP
> versions, so in theory there could be a race which let us connect
> to the monitor while the agent socket was still not created by QEMU.
> 
> In the modern world, however, we long ago mandated the use of QMP
> for managing QEMU, so we're guaranteed to have a set capabilities
> QMP call. Once we've seen a reply to this, we're guaranteed that
> QEMU has fully initialized all backends and is in its event loop.
> 
> We can thus be sure the QEMU agent socket is present and don't need
> to retry connections to it, even without having the chardev FD passing
> feature.
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  src/qemu/qemu_agent.c | 84 +++++----------------------------------------------
>  1 file changed, 7 insertions(+), 77 deletions(-)
> 

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

John




More information about the libvir-list mailing list