When the global variable virLogDefaultPriority is modified, it will

be better to have a lock.

 

Signed-off-by: Zhou Yimin <zhouyimin@huawei.com>

---

src/util/virlog.c | 3 +++

1 file changed, 3 insertions(+)

 

diff --git a/src/util/virlog.c b/src/util/virlog.c

index 68af0f3..ba370e2 100644

--- a/src/util/virlog.c

+++ b/src/util/virlog.c

@@ -498,7 +498,10 @@ virLogSetDefaultPriority(virLogPriority priority)

     if (virLogInitialize() < 0)

         return -1;

+    virLogLock();

     virLogDefaultPriority = priority;

+    virLogUnlock();

+

     return 0;

}

--

1.7.12.4