Skip to content

qga: add support for re-opening channel on error

Michael Roth qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6qga: group agent init/cleanup init separate routinesqga/main.c+50 -320 replies
2/6qga: hang GAConfig/socket_activation off of GAState globalqga/main.c+29 -250 replies
3/6qga: move w32 service handling out of run_agent()qga/main.c+14 -110 replies
4/6qga: add --retry-path option for re-initializing channel on failureqga/main.c+54 -80 replies
5/6qga-win: install service with --retry-path set by defaultqga/installer/qemu-ga.wxs+1 -10 replies
6/6qga-win: report specific error when failing to open channelqga/channel-win32.c+2 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/6] qga: add support for re-opening channel on error

The following patches are also available at:
https://github.com/mdroth/qemu/commits/qga-retry-path

This series adds a --retry-path option to qemu-ga to allow the agent to periodically re-attempt opening a channel if the channel is not yet present (e.g. qemu-ga is installed before virtio-serial drivers) or if the channel encounters an error that might be recoverable (e.g. the channel is hot unplugged/plugged).

This functionality is already possible via init systems like systemd (and is already set up that way on Fedora), but we implement this option to handle other OSs like Windows (where this was originally reported as a problem).

PATCH 1-3 implement various refactorings that more clearly encapsulate the agent's lifecycle into:

a) config parsing (via main())
b) initializing the agent (via initialize_agent())
c) starting the agent (via run_agent())
d) stopping the agent (via stop_agent())
e) cleaning up the agent (via cleanup_agent())
f) cleaning up the config (via main())

PATCH 4 implements the actual --retry-path option, which simply wraps run_agent() in a continuous loop until the agent is explicitly told to exit.

 qga/channel-win32.c       |   3 +-
 qga/installer/qemu-ga.wxs |   2 +-
 qga/main.c                | 205 ++++++++++++++++++++++++++++++++++++++++++++++++------------------------
 3 files changed, 141 insertions(+), 69 deletions(-)