[libvirt] [PATCH] virCommand: Extend debug message for handshake

Currently, we are logging only one side of pipes we create in virCommandRequireHandshake(); This is enough in cases where pipe2() returns two consecutive FDs. However, it is not guaranteed and it may return any FDs. Therefore, it's wise to log the other ends as well. --- src/util/command.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/command.c b/src/util/command.c index eaa9f16..5b94f1e 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -2443,8 +2443,10 @@ void virCommandRequireHandshake(virCommandPtr cmd) return; } - VIR_DEBUG("Transfer handshake wait=%d notify=%d", - cmd->handshakeWait[1], cmd->handshakeNotify[0]); + VIR_DEBUG("Transfer handshake wait=%d notify=%d, " + "keep handshake wait=%d notify=%d", + cmd->handshakeWait[1], cmd->handshakeNotify[0], + cmd->handshakeWait[0], cmd->handshakeNotify[1]); virCommandTransferFD(cmd, cmd->handshakeWait[1]); virCommandTransferFD(cmd, cmd->handshakeNotify[0]); cmd->handshake = true; -- 1.7.8.5

On 05/30/2012 06:20 AM, Michal Privoznik wrote:
Currently, we are logging only one side of pipes we create in virCommandRequireHandshake(); This is enough in cases where pipe2() returns two consecutive FDs. However, it is not guaranteed and it may return any FDs. Therefore, it's wise to log the other ends as well. --- src/util/command.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/command.c b/src/util/command.c index eaa9f16..5b94f1e 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -2443,8 +2443,10 @@ void virCommandRequireHandshake(virCommandPtr cmd) return; }
- VIR_DEBUG("Transfer handshake wait=%d notify=%d", - cmd->handshakeWait[1], cmd->handshakeNotify[0]); + VIR_DEBUG("Transfer handshake wait=%d notify=%d, " + "keep handshake wait=%d notify=%d", + cmd->handshakeWait[1], cmd->handshakeNotify[0], + cmd->handshakeWait[0], cmd->handshakeNotify[1]);
ACK; this has no other impact other than a useful debug aid. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 30.05.2012 14:45, Eric Blake wrote:
On 05/30/2012 06:20 AM, Michal Privoznik wrote:
Currently, we are logging only one side of pipes we create in virCommandRequireHandshake(); This is enough in cases where pipe2() returns two consecutive FDs. However, it is not guaranteed and it may return any FDs. Therefore, it's wise to log the other ends as well. --- src/util/command.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/command.c b/src/util/command.c index eaa9f16..5b94f1e 100644 --- a/src/util/command.c +++ b/src/util/command.c @@ -2443,8 +2443,10 @@ void virCommandRequireHandshake(virCommandPtr cmd) return; }
- VIR_DEBUG("Transfer handshake wait=%d notify=%d", - cmd->handshakeWait[1], cmd->handshakeNotify[0]); + VIR_DEBUG("Transfer handshake wait=%d notify=%d, " + "keep handshake wait=%d notify=%d", + cmd->handshakeWait[1], cmd->handshakeNotify[0], + cmd->handshakeWait[0], cmd->handshakeNotify[1]);
ACK; this has no other impact other than a useful debug aid.
Thanks, pushed. Michal
participants (2)
-
Eric Blake
-
Michal Privoznik