[libvirt] [PATCH] qemu: fix monitor socket reconnection

Ryota Ozaki ozaki.ryota at gmail.com
Tue Jul 28 15:09:44 UTC 2009


Hi,

This patch fixes a handling of a qemu monitor unix socket. Current code
addresses 'Socket may not have shown up yet' case with catching EACCES
of connect(2), however, in that case, an errno which should be catched
is ENOENT, not EACCES.

Thanks,
  ozaki-r


>From 5a4b7ee2296ca6756127c26c6bfbbe1f49ab8722 Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <ozaki.ryota at gmail.com>
Date: Tue, 28 Jul 2009 23:48:22 +0900
Subject: [PATCH] qemu: fix monitor socket reconnection

---
 src/qemu_driver.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 52a77be..9fb8506 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -917,8 +917,8 @@ qemudOpenMonitorUnix(virConnectPtr conn,
         if (ret == 0)
             break;

-        if (errno == EACCES || errno == ECONNREFUSED) {
-            /* EACCES       : Socket may not have shown up yet
+        if (errno == ENOENT || errno == ECONNREFUSED) {
+            /* ENOENT       : Socket may not have shown up yet
              * ECONNREFUSED : Leftover socket hasn't been removed yet */
             continue;
         }
-- 
1.6.0.6




More information about the libvir-list mailing list