
On 02/03/2016 08:38 AM, Michal Privoznik wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1293351
Since we already have virtio channel events, we know when guest agent within guest has (dis-)connected. Instead of us blindly connecting to a socket that no one is listening to, we can just follow what qemu-ga does. This has a nice benefit that we don't need to 'guest-ping' the agent just to timeout and find out nobody is listening.
The way that this commit is implemented: - don't connect in qemuProcessLaunch directly, defer that to event callback (which already follows the agent) - processSerialChangedEvent - after migration is settled, before we resume vCPUs, ask qemu whether somebody is listening on the socket and if so, connect to it.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> ---
diff to v4: - drop asking qemu in qemuConnectAgent; in most cases we were asking twice. Rather put explicit virtio channel querying into places that were missing it anyway.
- Move qemuConnectAgent in qemuProcessReconnect() *after* we have refreshed channel states.
src/qemu/qemu_migration.c | 15 +++++++++++++++ src/qemu/qemu_process.c | 39 ++++++++++++++++++++++++--------------- src/qemu/qemu_process.h | 2 ++ 3 files changed, 41 insertions(+), 15 deletions(-)
ACK - looks better I think now. John