search for: libnbd_debug

Displaying 20 results from an estimated 45 matches for "libnbd_debug".

2019 Sep 23
2
[libnbd PATCH] ocaml: Fix tests when ocamlopt is not available
...715d23f. --- ocaml/tests/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocaml/tests/Makefile.am b/ocaml/tests/Makefile.am index dfb23ff..56519c0 100644 --- a/ocaml/tests/Makefile.am +++ b/ocaml/tests/Makefile.am @@ -100,7 +100,10 @@ endif TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 OCAMLRUNPARAM=b LOG_COMPILER = $(top_builddir)/run -TESTS = $(tests_bc) $(tests_opt) +TESTS = $(tests_bc) +if HAVE_OCAMLOPT +TESTS += $(tests_opt) +endif endif HAVE_NBDKIT endif HAVE_OCAML -- 2.21.0
2022 Nov 04
3
[libnbd PATCH v2 0/3] Improve nbdsh -u handling
v1 was here: https://listman.redhat.com/archives/libguestfs/2022-October/030216.html Since then, I've incorporated changes based on Rich's feedback: swap order of patches 2 and 3 less change in patch 1 (including no unsafe eval(%s) for --uri) in patch 2, include -c in list of snippets to store, and use dict of lambdas to map back to the desired action Eric Blake (3): nbdsh:
2020 Sep 22
3
[libnbd PATCH v2] nbdsh: Catch nbd.Error from -c arguments
...;: - exec(c, d, d) + try: + for c in args.command: + if c != '-': + exec(c, d, d) + else: + exec(sys.stdin.read(), d, d) + except nbd.Error as ex: + if os.environ.get("LIBNBD_DEBUG", "0") == "1": + traceback.print_exc() else: - exec(sys.stdin.read(), d, d) + print("nbdsh: command line script failed: %s" % ex.string, + file=sys.stderr) + sys.exit(1) diff...
2023 Jun 12
3
[PATCH libnbd 0/2] Two simple patches
...cular attention - it's my experience that printing out the state transitions in debug mode has never helped me to diagnose a bug, but it has made the debug logs huge and hard to follow. However that might just be me! Has it helped anyone else? Also I'm open to the concept of debug levels (LIBNBD_DEBUG=2 etc) Rich.
2019 Sep 12
2
[libnbd PATCH] nbdsh: Add -b option to simplify h.block_status
...Makefile.am @@ -21,6 +21,7 @@ EXTRA_DIST = \ nbdsh.pod \ examples/LICENSE-FOR-EXAMPLES \ examples/hexdump.sh \ + test-context.sh \ test-help.sh \ test-pattern.sh \ test-version.sh \ @@ -43,7 +44,7 @@ nbdsh.1: nbdsh.pod $(top_builddir)/podwrapper.pl endif HAVE_POD -TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 EXP_VERSION=$(VERSION) +TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 NBDKIT_DEBUG=1 EXP_VERSION=$(VERSION) LOG_COMPILER = $(top_builddir)/run TESTS = \ test-help.sh \ @@ -53,6 +54,7 @@ TESTS = \ if HAVE_NBDKIT TESTS += \ + test-context.sh \ test-pattern.sh \ $(NULL) diff --git a/sh/test-context...
2019 Jul 30
1
[nbdkit PATCH v2] tests: Accommodate qemu-img 4.1 output change
...q "^virtual size: 100M" ipv6.out + grep -sq '"virtual-size": *104857600\b' ipv6.out fi diff --git a/tests/test-nbd-tls-psk.sh b/tests/test-nbd-tls-psk.sh index d0bbc468..82822d11 100755 --- a/tests/test-nbd-tls-psk.sh +++ b/tests/test-nbd-tls-psk.sh @@ -73,9 +73,9 @@ LIBNBD_DEBUG=1 start_nbdkit -P "$pid2" -U "$sock2" --tls=off \ nbd tls=require tls-psk=keys.psk tls-username=qemu socket="$sock1" # Run unencrypted client -LANG=C qemu-img info -f raw "nbd+unix:///?socket=$sock2" > nbd-tls-psk.out +qemu-img info --output=json -f...
2020 Sep 22
0
Re: [libnbd PATCH v2] nbdsh: Catch nbd.Error from -c arguments
...try: > + for c in args.command: > + if c != '-': > + exec(c, d, d) > + else: > + exec(sys.stdin.read(), d, d) > + except nbd.Error as ex: > + if os.environ.get("LIBNBD_DEBUG", "0") == "1": Would it be better to use nbd.NBD().get_debug() == True, or h.get_debug() == True for this test instead of duplicating the logic inside libnbd? But sure, let's do this. ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat....
2020 Aug 14
0
[libnbd PATCH v2 09/13] info: Simplify by using nbd_opt_go
...--------------------- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/info/Makefile.am b/info/Makefile.am index 05b8137..d049d16 100644 --- a/info/Makefile.am +++ b/info/Makefile.am @@ -27,8 +27,6 @@ EXTRA_DIST = \ nbdinfo.pod \ $(NULL) -if HAVE_LIBXML2 - TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 LOG_COMPILER = $(top_builddir)/run TESTS = @@ -39,11 +37,9 @@ nbdinfo_SOURCES = nbdinfo.c nbdinfo_CPPFLAGS = -I$(top_srcdir)/include nbdinfo_CFLAGS = \ $(WARNINGS_CFLAGS) \ - $(LIBXML2_CFLAGS) \ $(NULL) nbdinfo_LDADD = \ $(top_builddir)/lib/libnbd.la \ - $(LIBXML2_LIBS) \ $(NULL) i...
2019 Sep 12
2
[libnbd PATCH] nbdsh: Start adding unit tests
...e.am +++ b/sh/Makefile.am @@ -21,6 +21,7 @@ EXTRA_DIST = \ nbdsh.pod \ examples/LICENSE-FOR-EXAMPLES \ examples/hexdump.sh \ + test-help.sh \ $(NULL) if HAVE_PYTHON @@ -40,8 +41,10 @@ nbdsh.1: nbdsh.pod $(top_builddir)/podwrapper.pl endif HAVE_POD -if HAVE_NBDKIT - TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 LOG_COMPILER = $(top_builddir)/run -TESTS = +TESTS = test-help.sh + +if HAVE_NBDKIT + +TESTS += endif HAVE_NBDKIT diff --git a/sh/test-help.sh b/sh/test-help.sh new file mode 100755 index 0000000..6ed1c9c --- /dev/null +++ b/sh/test-help.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# nbd client...
2019 Sep 11
0
[PATCH nbdkit] tests: Convert some tests to use nbdsh instead of qemu-io.
...*.log files in case there is a problem. +# Use the 'direct' backend, and ensure maximum libguestfs and libnbd +# debugging is written to the *.log files in case there is a problem. TESTS_ENVIRONMENT += \ LIBGUESTFS_ATTACH_METHOD=appliance \ LIBGUESTFS_DEBUG=1 \ LIBGUESTFS_TRACE=1 \ + LIBNBD_DEBUG=1 \ $(NULL) # Common test library. diff --git a/tests/test-error0.sh b/tests/test-error0.sh index fe97354..de9dca2 100755 --- a/tests/test-error0.sh +++ b/tests/test-error0.sh @@ -34,7 +34,7 @@ source ./functions.sh set -e set -x -requires qemu-io --version +requires nbdsh --version soc...
2019 Sep 16
1
[libnbd PATCH] api: Add set_handshake_flags for integration
...ca2e5a 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -64,6 +64,8 @@ nbd_create (void) h->unique = 1; h->tls_verify_peer = true; h->request_sr = true; + h->gflags = (LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE | + LIBNBD_HANDSHAKE_FLAG_NO_ZEROES); s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; @@ -258,6 +260,22 @@ nbd_unlocked_get_request_structured_replies (struct nbd_handle *h) return h->request_sr; } +int +nbd_unlocked_set_handshake_flags (struct nbd_handle *h, + uint32_t fla...
2020 Sep 04
0
[libnbd PATCH 2/2] api: Add STRICT_BOUNDS to nbd_set_strict_mode
...clear, this flag +relies on the server to detect out-of-bounds requests. + =back Future versions of libnbd may add further flags. diff --git a/lib/handle.c b/lib/handle.c index a1fa142..817fcd3 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -75,7 +75,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->strict = LIBNBD_STRICT_COMMANDS; + h->strict = LIBNBD_STRICT_COMMANDS | LIBNBD_STRICT_BOUNDS; h->public_state = STATE_START; h->state = STATE_START; diff --git a/lib/rw.c b/lib/rw.c index b5c1698..adfb7...
2019 Jun 05
0
[PATCH libnbd 4/4] lib: Atomically update h->state when leaving the locked region.
...;& + !nbd_internal_is_state_dead (get_next_state (h))) { if (nbd_unlocked_poll (h, -1) == -1) return -1; } diff --git a/lib/handle.c b/lib/handle.c index cc311ba..8bf5280 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -57,7 +57,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->state = STATE_START; + h->state = h->next_state = STATE_START; h->pid = -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 7290247..1bef1c2 100644 --- a/...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
We have been inconsistent on how much we reject client-side without even consulting the server, vs. how much we depend on the server to detect failure (even if our request can be deemed undefined per NBD protocol). I'd like to change it so that by default, we reject as much as we can client-side for less traffic, but where the user can also change things on the fly for server-side integration
2019 Sep 04
2
[libnbd PATCH] api: Add way to avoid structured replies
...EPLY); h->sbuf.option.optlen = htobe32 (0); diff --git a/lib/handle.c b/lib/handle.c index f8cc83a..c23ef01 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -63,6 +63,7 @@ nbd_create (void) h->unique = 1; h->tls_verify_peer = true; + h->request_sr = true; s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; @@ -242,6 +243,20 @@ nbd_unlocked_add_meta_context (struct nbd_handle *h, const char *name) return 0; } +int +nbd_unlocked_set_request_structured_replies (struct nbd_handle *h, + b...
2023 Oct 10
5
[PATCH libnbd 0/4] Miscellaneous Rust cleanups
Add an overview libnbd-rust(3) man page pointing to the real documentation. This is like OCaml & Golang. When reviewing the real rustdocs I noticed they basically converted the man pages into plain text, resulting in lots of problems such as internal links not working, no `code` annotations, etc. So I wrote a simple POD to rustdoc translator. It is by no means perfect, but it fixes many of
2020 Sep 11
0
[libnbd PATCH v2 1/5] api: Add xxx_MASK constant for each Flags type
...ransports = LIBNBD_ALLOW_TRANSPORT_MASK; h->uri_allow_tls = LIBNBD_TLS_ALLOW; h->uri_allow_local_file = false; - h->gflags = (LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE | - LIBNBD_HANDSHAKE_FLAG_NO_ZEROES); + h->gflags = LIBNBD_HANDSHAKE_FLAG_MASK; s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; diff --git a/python/t/110-defaults.py b/python/t/110-defaults.py index 47c1d02..fb961cf 100644 --- a/python/t/110-defaults.py +++ b/python/t/110-defaults.py @@ -22,6 +22,5 @@ assert h.get_export_name() == "" assert h.g...
2019 Jun 08
0
[PATCH libnbd v3] lib: Atomically update h->state when leaving the locked region.
...;& + !nbd_internal_is_state_dead (get_next_state (h))) { if (nbd_unlocked_poll (h, -1) == -1) return -1; } diff --git a/lib/handle.c b/lib/handle.c index e40b274..300eac7 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -57,7 +57,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->state = STATE_START; + h->state = h->public_state = STATE_START; h->pid = -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 61ddbde..503bf34 100644 ---...
2019 Jun 27
1
[libnbd PATCH] maint: Use $(NULL) for all Makefile.am macro lists
...-git a/interop/Makefile.am b/interop/Makefile.am index cf36e34..1d2d187 100644 --- a/interop/Makefile.am +++ b/interop/Makefile.am @@ -19,7 +19,8 @@ include $(top_srcdir)/subdir-rules.mk EXTRA_DIST = \ dirty-bitmap.sh \ - structured-read.sh + structured-read.sh \ + $(NULL) TESTS_ENVIRONMENT = LIBNBD_DEBUG=1 LOG_COMPILER = $(top_builddir)/run @@ -49,11 +50,13 @@ check_PROGRAMS += \ interop-qemu-nbd-tls-certs \ interop-qemu-nbd-tls-psk \ dirty-bitmap \ - structured-read + structured-read \ + $(NULL) TESTS += \ interop-qemu-nbd \ dirty-bitmap.sh \ - structured-read.sh + structured-read.sh \...
2019 Jun 05
1
[PATCH libnbd v2] lib: Atomically update h->state when leaving the locked region.
...;& + !nbd_internal_is_state_dead (get_next_state (h))) { if (nbd_unlocked_poll (h, -1) == -1) return -1; } diff --git a/lib/handle.c b/lib/handle.c index cc311ba..4167b3e 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -57,7 +57,7 @@ nbd_create (void) s = getenv ("LIBNBD_DEBUG"); h->debug = s && strcmp (s, "1") == 0; - h->state = STATE_START; + h->state = h->public_state = STATE_START; h->pid = -1; h->export_name = strdup (""); diff --git a/lib/internal.h b/lib/internal.h index 5b6152b..ce4bf5b 100644 ---...