[libvirt] [PATCH] security: Use VIR_DEBUG instead of VIR_INFO in virSecurityDACSetOwnershipInternal

xinhua.Cao caoxinhua at huawei.com
Sat Jul 15 08:31:39 UTC 2017


virSecurityDACSetOwnershipInternal was called by libvirt child process,
so if we log message by VIR_INFO at normal scene, it would probability occurs dead lock sence,
then libvirtd will also by dead lock because libvirtd is waitting for child message.
so our suggest is use VIR_DEBUG instead of VIR_INFO to avoid this sence.
---
 src/security/security_dac.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index ca7a6af..7bfd090 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -552,8 +552,8 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv,
     else if (rc > 0)
         return 0;
 
-    VIR_INFO("Setting DAC user and group on '%s' to '%ld:%ld'",
-             NULLSTR(src ? src->path : path), (long) uid, (long) gid);
+    VIR_DEBUG("Setting DAC user and group on '%s' to '%ld:%ld'",
+              NULLSTR(src ? src->path : path), (long) uid, (long) gid);
 
     if (priv && src && priv->chownCallback) {
         rc = priv->chownCallback(src, uid, gid);
@@ -591,17 +591,17 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv,
 
     if (rc < 0) {
         if (errno == EOPNOTSUPP || errno == EINVAL) {
-            VIR_INFO("Setting user and group to '%ld:%ld' on '%s' not "
-                     "supported by filesystem",
-                     (long) uid, (long) gid, path);
+            VIR_DEBUG("Setting user and group to '%ld:%ld' on '%s' not "
+                      "supported by filesystem",
+                      (long) uid, (long) gid, path);
         } else if (errno == EPERM) {
-            VIR_INFO("Setting user and group to '%ld:%ld' on '%s' not "
-                     "permitted",
-                     (long) uid, (long) gid, path);
+            VIR_DEBUG("Setting user and group to '%ld:%ld' on '%s' not "
+                      "permitted",
+                      (long) uid, (long) gid, path);
         } else if (errno == EROFS) {
-            VIR_INFO("Setting user and group to '%ld:%ld' on '%s' not "
-                     "possible on readonly filesystem",
-                     (long) uid, (long) gid, path);
+            VIR_DEBUG("Setting user and group to '%ld:%ld' on '%s' not "
+                      "possible on readonly filesystem",
+                      (long) uid, (long) gid, path);
         } else {
             virReportSystemError(errno,
                                  _("unable to set user and group to '%ld:%ld' "
-- 
2.8.3





More information about the libvir-list mailing list