qga: add --retry-path option for re-initializing channel on failure
commitd951fadad6cce10d83f736de691fc2003b89bac4
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Sun, 7 Oct 2018 11:02:20 +0000 (7 14:02 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 31 Oct 2018 14:04:20 +0000 (31 09:04 -0500)
tree8c9565fa908ac52ebc6d2194a98d82014b17c7f0
parentd88495a864011139683e62fb7f84db93c7b51881
qga: add --retry-path option for re-initializing channel on failure

This adds an option to instruct the agent to periodically attempt
re-opening the communication channel after a channel error has
occurred. The main use-case for this is providing an OS-independent
way of allowing the agent to survive situations like hotplug/unplug of
the communication channel, or initial guest set up where the agent may
be installed/started prior to the installation of the channel device's
driver.

There are nicer ways of implementing this functionality via things
like systemd services, but this option is useful for platforms like
*BSD/w32.

Currently a channel error will result in the GSource for that channel
being removed from the GMainLoop, but the main loop continuing to run.
That behavior results in a dead loop when --retry-path isn't set, and
prevents us from knowing when to attempt re-opening the channel when
it is set, so we also force the loop to exit as part of this patch.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/main.c