Skip to contentSkip to conversation

qga: Fix --retry-path behaviour

PATCH In review Kostiantyn Kostiuk 3 participants 5 messages Aug 25, 2025 – Aug 26, 2025

lore
Share & tools
lore
#0 lore raw

cover qga: Fix --retry-path behaviour

Kostiantyn Kostiuk (2):
qga: Fix channel initialization check in run_agent_once
qga: ignore channel_init() fail if 'retry_path' is set

 qga/main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.50.1
#1 lore raw

PATCH 1/2 qga: Fix channel initialization check in run_agent_once

---
 qga/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/main.c +1 -1
index 6c02f3ec38..a1bf8f53ac 100644
@@ -1563,7 +1563,7 @@ static void cleanup_agent(GAState *s)
 static int run_agent_once(GAState *s)
 {
     if (!s->channel &&
-        channel_init(s, s->config->method, s->config->channel_path,
+        !channel_init(s, s->config->method, s->config->channel_path,
                      s->socket_activation ? FIRST_SOCKET_ACTIVATION_FD : -1)) {
         g_critical("failed to initialize guest agent channel");
         return EXIT_FAILURE;
Signature · 1 line
2.50.1
#2 lore raw

PATCH 2/2 qga: ignore channel_init() fail if 'retry_path' is set

In reply to Kostiantyn Kostiuk

On Windows, we run QGA with -d --retry-path options by default, and expect that QGA will start even without the vioserial driver and will wait for communication forever.

---
 qga/main.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
qga/main.c +6 -2
index a1bf8f53ac..dd1c216f9a 100644
@@ -1512,8 +1512,12 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
 
     if (!channel_init(s, s->config->method, s->config->channel_path,
                       s->socket_activation ? FIRST_SOCKET_ACTIVATION_FD : -1)) {
-        g_critical("failed to initialize guest agent channel");
-        return NULL;
+        if (s->config->retry_path) {
+            g_info("failed to initialize guest agent channel, will retry");
+        } else {
+            g_critical("failed to initialize guest agent channel");
+            return NULL;
+        }
     }
 
     if (config->daemonize) {
Signature · 1 line
2.50.1