Displaying 14 results from an estimated 14 matches for "nbd_unlocked_can_df".
2019 May 28
0
[libnbd PATCH 4/4] api: Add DF flag support for pread
...lacks structured replies, ignoring claim of df");
+ eflags &= ~NBD_FLAG_SEND_DF;
+ }
+
h->exportsize = exportsize;
h->eflags = eflags;
return 0;
@@ -95,6 +100,12 @@ nbd_unlocked_can_zero (struct nbd_handle *h)
return get_flag (h, NBD_FLAG_SEND_WRITE_ZEROES);
}
+int
+nbd_unlocked_can_df (struct nbd_handle *h)
+{
+ return get_flag (h, NBD_FLAG_SEND_DF);
+}
+
int
nbd_unlocked_can_multi_conn (struct nbd_handle *h)
{
diff --git a/lib/rw.c b/lib/rw.c
index feaf468..343c340 100644
--- a/lib/rw.c
+++ b/lib/rw.c
@@ -234,11 +234,17 @@ int64_t
nbd_unlocked_aio_pread (struct nbd_handle...
2019 Jun 21
0
[libnbd PATCH v2 5/5] states: Add DF flag support for pread
...lacks structured replies, ignoring claim of df");
+ eflags &= ~NBD_FLAG_SEND_DF;
+ }
+
h->exportsize = exportsize;
h->eflags = eflags;
return 0;
@@ -95,6 +100,12 @@ nbd_unlocked_can_zero (struct nbd_handle *h)
return get_flag (h, NBD_FLAG_SEND_WRITE_ZEROES);
}
+int
+nbd_unlocked_can_df (struct nbd_handle *h)
+{
+ return get_flag (h, NBD_FLAG_SEND_DF);
+}
+
int
nbd_unlocked_can_multi_conn (struct nbd_handle *h)
{
diff --git a/lib/nbd-protocol.h b/lib/nbd-protocol.h
index 071971e..405af3e 100644
--- a/lib/nbd-protocol.h
+++ b/lib/nbd-protocol.h
@@ -245,6 +245,7 @@ struct nbd_st...
2019 May 28
2
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
...64_t offset, uint32_t flags)
> {
> - if (flags != 0) {
> + if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) {
> set_error (EINVAL, "invalid flag: %" PRIu32, flags);
> return -1;
> }
>
> + if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
> + nbd_unlocked_can_df (h) != 1) {
> + set_error (EINVAL, "server does not support the DF flag");
> + return -1;
> + }
I'm confused why you'd want to specify this flag to pread. From the
caller point of view they shouldn't care about whether the reply on
the wire is fragmented or n...
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...PRIu32, flags);
- return -1;
- }
+ if (h->strict & LIBNBD_STRICT_COMMANDS) {
+ if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) {
+ set_error (EINVAL, "invalid flag: %" PRIu32, flags);
+ return -1;
+ }
- if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
- nbd_unlocked_can_df (h) != 1) {
- set_error (EINVAL, "server does not support the DF flag");
- return -1;
+ if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
+ nbd_unlocked_can_df (h) != 1) {
+ set_error (EINVAL, "server does not support the DF flag");
+ return -1;
+...
2019 May 28
0
Re: [libnbd PATCH 4/4] api: Add DF flag support for pread
...t; {
>> - if (flags != 0) {
>> + if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) {
>> set_error (EINVAL, "invalid flag: %" PRIu32, flags);
>> return -1;
>> }
>>
>> + if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
>> + nbd_unlocked_can_df (h) != 1) {
>> + set_error (EINVAL, "server does not support the DF flag");
>> + return -1;
>> + }
>
> I'm confused why you'd want to specify this flag to pread. From the
> caller point of view they shouldn't care about whether the reply on...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...e25 100644
--- a/lib/rw.c
+++ b/lib/rw.c
@@ -295,10 +295,12 @@ nbd_unlocked_aio_pread_structured (struct nbd_handle *h, void *buf,
struct command_cb cb = { .fn.chunk = *chunk,
.completion = *completion };
- if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
- nbd_unlocked_can_df (h) != 1) {
- set_error (EINVAL, "server does not support the DF flag");
- return -1;
+ if (h->strict & LIBNBD_STRICT_COMMANDS) {
+ if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
+ nbd_unlocked_can_df (h) != 1) {
+ set_error (EINVAL, "server does no...
2019 Aug 23
1
[libnbd PATCH 1/1] api: Add support for FAST_ZERO flag
...tsize = exportsize;
h->eflags = eflags;
return 0;
@@ -100,6 +106,12 @@ nbd_unlocked_can_zero (struct nbd_handle *h)
return get_flag (h, NBD_FLAG_SEND_WRITE_ZEROES);
}
+int
+nbd_unlocked_can_fast_zero (struct nbd_handle *h)
+{
+ return get_flag (h, NBD_FLAG_SEND_FAST_ZERO);
+}
+
int
nbd_unlocked_can_df (struct nbd_handle *h)
{
diff --git a/lib/protocol.c b/lib/protocol.c
index 6087887..acee203 100644
--- a/lib/protocol.c
+++ b/lib/protocol.c
@@ -36,6 +36,7 @@ nbd_internal_errno_of_nbd_error (uint32_t error)
case NBD_EINVAL: return EINVAL;
case NBD_ENOSPC: return ENOSPC;
case NBD_EOVERFL...
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 May 28
6
[RFC libnbd PATCH 0/4] Add CMD_FLAG_DF support
RFC because this is an API break, but we haven't declared stable API
yet. If we like it, I'm working on using libnbd to implement the
nbdkit-nbd plugin; knowing whether it is API version 0.1 or 0.2 will
be useful. I also dabbled with allowing optional parameters in python,
although my OCaml is weak enough that there may be cleaner ways to
approach that.
Eric Blake (4):
api: Add flags
2020 Sep 11
0
[libnbd PATCH v2 2/5] generator: Refactor filtering of accepted OFlags
...command_cb cb = { .fn.chunk = *chunk,
.completion = *completion };
- if ((flags & ~LIBNBD_CMD_FLAG_DF) != 0) {
- set_error (EINVAL, "invalid flag: %" PRIu32, flags);
- return -1;
- }
-
if ((flags & LIBNBD_CMD_FLAG_DF) != 0 &&
nbd_unlocked_can_df (h) != 1) {
set_error (EINVAL, "server does not support the DF flag");
@@ -334,11 +320,6 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf,
return -1;
}
- if ((flags & ~LIBNBD_CMD_FLAG_FUA) != 0) {
- set_error (EINVAL, "invalid flag: %" PRIu...
2019 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1:
- rebase to applied patches
- split out support for Int in callbacks
- sort of test that callbacks work in OCaml (see comment in patch 5)
- rename API to nbd_pread_structured
- expose error as explicit parameter to callback
Eric Blake (5):
generator: Allow Int in callbacks
states: Wire in a read callback
states: Add nbd_pread_structured API
states: Add tests for
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2:
- now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE
- four flags instead of two: STRICT_FLAGS is new (patch 4),
and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5)
- various refactorings for more shared code and less duplication
Eric Blake (5):
api: Add xxx_MASK constant for each Flags type
generator: Refactor filtering of accepted OFlags
api: Add
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding
NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished
enough of an implementation to feel confident in posting it.
I'd still like to add something under examples/ that uses the new API
to implement strict checking of a server's structured replies read
implementation (ensure that a server never sends data after
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem
to four different projects:
- nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag
- qemu: Implement the flag for both clients and server
- libnbd: Implement the flag for clients
- nbdkit: Implement the flag for servers, including the nbd passthrough
client
If you want to test the patches together, I've pushed a