Skip to content

Commit

Permalink
write NBD debugging messages to logfile
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Jun 23, 2024
1 parent 4bdea93 commit 5e8db9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Version 2.11
bindings for python do not support required features.
* Set TLS connection options to TLS_REQUIRE instead of TLS_ALLOW which would
fallback to non-encrypted data transfer.
* If LIBNBD_DEBUG is set, add NBD trace messages to logfile.

Version 2.10
---------
Expand Down
7 changes: 7 additions & 0 deletions libvirtnbdbackup/nbdcli/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ def __init__(self, cType):
self.maxRequestSize = 33554432
self.minRequestSize = 65536
self.nbd = nbd.NBD()

def debug(func, args):
"""Write NBD debugging messages to logfile instead of
stderr"""
log.debug("%s: %s", func, args)

self.nbd.set_debug_callback(debug)
self.connection = None

def _getBlockInfo(self) -> None:
Expand Down

0 comments on commit 5e8db9e

Please sign in to comment.