Displaying 20 results from an estimated 48 matches for "nbd_flag_send_trim".
2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...G_SEND_FUA;
+ conn->can_flush = 1;
+ }
+
+ fl = plugin_is_rotational (conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_ROTATIONAL;
+ conn->is_rotational = 1;
+ }
+
+ fl = plugin_can_trim (conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_SEND_TRIM;
+ conn->can_trim = 1;
+ }
+
+ *flags = eflags;
+ return 0;
+}
+
+static int
_negotiate_handshake_oldstyle (struct connection *conn)
{
struct old_handshake handshake;
int64_t r;
uint64_t exportsize;
uint16_t gflags, eflags;
- int fl;
/* In --tls=require / FORCEDTLS mode,...
2016 Sep 26
1
[PATCH] nbdkit: flags are 32 bits for oldstyle connections
..._FUA;
conn->can_flush = 1;
}
@@ -192,7 +191,7 @@
if (fl == -1)
return -1;
if (fl) {
- eflags |= NBD_FLAG_ROTATIONAL;
+ flags |= NBD_FLAG_ROTATIONAL;
conn->is_rotational = 1;
}
@@ -200,7 +199,7 @@
if (fl == -1)
return -1;
if (fl) {
- eflags |= NBD_FLAG_SEND_TRIM;
+ flags |= NBD_FLAG_SEND_TRIM;
conn->can_trim = 1;
}
@@ -208,19 +207,17 @@
if (fl == -1)
return -1;
if (fl) {
- eflags |= NBD_FLAG_SEND_MARKNOREMANENCE;
+ flags |= NBD_FLAG_SEND_MARKNOREMANENCE;
conn->can_marknoremanence = 1;
}
- debug ("oldstyle...
2018 Jan 24
0
[nbdkit PATCH 1/3] connections: Don't advertise TRIM on readonly connection
...+++ b/src/connections.c
@@ -427,6 +427,14 @@ compute_eflags (struct connection *conn, uint16_t *flags)
}
if (!conn->readonly) {
eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
+
+ fl = backend->can_trim (backend, conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_SEND_TRIM;
+ conn->can_trim = 1;
+ }
}
fl = backend->can_flush (backend, conn);
@@ -445,14 +453,6 @@ compute_eflags (struct connection *conn, uint16_t *flags)
conn->is_rotational = 1;
}
- fl = backend->can_trim (backend, conn);
- if (fl == -1)
- return -1;
- if (fl)...
2020 Mar 17
0
[nbdkit PATCH 2/4] nbd: Normalize return values of can_*
...@@ nbd_is_rotational (void *handle)
{
struct handle *h = handle;
- return h->flags & NBD_FLAG_ROTATIONAL;
+ return !!(h->flags & NBD_FLAG_ROTATIONAL);
}
static int
@@ -1191,7 +1191,7 @@ nbd_can_trim (void *handle)
{
struct handle *h = handle;
- return h->flags & NBD_FLAG_SEND_TRIM;
+ return !!(h->flags & NBD_FLAG_SEND_TRIM);
}
static int
@@ -1199,7 +1199,7 @@ nbd_can_zero (void *handle)
{
struct handle *h = handle;
- return h->flags & NBD_FLAG_SEND_WRITE_ZEROES;
+ return !!(h->flags & NBD_FLAG_SEND_WRITE_ZEROES);
}
static int
@@ -1215,7 +12...
2020 Mar 17
2
Re: [nbdkit PATCH 2/4] nbd: Normalize return values of can_*
...*h = handle;
>
> - return h->flags & NBD_FLAG_ROTATIONAL;
> + return !!(h->flags & NBD_FLAG_ROTATIONAL);
> }
>
> static int
> @@ -1191,7 +1191,7 @@ nbd_can_trim (void *handle)
> {
> struct handle *h = handle;
>
> - return h->flags & NBD_FLAG_SEND_TRIM;
> + return !!(h->flags & NBD_FLAG_SEND_TRIM);
> }
>
> static int
> @@ -1199,7 +1199,7 @@ nbd_can_zero (void *handle)
> {
> struct handle *h = handle;
>
> - return h->flags & NBD_FLAG_SEND_WRITE_ZEROES;
> + return !!(h->flags & NBD_FLAG_...
2018 Apr 10
4
Re: [Qemu-block] v2v: -o rhv-upload: Long time spent zeroing the disk
...onds to the inverse of
NBD_CMD_FLAG_NO_HOLE which is defined by the NBD spec as:
bit 1, NBD_CMD_FLAG_NO_HOLE; valid during
NBD_CMD_WRITE_ZEROES. SHOULD be set to 1 if the client wants to
ensure that the server does not create a hole. The client MAY send
NBD_CMD_FLAG_NO_HOLE even if NBD_FLAG_SEND_TRIM was not set in the
transmission flags field. The server MUST support the use of this
flag if it advertises NBD_FLAG_SEND_WRITE_ZEROES. *
qemu-img convert uses NBD_CMD_WRITE_ZEROES and does NOT set this flag
(hence in the plugin we see may_trim=1), and I believe that qemu-img
is correct bec...
2019 Mar 29
3
[nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...upported>.
diff --git a/common/protocol/protocol.h b/common/protocol/protocol.h
index a7de2f0..4334be4 100644
--- a/common/protocol/protocol.h
+++ b/common/protocol/protocol.h
@@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int);
#define NBD_FLAG_ROTATIONAL (1 << 4)
#define NBD_FLAG_SEND_TRIM (1 << 5)
#define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
+#define NBD_FLAG_SEND_DF (1 << 7)
#define NBD_FLAG_CAN_MULTI_CONN (1 << 8)
/* NBD options (new style handshake only). */
@@ -217,6 +218,7 @@ extern const char *name_of_nbd_cmd (int);
extern const...
2018 Jan 24
8
[nbdkit PATCH 0/3] Add nozero filter
I still need to add testsuite coverage. Perhaps it might be easier
if I create a new '--filter=log logfile=foo' filter that produces
a log of which commands a client sent, then compare the log using
a known client that uses write_zeroes (qemu-io works well) both
with and without --filter=nozero to prove that the change in
advertisement changes the commands sent over the wire (that would
2018 Apr 10
0
Re: [Qemu-block] v2v: -o rhv-upload: Long time spent zeroing the disk
...D_CMD_FLAG_NO_HOLE which is defined by the NBD spec as:
>
> bit 1, NBD_CMD_FLAG_NO_HOLE; valid during
> NBD_CMD_WRITE_ZEROES. SHOULD be set to 1 if the client wants to
> ensure that the server does not create a hole. The client MAY send
> NBD_CMD_FLAG_NO_HOLE even if NBD_FLAG_SEND_TRIM was not set in the
> transmission flags field. The server MUST support the use of this
> flag if it advertises NBD_FLAG_SEND_WRITE_ZEROES. *
>
> qemu-img convert uses NBD_CMD_WRITE_ZEROES and does NOT set this flag
> (hence in the plugin we see may_trim=1), and I believe tha...
2018 Apr 10
0
Re: [Qemu-block] v2v: -o rhv-upload: Long time spent zeroing the disk
...BD_CMD_FLAG_NO_HOLE which is defined by the NBD spec as:
>
> bit 1, NBD_CMD_FLAG_NO_HOLE; valid during
> NBD_CMD_WRITE_ZEROES. SHOULD be set to 1 if the client wants to
> ensure that the server does not create a hole. The client MAY send
> NBD_CMD_FLAG_NO_HOLE even if NBD_FLAG_SEND_TRIM was not set in the
> transmission flags field. The server MUST support the use of this
> flag if it advertises NBD_FLAG_SEND_WRITE_ZEROES. *
>
> qemu-img convert uses NBD_CMD_WRITE_ZEROES and does NOT set this flag
> (hence in the plugin we see may_trim=1), and I believe that...
2017 Jan 20
7
[nbdkit PATCH 0/5] Add WRITE_ZEROES support
The upstream protocol recently promoted NBD_CMD_WRITE_ZEROES from
experimental to a documented extension. Exposing support for this
allows plugin writers to create sparse files when driven by a
client that knows how to use the extension; meanwhile, even if a
plugin does not support this extension, the server benefits from
less network traffic from the client.
Eric Blake (5):
protocol: Support
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far.
Rich.
2019 Mar 29
0
Re: [nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...mon/protocol/protocol.h b/common/protocol/protocol.h
> index a7de2f0..4334be4 100644
> --- a/common/protocol/protocol.h
> +++ b/common/protocol/protocol.h
> @@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int);
> #define NBD_FLAG_ROTATIONAL (1 << 4)
> #define NBD_FLAG_SEND_TRIM (1 << 5)
> #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
> +#define NBD_FLAG_SEND_DF (1 << 7)
> #define NBD_FLAG_CAN_MULTI_CONN (1 << 8)
>
> /* NBD options (new style handshake only). */
> @@ -217,6 +218,7 @@ extern const char *name_o...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...y) {
- fl = backend_can_zero (backend, conn);
- if (fl == -1)
- return -1;
- if (fl) {
- eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
- conn->can_zero = true;
- }
- fl = backend_can_trim (backend, conn);
- if (fl == -1)
- return -1;
- if (fl) {
- eflags |= NBD_FLAG_SEND_TRIM;
- conn->can_trim = true;
- }
+ /* Check all flags even if they won't be advertised, to prime the
+ * cache and thus simplify later EINVAL handling of a client that
+ * makes a non-compliant request that did not match eflags.
+ */
+ fl = backend_can_zero (backend, conn);
+ i...
2019 Aug 30
3
[nbdkit PATCH v2 0/2] caching .can_write
This is a subset of the last half of the larger 9-patch series. The
uncontroversial first half of that series is pushed, but here, I tried
to reduce the size of the patches by splitting out some of the more
complex changes, so that the rest of the changes remaining in the
series are more mechanical. In turn, it forced me to write timing
tests, which let me spot another spot where we are wasting
2020 Mar 17
9
[nbdkit PATCH 0/4] Fix testsuite hang with nbd-stadalone
Either patch 1 or patch 2 in isolation is sufficient to fix the
problem that Rich forwarded on from an archlinux tester (name so I can
credit them?). But both patches should be applied, as well as
backported to appropriate stable branches, to maximize cross-version
interoperability of nbdkit vs. plugins. Patch 3 will let us detect
future similar bugs much faster. I want patch 4 to ensure that
2019 Apr 01
3
Re: [nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...b/common/protocol/protocol.h
>> index a7de2f0..4334be4 100644
>> --- a/common/protocol/protocol.h
>> +++ b/common/protocol/protocol.h
>> @@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int);
>> #define NBD_FLAG_ROTATIONAL (1 << 4)
>> #define NBD_FLAG_SEND_TRIM (1 << 5)
>> #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
>> +#define NBD_FLAG_SEND_DF (1 << 7)
>> #define NBD_FLAG_CAN_MULTI_CONN (1 << 8)
>>
>> /* NBD options (new style handshake only). */
>> @@ -217,6 +218,7 @@ ex...
2019 Jan 04
0
[PATCH nbdkit 1/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...ount, uint64_t offset, uint32_t flags, int *err);
diff --git a/server/protocol.h b/server/protocol.h
index 6709ddc..003fc45 100644
--- a/server/protocol.h
+++ b/server/protocol.h
@@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int);
#define NBD_FLAG_ROTATIONAL (1 << 4)
#define NBD_FLAG_SEND_TRIM (1 << 5)
#define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
+#define NBD_FLAG_CAN_MULTI_CONN (1 << 8)
/* NBD options (new style handshake only). */
extern const char *name_of_nbd_opt (int);
diff --git a/server/connections.c b/server/connections.c
index 0a89315..51d4912 10...
2019 Mar 22
0
Re: [RFC PATCH] protocol: Add NBD_CMD_FLAG_FAST_ZERO
...> + field. Additionally, a client MUST NOT send the
> + `NBD_CMD_FLAG_FAST_ZERO` flag unless `NBD_FLAG_SEND_FAST_ZERO` was
> + set in the transimssion flags field.
>
> By default, the server MAY use trimming to zero out the area, even
> if it did not advertise `NBD_FLAG_SEND_TRIM`; but it MUST ensure
> @@ -2014,6 +2034,23 @@ The following request types exist:
> same area will not cause fragmentation or cause failure due to
> insufficient space.
>
> + If the server advertised `NBD_FLAG_SEND_FAST_ZERO` but
> + `NBD_CMD_FLAG_FAST_ZERO` is not...
2018 Jan 24
0
[nbdkit PATCH 2/3] filter: Add .can_zero/.can_fua overrides
...+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_SEND_WRITE_ZEROES;
+ conn->can_zero = 1;
+ }
fl = backend->can_trim (backend, conn);
if (fl == -1)
@@ -435,13 +443,21 @@ compute_eflags (struct connection *conn, uint16_t *flags)
eflags |= NBD_FLAG_SEND_TRIM;
conn->can_trim = 1;
}
+
+ fl = backend->can_fua (backend, conn);
+ if (fl == -1)
+ return -1;
+ if (fl) {
+ eflags |= NBD_FLAG_SEND_FUA;
+ conn->can_fua = 1;
+ }
}
fl = backend->can_flush (backend, conn);
if (fl == -1)
return -1;...