Displaying 20 results from an estimated 32 matches for "connect_uri".
Did you mean:
connect_unix
2019 Aug 10
2
Re: [PATCH libnbd 9/9] FOR DISCUSSION ONLY: api: Add ‘allow’ parameter to nbd_connect_uri to control permitted URIs.
On 8/10/19 8:02 AM, Richard W.M. Jones wrote:
> Add an extra parameter to nbd_connect_uri to control what URIs are
> permitted, in case the caller wants to pass in user-controlled URIs
> but have some control over who/what/how the connection happens. For
> example:
>
> nbd_connect_uri (nbd, "nbd://localhost", LIBNBD_CONNECT_URI_REQUIRE_TLS)
> => erro...
2020 Sep 05
1
Re: libnbd completion callback question
...k of a
double free error), and thus that this is worth fixing by guaranteeing
closure cleanup even on client-side failures:
$ export count=10
$ nbdkit null 1m --run 'export uri; /usr/bin/time -v nbdsh -c "
h.set_request_structured_replies(False)
def f (c, o, e, err):
pass
import os
h.connect_uri(os.environ[\"uri\"])
for _ in range(int(os.environ[\"count\"])):
try:
h.block_status(512, 0, f)
except nbd.Error as ex:
pass
print(\"got here\")
"' 2>&1 | grep '\(here\|resident\)'
got here
print("got here")
Maximum re...
2023 Aug 20
1
[libnbd PATCH v8 04/10] rust: Make it possible to run examples with a URI
...socket = &args[1];
- // Connect to the NBD server over a
- // Unix domain socket.
- nbd.connect_unix(socket)?;
+ // Check if the user provided a URI or a unix socket.
+ let socket_or_uri = args[1].to_str().unwrap();
+ if socket_or_uri.contains("://") {
+ nbd.connect_uri(socket_or_uri)?;
+ } else {
+ // Connect to the NBD server over a Unix domain socket.
+ nbd.connect_unix(socket_or_uri)?;
+ }
// Read the first sector synchronously.
let mut buf = [0; 512];
diff --git a/rust/examples/get-size.rs b/rust/examples/get-size.rs
index 7f31...
2013 Sep 18
2
Trouble using virStream with callbacks
...1] https://www.redhat.com/archives/libvir-list/2012-December/msg01084.html
---
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libvirt/libvirt.h>
#include <fcntl.h>
#define CONNECT_URI "qemu:///system"
#define DOMAIN "TestVM"
#define CHANNEL "channel.0"
#define BUF_SIZE 80
int stream_active = 1;
void
stdin_to_stream(int watch, int fd, int events, void *opaque)
{
virStreamPtr stream = *((virStreamPtr*)(opaque));
if (events & VIR_EVENT_HAND...
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:
2019 Sep 12
1
[libnbd PATCH v2] nbdsh: Prefer --uri over --connect
...parser.add_argument ('-V', '--version', action='version',
@@ -56,8 +58,8 @@ help (nbd) # Display documentation
if args.base_allocation:
h.add_meta_context (nbd.CONTEXT_BASE_ALLOCATION)
- if args.connect is not None:
- h.connect_uri (args.connect)
+ if args.uri is not None:
+ h.connect_uri (args.uri)
# If there are no -c or --command parameters, go interactive,
# otherwise we run the commands and exit.
if not args.command:
diff --git a/sh/test-context.sh b/sh/test-context.sh
index 9a7d3ab..ab3ae80 1007...
2020 Sep 28
2
[libnbd PATCH] nbdsh: Add --opt-mode command line option
...th C<-c>
+would be too late).
+
=item B<-c ->
=item B<--command ->
@@ -85,6 +96,12 @@ Read standard input and execute it as a command.
Connect to the given L<NBD URI|https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md>.
This is equivalent to the S<C<h.connect_uri(URI)>> command in the shell.
+Note that the connection is created prior to processing any C<-c>
+commands, which prevents the use of configuration commands such as
+S<C<h.add_meta_context(>NAMEC<)>> from the command line when mixed
+with this option. The options C<...
2020 Sep 05
2
libnbd completion callback question
I noticed while reading the code that we have a documentation hole that
may cause memory leaks for clients that are unaware, in relation to
completion callbacks.
The situation arises as follows: for all commands with a completion
callback, I checked that the code has clean semantics: either
nbd_aio_FOO() returns -1 and we never call the callback cleanup, or
nbd_aio_FOO() returns a cookie and
2019 Aug 10
0
[PATCH libnbd 9/9] FOR DISCUSSION ONLY: api: Add ‘allow’ parameter to nbd_connect_uri to control permitted URIs.
Add an extra parameter to nbd_connect_uri to control what URIs are
permitted, in case the caller wants to pass in user-controlled URIs
but have some control over who/what/how the connection happens. For
example:
nbd_connect_uri (nbd, "nbd://localhost", LIBNBD_CONNECT_URI_REQUIRE_TLS)
=> error: URI must specify an encrypt...
2019 Jul 17
0
Re: [PATCH] Add Rust bindings
...the
> builder
> pattern to create a handle prepared to be connected (or even connect it):
>
> let h = Nbd::new()
> .add_meta_context("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 usef...
2019 Sep 12
2
[libnbd PATCH] nbdsh: Add -b option to simplify h.block_status
...#39;append',
@@ -52,6 +54,8 @@ exit() or Ctrl-D # Quit the shell
help (nbd) # Display documentation
'''
+ if args.base_allocation:
+ h.add_meta_context (nbd.CONTEXT_BASE_ALLOCATION)
if args.connect is not None:
h.connect_uri (args.connect)
# If there are no -c or --command parameters, go interactive,
diff --git a/sh/Makefile.am b/sh/Makefile.am
index 8f70e69..415e241 100644
--- a/sh/Makefile.am
+++ b/sh/Makefile.am
@@ -21,6 +21,7 @@ EXTRA_DIST = \
nbdsh.pod \
examples/LICENSE-FOR-EXAMPLES \
examples/hexdump....
2019 Aug 11
0
Re: [PATCH libnbd 9/9] FOR DISCUSSION ONLY: api: Add ‘allow’ parameter to nbd_connect_uri to control permitted URIs.
On Sat, Aug 10, 2019 at 04:50:18PM -0500, Eric Blake wrote:
> On 8/10/19 8:02 AM, Richard W.M. Jones wrote:
> > +++ b/docs/libnbd.pod
> > @@ -364,7 +364,7 @@ when it is available.
> >
> > To connect to a URI via the high level API, use:
> >
> > - nbd_connect_uri (nbd, "nbd://example.com/");
> > + nbd_connect_uri (nbd, "nbd://example.com/", LIBNBD_CONNECT_URI_ALL);
>
> As written later in this patch, this change in the docs and example code
> implies the use of the REQUIRE_TLS flag. Is that intentional that
> passing...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...quot;does the server support the fast zero flag?";
longdesc = "\
Returns true if the server supports the use of the
@@ -2374,7 +2375,93 @@ Returns true if libnbd was compiled with libxml2 which is required
to support NBD URIs, or false if not.";
see_also = ["L<nbd_connect_uri(3)>"; "L<nbd_aio_connect_uri(3)>"];
};
+]
+(* The first stable version that the symbol appeared in, for
+ * example (1, 2) if the symbol was added in development cycle
+ * 1.1.x and thus the first stable version was 1.2.
+ *)
+let first_version = [
+ "set_debug&qu...
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.
2019 Jul 08
2
Re: [PATCH] Add Rust bindings
On Mon, Jul 08, 2019 at 10:10:10AM +0200, Pino Toscano wrote:
>On Saturday, 6 July 2019 13:03:24 CEST Martin Kletzander wrote:
>> Just one thing, the Cargo.toml includes a version under which the crate would be
>> published. I presume the version would be the same as the one of the project
>> itself, i.e. when releasing libguestfs-x.y.z, we publish guestfs-rs-x.y.z to
2019 Oct 20
0
[PATCH libnbd] api: Allow NBD URIs to be restricted.
...any transports.
+
+The C<mask> parameter may contain any of the following flags
+ORed together:
+
+=over 4
+
+=item C<LIBNBD_ALLOW_TRANSPORT_TCP>
+
+=item C<LIBNBD_ALLOW_TRANSPORT_UNIX>
+
+=item C<LIBNBD_ALLOW_TRANSPORT_VSOCK>
+
+=back";
+ see_also = ["L<nbd_connect_uri(3)>"; "L<nbd_set_uri_allow_tls(3)>"];
+ };
+
+ "set_uri_allow_tls", {
+ default_call with
+ args = [ Enum ("tls", tls_enum) ]; ret = RErr;
+ permitted_states = [ Created ];
+ shortdesc = "set the allowed TLS settings in NBD URIs";...
2019 Jun 04
0
[PATCH libnbd v2 3/4] api: Implement concurrent writer.
...is no
+way to recover from such errors, the connection will move to the
+dead state soon after.
+
+The parameter is the C<errno> returned by the failed L<send(2)> call.
+It must be non-zero.
+
+See L<libnbd(3)/Concurrent writer thread> for how to use this.";
+ };
+
"connect_uri", {
default_call with
args = [ String "uri" ]; ret = RErr;
diff --git a/lib/handle.c b/lib/handle.c
index cc311ba..cc5d40f 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -215,6 +215,38 @@ nbd_add_close_callback (struct nbd_handle *h, nbd_close_callback cb, void *data)
r...
2019 Jun 03
1
Re: [PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...connection will move to the
> +dead state soon after.
> +
> +The parameter is the C<errno> returned by the failed L<send(2)> call.
> +It must be non-zero.
> +
> +See L<libnbd(3)/Concurrent writer thread> for how to use this.";
> + };
> +
> "connect_uri", {
>
> +int
> +nbd_unlocked_set_concurrent_writer (struct nbd_handle *h,
> + void *data, writer_cb writer)
> +{
> + /* I suppose we could allow this, but it seems more likely that
> + * it's an error rather than intentional.
&g...
2019 Oct 20
2
[PATCH libnbd] api: Allow NBD URIs to be restricted.
Previous discussion:
https://www.redhat.com/archives/libguestfs/2019-August/msg00102.html
Last night I experimentally added support for URIs that contain the
query parameter tls-psk-file, as part of rewriting the tests to cover
more of the URI code. So you can now have a URI like:
nbds://alice@localhost/?tls-psk-file=keys.psk
However there's an obvious security problem here because now
2019 Jun 03
0
[PATCH libnbd discussion only 4/5] api: Implement concurrent writer.
...is no
+way to recover from such errors, the connection will move to the
+dead state soon after.
+
+The parameter is the C<errno> returned by the failed L<send(2)> call.
+It must be non-zero.
+
+See L<libnbd(3)/Concurrent writer thread> for how to use this.";
+ };
+
"connect_uri", {
default_call with
args = [ String "uri" ]; ret = RErr;
@@ -3157,12 +3186,13 @@ let print_python_binding name { args; ret } =
pr " PyObject *py_%s = PyList_New (%s);\n" n len;
pr " for (size_t i = 0; i < %s; ++i)\n" len;...