Displaying 20 results from an estimated 37 matches for "set_export_name".
2023 Jul 16
1
[libnbd PATCH] api: Fix block status assertion under set_strict bypass
...>meta_context_base_allocation);
| assert (cmd == NBD_CMD_BLOCK_STATUS);
|
| blocks = extents_to_block_descriptors (extents, flags, count, offset,
plus this sequence:
$ patched/nbdkit memory 1M
$ ./run nbdsh --opt-mode -u nbd://localhost
nbd> h.set_request_meta_context(False)
nbd> h.set_export_name('a')
nbd> def c(arg):
... pass
...
nbd> h.opt_set_meta_context_queries(['base:allocation'], c)
1
nbd> h.set_export_name('')
nbd> h.opt_go()
nbd> h.set_strict_mode(0)
nbd> h.block_status(1024*1024, 0, c)
nbdsh: generator/states-reply-chunk.c:425: enter_STA...
2020 Aug 19
3
[libnbd PATCH 0/2] NBD_OPT_INFO support
This replaces 13/13 of my v2 series; and now that it has pretty good
testsuite coverage and demonstrable performance improvement to
nbdinfo, I'm going ahead and pushing this now. We may still want to
add further nbd_opt_* commands for other fine-grained tuning of
negotiation, but for now, I think things have stabilized on this end,
and I can return to polishing .list_exports on the nbdkit
2020 Sep 21
0
[nbdkit PATCH v3 03/14] server: Respond to NBD_INFO_NAME request
...o ;;
+ open) echo "$3" ;;
+ export_description) echo "$2 world" ;;
+ get_size) echo 0 ;;
+ *) exit 2 ;;
+esac
+EOF
+
+# Without client request, nothing is advertised
+nbdsh -c '
+import os
+
+h.set_opt_mode(True)
+h.connect_unix(os.environ["sock"])
+
+h.set_export_name("a")
+h.opt_info()
+try:
+ h.get_canonical_export_name()
+ assert False
+except nbd.Error as ex:
+ pass
+
+h.set_export_name("")
+h.opt_info()
+try:
+ h.get_canonical_export_name()
+ assert False
+except nbd.Error as ex:
+ pass
+
+h.opt_go()
+try:
+ h.get_canonical_export...
2019 Sep 05
1
Re: [PATCH libnbd] generator: Move first_version fields to a single table.
...t first_version = [
> + "set_debug", (1, 0);
> + "get_debug", (1, 0);
> + "set_debug_callback", (1, 0);
> + "clear_debug_callback", (1, 0);
> + "set_handle_name", (1, 0);
> + "get_handle_name", (1, 0);
> + "set_export_name", (1, 0);
> + "get_export_name", (1, 0);
> + "set_tls", (1, 0);
> + "get_tls", (1, 0);
> + "set_tls_certificates", (1, 0);
> + (*"get_tls_certificates", (1, 0);*)
If we ever do implement this (and any other commented out fo...
2020 Aug 14
0
[libnbd PATCH v2 12/13] wip: api: Give aio_opt_go a completion callback
...Quit the shell
help (nbd) # Display documentation
nbd> h.set_opt_mode(True)
nbd> h.connect_command(["nbdkit","-s","--exit-","eval",
"open=echo ENOENT >&2; exit 1"])
nbd> h.aio_is_negotiating()
True
nbd> h.set_export_name('a')
nbd> h.opt_go()
nbdkit: eval: error: /tmp/nbdkitNyQD8J/open: ENOENT
nbd> h.set_export_name('b')
nbd> h.opt_go()
nbdkit: eval: error: /tmp/nbdkitNyQD8J/open: ENOENT
nbd> h.set_opt_mode(True)
Traceback (most recent call last):
File "/usr/lib64/python3.8/code.py...
2020 Aug 08
1
Re: [nbdkit PATCH 3/3] tlsdummy: New filter
...ected tls mode' 2>&1; exit 1
+ echo insecure; exit 0
+ fi
+ echo $3 ;;
+ get_size) echo 6 ;;
+ pread) echo "$2" | dd skip=$4 count=$3 iflag=skip_bytes,count_bytes ;;
+ *) exit 2;
+esac
+EOF
+
+# Plaintext client sees only dummy volume
+nbdsh -c '
+import os
+h.set_export_name ("hello")
+h.connect_unix (os.environ["sock"])
+assert h.get_size () == 512
+assert h.pread (5, 0) == b"dummy"
+'
+
+# Encrypted client sees desired volumes
+nbdsh -c '
+import os
+h.set_export_name ("hello")
+h.set_tls (nbd.TLS_REQUIRE)
+h.set_tls_ps...
2019 Sep 12
3
Re: [PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.
...uot; "test" "/" "//" " " \
> + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
> +do
> + export e sock
> + nbdsh -c '
> +import os
> +
> +e = os.environ["e"]
> +h.set_export_name (e)
> +h.connect_unix (os.environ["sock"])
Could be done with nbdsh --connect "nbd+unix://$e?socket=$sock". But
what you did here works as well (--uri would work too once you could
rely on nbdsh 1.2, but for now sticking to --connect is more portable)
> +
> +size = h...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...sh - <<'EOF'
case "$1" in
@@ -59,36 +58,34 @@ EOF
nbdsh -c '
import os
+def must_fail(f, *args, **kwds):
+ try:
+ f(*args, **kwds)
+ assert False
+ except nbd.Error:
+ pass
+
h.set_opt_mode(True)
h.connect_unix(os.environ["sock"])
h.set_export_name("a")
h.opt_info()
-try:
- h.get_canonical_export_name()
- assert False
-except nbd.Error as ex:
- pass
+must_fail(h.get_canonical_export_name)
+must_fail(h.get_export_description)
h.set_export_name("")
h.opt_info()
-try:
- h.get_canonical_export_name()
- assert False
-e...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those
then I can rebase this one on top.
Rich.
2023 Jul 16
2
[libnbd PATCH] api: Fix block status assertion under set_strict bypass
...t (cmd == NBD_CMD_BLOCK_STATUS);
> |
> | blocks = extents_to_block_descriptors (extents, flags, count, offset,
>
> plus this sequence:
>
> $ patched/nbdkit memory 1M
> $ ./run nbdsh --opt-mode -u nbd://localhost
> nbd> h.set_request_meta_context(False)
> nbd> h.set_export_name('a')
> nbd> def c(arg):
> ... pass
> ...
> nbd> h.opt_set_meta_context_queries(['base:allocation'], c)
> 1
> nbd> h.set_export_name('')
> nbd> h.opt_go()
> nbd> h.set_strict_mode(0)
> nbd> h.block_status(1024*1024, 0, c)
> nb...
2019 Sep 15
0
[PATCH nbdkit 1/4] Add reflection plugin.
..."xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+do
+ nbdsh -c '
+import os
+import base64
+
+e = os.environ["e"]
+b = base64.b64encode(e.encode("utf-8")).decode("utf-8")
+print ("e = %r, b = %r" % (e,b))
+h.set_export_name (b)
+h.connect_unix (os.environ["sock"])
+
+size = h.get_size ()
+assert size == len (e.encode("utf-8"))
+
+# Zero-sized reads are not defined in the NBD protocol.
+if size > 0:
+ buf = h.pread (size, 0)
+ assert buf == e.encode("utf-8")
+'
+done
+
+# Test t...
2019 Jun 27
1
[libnbd PATCH] python: Fix bindings for Path parameters
...with
a python connection to that socket:
$ ~/qemu/qemu-nbd -r -k /tmp/nbdsock --object \
tls-creds-psk,id=tls0,endpoint=server,dir=/home/eblake/libnbd/tests \
--tls-creds tls0 -f raw -x / tmpfile
$ ./run nbdsh
nbd> h.set_tls_psk_file('tests/keys.psk')
nbd> h.set_tls(2)
nbd> h.set_export_name('/')
nbd> h.connect_unix('/tmp/nbdsock')
instead of getting a segfault.
---
generator/generator | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/generator/generator b/generator/generator
index c29460c..fa12232 100755
--- a/generator/generator
++...
2020 Sep 28
0
[libnbd PATCH 3/3] api: Add nbd_opt_list_meta_context
...k "opt_list";
- Link "opt_info"];
+ Link "opt_info"; Link "opt_list_meta_context"];
};
"get_opt_mode", {
@@ -960,6 +965,56 @@ corresponding L<nbd_opt_go(3)> would succeed.";
Link "set_export_name"];
};
+ "opt_list_meta_context", {
+ default_call with
+ args = [ Closure context_closure ]; ret = RInt;
+ permitted_states = [ Negotiating ];
+ shortdesc = "request the server to list available meta contexts";
+ longdesc = "\
+Request that the serv...
2019 Sep 12
0
[PATCH nbdkit v2 3/3] tests: Add a simple test of nbdkit_export_name.
...ames from the plugin.
+for e in "" "test" "/" "//" " " \
+ "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
+do
+ export e sock
+ nbdsh -c '
+import os
+
+e = os.environ["e"]
+h.set_export_name (e)
+h.connect_unix (os.environ["sock"])
+
+size = h.get_size ()
+print ("size=%r e=%r" % (size, e))
+assert size == len (e)
+
+# Zero-sized reads are not defined in the NBD protocol.
+if size > 0:
+ buf = h.pread (size, 0)
+ print ("buf=%r e=%r" % (buf, e))
+...
2019 Jul 17
0
Re: [PATCH] Add Rust bindings
..."base:allocation")
> .set.export_name("/")
> .set_debug(true)
> .connect_uri("nbd://")
>
> And then you would be able to do, e.g.:
>
> h.pread();
> h.set_debug(false)
>
> But not:
>
> h.set_export_name("/exp");
>
> as the object `h` would not even support that function.
>
> Anyway, even though it would be useful for libguestfs as well, thanks to
> the way
> these projects handle errors it is just something I consider
> "nice-to-have".
>
> Have a nice...
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a
single nbd connection for all cases when reading the heads of the
file is not required), but I'm happy with patches 1-11, and 12-13
show where I'm headed for getting NBD_OPT_INFO to work. Posting
now to see if some of the earlier patches are ready to commit while
I continue working on the latter half.
Eric Blake (13):
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...st stable version was 1.2.
+ *)
+let first_version = [
+ "set_debug", (1, 0);
+ "get_debug", (1, 0);
+ "set_debug_callback", (1, 0);
+ "clear_debug_callback", (1, 0);
+ "set_handle_name", (1, 0);
+ "get_handle_name", (1, 0);
+ "set_export_name", (1, 0);
+ "get_export_name", (1, 0);
+ "set_tls", (1, 0);
+ "get_tls", (1, 0);
+ "set_tls_certificates", (1, 0);
+ (*"get_tls_certificates", (1, 0);*)
+ "set_tls_verify_peer", (1, 0);
+ "get_tls_verify_peer", (1, 0)...
2019 Sep 16
2
Re: [PATCH nbdkit 1/4] Add reflection plugin.
...> +
> +# Test that it fails if the caller passes in non-base64 data. The
> +# server drops the connection in this case so it's not very graceful
> +# but we should at least get an nbd.Error and not something else.
> +nbdsh -c '
> +import os
> +import sys
> +
> +h.set_export_name ("xyz")
> +try:
> + h.connect_unix (os.environ["sock"])
> + # This should not happen.
> + sys.exit (1)
> +except nbd.Error as ex:
> + sys.exit (0)
> +# This should not happen.
> +sys.exit (1)
The test looks good. (Yeah, figuring out how to m...
2019 Sep 12
4
[PATCH nbdkit v2 0/3] Access export name from plugins.
The previous incomplete patch was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00049.html
based on earlier discussion here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00047.html
In v2:
- The previous patch was incomplete. This version completes it by
adding tests and extending nbdkit-sh-plugin.
- nbdkit_export_name now returns NULL for error,
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on
.export_descriptions and a new exportname filter. I think it is
now ready to check in.
Things I'd still like in 1.22:
- the file plugin should implement .list_exports (patch already posted,
but it needs rebasing on this series)
- the ext2 filter should override .list_exports when in exportname mode
- the nbd plugin should be