[libvirt] [PATCH v2 1/8] logging: allow inode/offset params to be NULL

Daniel P. Berrange berrange at redhat.com
Mon Feb 29 13:33:33 UTC 2016


Not all callers of virLogManagerDomainOpenLogFile will
care about getting the current inode/offset, so we should
allow those parameters to be NULL

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 src/logging/log_manager.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c
index f5b4b7d..7c37ba1 100644
--- a/src/logging/log_manager.c
+++ b/src/logging/log_manager.c
@@ -196,8 +196,10 @@ virLogManagerDomainOpenLogFile(virLogManagerPtr mgr,
         goto cleanup;
     }
 
-    *inode = ret.pos.inode;
-    *offset = ret.pos.offset;
+    if (inode)
+        *inode = ret.pos.inode;
+    if (offset)
+        *offset = ret.pos.offset;
 
     rv = fdout[0];
  cleanup:
-- 
2.5.0




More information about the libvir-list mailing list