Re: [Qemu-block] [PATCH v2 07/17] crypto: implement the LUKS block encryption format

2016-02-05 Thread Eric Blake
for liberating data from old images. > +# @luks: LUKS encryption format. Recommended for new images > # > # Since: 2.6 > ## > { 'enum': 'QCryptoBlockFormat', > # 'prefix': 'QCRYPTO_BLOCK_FORMAT', > - 'data': [&#

Re: [Qemu-block] [PATCH v2 08/17] block: add flag to indicate that no I/O will be performed

2016-02-05 Thread Eric Blake
ead > the qcow2 header, for example. s/todo/to do/2 > > Signed-off-by: Daniel P. Berrange > --- > block.c | 5 +++-- > block/io.c| 2 ++ > include/block/block.h | 1 + > qemu-img.c| 33 + > 4 files changed,

Re: [Qemu-block] [PATCH v2 06/17] crypto: add block encryption framework

2016-02-05 Thread Eric Blake
On 02/05/2016 05:43 AM, Daniel P. Berrange wrote: > On Thu, Feb 04, 2016 at 05:23:32PM -0700, Eric Blake wrote: >> On 01/20/2016 10:38 AM, Daniel P. Berrange wrote: >>> Add a generic framework for support different block encryption >>> formats. Upon instantiating a Q

Re: [Qemu-block] [PATCH v2 09/17] qemu-img/qemu-io: don't prompt for passwords if not required

2016-02-05 Thread Eric Blake
qemu-io.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH v2] qemu-img: initialize MapEntry object

2016-02-05 Thread Eric Blake
nd Clang -fsanitize=undefined. > > Zero the stack object at allocation AND make sure the utility to > populate the fields properly marks has_filename as false if applicable. > > Signed-off-by: John Snow > --- > v2: Initialize with a compound literal as a future-proof

Re: [Qemu-block] [PATCH v2 10/17] block: add generic full disk encryption driver

2016-02-05 Thread Eric Blake
f you fix qcrypto_block_get_payload_offset to be in bytes. > +++ b/qapi/block-core.json > @@ -1546,7 +1546,7 @@ > { 'enum': 'BlockdevDriver', >'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop&#

Re: [Qemu-block] [PATCH v2 11/17] qcow2: make qcow2_encrypt_sectors encrypt in place

2016-02-05 Thread Eric Blake
> > Signed-off-by: Daniel P. Berrange > --- > block/qcow2-cluster.c | 17 + > block/qcow2.c | 5 ++--- > block/qcow2.h | 3 +-- > 3 files changed, 8 insertions(+), 17 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redh

Re: [Qemu-block] [PATCH v2 12/17] qcow2: convert QCow2 to use QCryptoBlock for encryption

2016-02-08 Thread Eric Blake
f refcount_bits=16 key-secret=sec0 So now that we support LUKS encryption by default, we no longer need the deprecation warning. Do we still forbid the creation of new images with non-LUKS encryption? That is, even though the new code will let us read old images, I want to make sure we te

Re: [Qemu-block] [PATCH v2 10/17] block: add generic full disk encryption driver

2016-02-08 Thread Eric Blake
ill check > interoperability between qemu + cryptsetup. Slight complication is > that those io tests all expect to run unprivileged. So it'll need > a manual step run privileged to create the cryptsetup disk images > for testing with. We've checked in compressed binary

Re: [Qemu-block] [PATCH v2 13/17] qcow: make encrypt_sectors encrypt in place

2016-02-08 Thread Eric Blake
f, > +if (encrypt_sectors(s, sector_num, buf, > n, true, &err) < 0) { > error_free(err); > ret = -EIO; > break; > } > -src_buf = cluster_data; cluster_data is

Re: [Qemu-block] [PATCH v2 14/17] qcow: convert QCow to use QCryptoBlock for encryption

2016-02-08 Thread Eric Blake
et: #optional ID of the "secret" object providing the > +#AES decryption key. Maybe worth a mention that this is supported for decrypting old images, but not for use in creating new images (but then again, who creates new qcow images these days). With the commit typo

Re: [Qemu-block] [PATCH v2 16/17] block: remove all encryption handling APIs

2016-02-08 Thread Eric Blake
/* if true, the device is a /dev/sg* */ > int copy_on_read; /* if true, copy read backing sectors into image > note this is a reference count */ Hmm - several variables that are only 'true' or 'false' and should be typed '

Re: [Qemu-block] [PATCH v2 17/17] block: remove support for legecy AES qcow/qcow2 encryption

2016-02-08 Thread Eric Blake
;& > +s->crypt_method_header == QCOW_CRYPT_AES) { > +error_setg(errp, > + "Use of AES-CBC encrypted qcow2 images is no longer " > + "supported. Please use the qcow2 LUKS format > instead."); Ditto -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH] fdc: always compile-check debug prints

2016-02-08 Thread Eric Blake
esn't hurt, either, if you want to mention it in the commit as intentional. Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [PATCH v5 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-06-23 Thread Eric Blake
lock-io.h | 15 +++++------ > 2 files changed, 9 insertions(+), 47 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH v3] spec: Clarify BLOCK_STATUS reply details

2022-06-24 Thread Eric Blake
On Mon, Apr 04, 2022 at 11:48:46AM +0100, Richard W.M. Jones wrote: Whoops, looks like I let this one sit for a while. > On Fri, Apr 01, 2022 at 04:08:07PM -0500, Eric Blake wrote: > > Our docs were inconsistent on whether a NBD_REPLY_TYPE_BLOCK_STATUS > > reply chunk can exce

Re: [RFC v5 05/11] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2022-08-01 Thread Eric Blake
27;ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } > +'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', > +{ 'name': 'zoned_host_device', 'if': 'CONFIG_BLKZONED' } ] } Missing a documentation line of '# @zoned_host_deivce: Since 7.2'. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH v9 1/7] include: add zoned device structs

2022-09-15 Thread Eric Blake
is necessary? > + */ > +typedef struct BlockZoneDescriptor { > +uint64_t start; > +uint64_t length; > +uint64_t cap; > +uint64_t wp; > +BlockZoneType type; > +BlockZoneCondition cond; > +} BlockZoneDescriptor; > + > typedef struct BlockDriverInfo { >

Re: [PATCH] spec: Add NBD_OPT_EXTENDED_HEADERS

2022-10-04 Thread Eric Blake
On Fri, Dec 03, 2021 at 05:14:34PM -0600, Eric Blake wrote: > Add a new negotiation feature where the client and server agree to use > larger packet headers on every packet sent during transmission phase. > This has two purposes: first, it makes it possible to perform > operations like

[PATCH] nbd/server: Use smarter assert

2022-10-17 Thread Eric Blake
hat we are aware that no wraparound is possible. Fixes: 93676c88 ("nbd: Don't send oversize strings", v4.2.0) Reported-by: Dr. David Alan Gilbert Signed-off-by: Eric Blake --- nbd/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd/client.c b/nbd/c

Re: [PATCH] nbd/server: Use smarter assert

2022-10-17 Thread Eric Blake
Given the file touched by this patch[1], The subject should use 'nbd/client:' On Mon, Oct 17, 2022 at 12:37:27PM -0500, Eric Blake wrote: > Assigning strlen() to a uint32_t and then asserting that it isn't too > large doesn't catch the case of an input string 4G in

[PATCH v2] nbd/client: Use smarter assert

2022-10-17 Thread Eric Blake
t;, v4.2.0) Reported-by: Dr. David Alan Gilbert Signed-off-by: Eric Blake --- v2: update subject line and commit message to reflect file being touched; adjust a second nearby assertion with the same issue nbd/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd/c

Re: [PATCH v2] nbd/client: Use smarter assert

2022-10-31 Thread Eric Blake
On Mon, Oct 24, 2022 at 02:59:48PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 10/17/22 22:12, Eric Blake wrote: > > Assigning strlen() to a uint32_t and then asserting that it isn't too > > large doesn't catch the case of an input string 4G in length. > > Thank

Re: [PATCH v3 08/30] blockdev: Clean up abuse of DriveBackup member format

2022-11-04 Thread Eric Blake
t; blockdev.c | 17 +---- > 1 file changed, 9 insertions(+), 8 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org

Re: [PATCH v3 09/30] nbd/server: Clean up abuse of BlockExportOptionsNbd member @arg

2022-11-04 Thread Eric Blake
n when arg is finally freed. > > Exactly. However, the copy in nbd_export_create() remained dirty. > > Clean it up. Since the value stored in member @name is not actually > used outside this function, use a local variable instead of modifying > the QAPI object. > > Signe

[PATCH v2 07/15] nbd/server: Initial support for extended headers

2022-11-14 Thread Eric Blake
rt of implementing NBD_REPLY_TYPE_BLOCK_STATUS_EXT to a separate patch. Signed-off-by: Eric Blake --- nbd/nbd-internal.h | 7 ++- nbd/server.c | 132 +++-- 2 files changed, 108 insertions(+), 31 deletions(-) diff --git a/nbd/nbd-internal.h b/nb

[libnbd PATCH v2 10/23] api: Add [aio_]nbd_block_status_64

2022-11-14 Thread Eric Blake
Overcome the inherent 32-bit limitation of our existing nbd_block_status command by adding a 64-bit variant. The command sent to the server does not change, but the user's callback is now handed 64-bit information regardless of whether the server replies with 32- or 64-bit extents. Unit tests pro

[PATCH v2 03/15] nbd: Prepare for 64-bit request effect lengths

2022-11-14 Thread Eric Blake
extended headers with the server, allowing the nbd driver to pass larger requests along where possible; although in this patch they always remain false for no semantic change yet. Signed-off-by: Eric Blake --- include/block/nbd.h | 21 - nbd/nbd-internal.h | 3 +-- block

[PATCH v2 11/15] nbd/client: Request extended headers during negotiation

2022-11-14 Thread Eric Blake
essential to the information collected during 'qemu-nbd --list', but probing for it gives us one more piece of information in that output. Update the iotests affected by the new line of output. Signed-off-by: Eric Blake --- nbd/client-connection.c | 1 + nb

[PATCH v2 4/6] spec: Allow 64-bit block status results

2022-11-14 Thread Eric Blake
There are some potential extension metadata contexts that would benefit from a 64-bit status value. For example, Zoned Block Devices (see https://zonedstorage.io/docs/linux/zbd-api) may want to return the relative offset of where the next write will occur within the zone, where a zone may be large

[libnbd PATCH v2 11/23] api: Add several functions for controlling extended headers

2022-11-14 Thread Eric Blake
The new NBD_OPT_EXTENDED_HEADERS feature is worth using by default, but there may be cases where the user explicitly wants to stick with the older 32-bit headers. nbd_set_request_extended_headers() will let the client override the default, nbd_get_request_extended_headers() determines the current

[PATCH v2 04/15] nbd: Add types for extended headers

2022-11-14 Thread Eric Blake
does not change the status quo that neither the client nor server use a packed-struct representation for the request header. Signed-off-by: Eric Blake --- [*]tweak commit message once nbd commit id available --- docs/interop/nbd.txt | 1 + include/block/nbd.h | 74

[libnbd PATCH v2 18/23] generator: Actually request extended headers

2022-11-14 Thread Eric Blake
This is the culmination of the previous patches' preparation work for using extended headers when possible. The new states in the state machine are copied extensively from our handling of OPT_STRUCTURED_REPLY. The next patch will then expose a new API nbd_opt_extended_headers() for manual control

[PATCH v2 01/15] nbd/client: Add safety check on chunk payload length

2022-11-14 Thread Eric Blake
length, we should drop the connection right then rather than assuming the layer on top will be careful. This becomes more important when we permit 64-bit lengths which are even more likely to have the potential for attempted denial of service abuse. Signed-off-by: Eric Blake --- nbd/client.c

[libnbd PATCH v2 21/23] api: Add nbd_can_block_status_payload()

2022-11-14 Thread Eric Blake
In the recent NBD protocol extensions to add 64-bit commands, an additional option was added to allow NBD_CMD_BLOCK_STATUS pass a client payload instructing the server to filter its answers (mainly useful when the client requests more than one meta context with NBD_OPT_SET_META_CONTEXT). This patc

[libnbd PATCH v2 13/23] dump: Update nbddump to use 64-bit block status

2022-11-14 Thread Eric Blake
Although our use of "base:allocation" doesn't require the use of the 64-bit API for flags, we might perform slightly faster for a server that does give us 64-bit extent lengths. --- dump/dump.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dump/d

[libnbd PATCH v2 14/23] info: Expose extended-headers support through nbdinfo

2022-11-14 Thread Eric Blake
Add another bit of overall server information, as well as a '--can extended-headers' silent query. For now, the testsuite is written assuming that when nbdkit finally adds extended headers support, it will also add a --no-eh kill switch comparable to its existing --no-sr switch. --- info/nbdinfo.

[libnbd PATCH v2 19/23] api: Add nbd_[aio_]opt_extended_headers()

2022-11-14 Thread Eric Blake
Very similar to the recent addition of nbd_opt_structured_reply, giving us fine-grained control over an extended headers request. Because nbdkit does not yet support extended headers, testsuite coverage is limited to interop testing with qemu-nbd. It shows that extended headers imply structured r

[libnbd PATCH v2 23/23] RFC: pread: Accept 64-bit holes

2022-11-14 Thread Eric Blake
Even though we don't currently allow the user to request NBD_CMD_READ with more than 64M (and even if we did, our API signature caps us at SIZE_MAX, which is 32 bits on a 32-bit machine), upstream NBD commit XXX[*] states that for symmetry with 64-bit requests, extended header clients must be prepa

[PATCH v2 12/15] nbd/server: Prepare for per-request filtering of BLOCK_STATUS

2022-11-14 Thread Eric Blake
return on a per-command basis (for now, identical to the full set of negotiated contexts). Signed-off-by: Eric Blake --- include/block/nbd.h | 20 +++- nbd/server.c| 108 +++- 2 files changed, 75 insertions(+), 53 deletions(-) diff --git a

[libnbd PATCH v2 20/23] interop: Add test of 64-bit block status

2022-11-14 Thread Eric Blake
Prove that we can round-trip a block status request larger than 4G through a new-enough qemu-nbd. Also serves as a unit test of our shim for converting internal 64-bit representation back to the older 32-bit nbd_block_status callback interface. --- interop/Makefile.am | 6 ++ interop/large-

[libnbd PATCH v2 07/23] generator: Add struct nbd_extent in prep for 64-bit extents

2022-11-14 Thread Eric Blake
The existing nbd_block_status() callback is permanently stuck with an array of uint32_t pairs (len/2 extents), which is both constrained on maximum extent size (no larger than 4G) and on the status flags (must fit in 32 bits). While the "base:allocation" metacontext will never exceed 32 bits, it i

[PATCH v2 15/15] RFC: nbd/server: Send 64-bit hole chunk

2022-11-14 Thread Eric Blake
Since we cap NBD_CMD_READ requests to 32M, we never have a reason to send a 64-bit chunk type for a hole; but it is worth producing these for interoperability testing of clients that want extended headers. --- nbd/server.c | 20 1 file changed, 16 insertions(+), 4 deletions(-)

[PATCH v2 00/15] qemu patches for 64-bit NBD extensions

2022-11-14 Thread Eric Blake
if we are happy with the direction the spec is headed in. Eric Blake (15): nbd/client: Add safety check on chunk payload length nbd/server: Prepare for alternate-size headers nbd: Prepare for 64-bit request effect lengths nbd: Add types for extended headers nbd/server: Refactor handli

[PATCH v2 1/6] spec: Recommend cap on NBD_REPLY_TYPE_BLOCK_STATUS length

2022-11-14 Thread Eric Blake
The spec was silent on how many extents a server could reply with. However, both qemu and nbdkit (the two server implementations known to have implemented the NBD_CMD_BLOCK_STATUS extension) implement a hard cap, and will truncate the amount of extents in a reply to avoid sending a client a reply s

[PATCH v2 10/15] nbd/client: Accept 64-bit block status chunks

2022-11-14 Thread Eric Blake
checking whether more than the two least-significant bits are set. Signed-off-by: Eric Blake --- block/nbd.c| 38 +++--- block/trace-events | 1 + 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index a8b1bc1054.

[PATCH v2 5/6] spec: Introduce NBD_FLAG_BLOCK_STATUS_PAYLOAD

2022-11-14 Thread Eric Blake
express dynamic interest in varying subsets of those contexts over the life of the connection, for less wasted effort in responding to NBD_CMD_BLOCK_STATUS. This works by having the command payload supply an effect length and a list of ids the client is currently interested in. Signed-off-by: Eric

[PATCH v2 2/6] spec: Tweak description of maximum block size

2022-11-14 Thread Eric Blake
Commit 9f30fedb improved the spec to allow non-payload requests that exceed any advertised maximum block size. Take this one step further by permitting the server to use NBD_EOVERFLOW as a hint to the client when a request is oversize (while permitting NBD_EINVAL for back-compat), and by rewording

[libnbd PATCH v2 17/23] ocaml: Add example for 64-bit extents

2022-11-14 Thread Eric Blake
Since our example program for 32-bit extents is inherently limited to 32-bit lengths, it is also worth demonstrating the 64-bit extent API, including the difference in the array indexing being saner. --- ocaml/examples/Makefile.am | 3 ++- ocaml/examples/extents64.ml | 42 +++

[libnbd PATCH v2 09/23] block_status: Accept 64-bit extents during block status

2022-11-14 Thread Eric Blake
Support a server giving us a 64-bit extent. Note that the protocol says a server should not give a 64-bit answer when extended headers are not negotiated; we can handle that by reporting EPROTO but otherwise accepting the information. Meanwhile, when extended headers are in effect, even a 32-bit

[libnbd PATCH v2 05/23] states: Prepare to receive 64-bit replies

2022-11-14 Thread Eric Blake
Support receiving headers for 64-bit replies if extended headers were negotiated. We already insist that the server not send us too much payload in one reply, so we can exploit that and merge the 64-bit length back into a normalized 32-bit field for the rest of the payload length calculations. Th

[libnbd PATCH v2 02/23] internal: Refactor layout of replies in sbuf

2022-11-14 Thread Eric Blake
In order to more easily add a third reply type with an even larger header, but where the payload will look the same for both structured and extended replies, it is nicer if simple and structured replies are nested inside the same layer of sbuf.reply.hdr. While at it, note that while .or and .sr ar

[libnbd PATCH v2 03/23] protocol: Add definitions for extended headers

2022-11-14 Thread Eric Blake
Add the magic numbers and new structs necessary to implement the NBD protocol extension of extended headers providing 64-bit lengths. This corresponds to upstream nbd commits XXX-XXX[*]. --- [*] FIXME update commit ids before pushing --- lib/nbd-protocol.h | 66 ++

[libnbd PATCH v2 08/23] block_status: Track 64-bit extents internally

2022-11-14 Thread Eric Blake
When extended headers are in use, the server can send us 64-bit extents, even for a 32-bit query (if the server knows the entire image is data, for example, or if the metacontext has a status definition that uses more than 32 bits). Also, while most contexts only have 32-bit flags, a server is all

[libnbd PATCH v2 00/23] libnbd 64-bit NBD extensions

2022-11-14 Thread Eric Blake
two RFC projects include it, the protocol is incompatible between the two, but at least client and server gracefully detect the bug rather than SEGV'ing). Eric Blake (23): block_status: Refactor array storage internal: Refactor layout of replies in sbuf protocol: Add definitions for ext

[cross-project PATCH v2] NBD 64-bit extensions

2022-11-14 Thread Eric Blake
nit tests added in qemu and libnbd - the series end with RFC patches on whether to support 64-bit hole responses to NBD_CMD_READ, even though our current limitations say servers don't have to accept more than a 32M read request and therefore will never have that big of a hole to r

[libnbd PATCH v2 04/23] states: Prepare to send 64-bit requests

2022-11-14 Thread Eric Blake
Support sending 64-bit requests if extended headers were negotiated. This includes setting NBD_CMD_FLAG_PAYLOAD_LEN any time we send an extended NBD_CMD_WRITE; this is such a fundamental part of the protocol that for now it is easier to silently ignore whatever value the user passes in for that bit

[PATCH v2 3/6] spec: Add NBD_OPT_EXTENDED_HEADERS

2022-11-14 Thread Eric Blake
BD transmission packets started on an 8-byte boundary after option haggling has completed. This spec addition was done in parallel with proof of concept implementations in qemu (server and client), libnbd (client), and nbdkit (server). Signed-off-by: Eric Blake --- doc

[PATCH v2 13/15] nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS

2022-11-14 Thread Eric Blake
server is advertising the capability, and to the testsuite to reflect the addition to that output. Signed-off-by: Eric Blake --- docs/interop/nbd.txt | 2 +- include/block/nbd.h | 32 -- nbd/server.c

[PATCH v2 06/15] nbd/server: Refactor to pass full request around

2022-11-14 Thread Eric Blake
the buffer is also available). This is a refactoring patch to pass the full request around the reply stack, rather than just the handle, so that later patches can then access request->from when extended headers are active. But for this patch, there are no semantic changes. Signed-off-b

Re: [Qemu-block] [Qemu-devel] [PATCH 1/3] block: Fix bdrv_iterate_format() sorting

2016-10-12 Thread Eric Blake
qsort()'s manual page). > > Signed-off-by: Max Reitz > --- > block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) I'm a bit surprised that code sanitizers like Coverity or ASAN aren't (yet?) able to flag this. Reviewed-by: Eric Blake > > diff --git a

Re: [Qemu-block] [Qemu-devel] [PATCH 2/3] block: Emit modules in bdrv_iterate_format()

2016-10-12 Thread Eric Blake
ns(+) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH 3/3] iotests: Skip test 162 if there is no SSH support

2016-10-12 Thread Eric Blake
s/162 > +++ b/tests/qemu-iotests/162 > @@ -35,6 +35,9 @@ status=1# failure is the default! > _supported_fmt generic > _supported_os Linux > > +test_ssh=$($QEMU_IMG --help | grep '^Supported formats:.* ssh\( \|$\)') > +[ "$test_ssh" = "" ] &

[Qemu-block] [PATCH v6 03/15] nbd: Rename NBDRequest to NBDRequestData

2016-10-13 Thread Eric Blake
ng request callbacks, while leaving the shorter name for the description of the request sent over the wire in the NBD protocol. Signed-off-by: Eric Blake --- v6: new patch --- nbd/server.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nbd/server.c

[Qemu-block] [PATCH v6 01/15] nbd: Add qemu-nbd -D for human-readable description

2016-10-13 Thread Eric Blake
g the description. Signed-off-by: Eric Blake --- v6: rebase to latest v5: rebase to latest v4: rebase to latest --- include/block/nbd.h | 1 + nbd/nbd-internal.h | 5 +++-- nbd/server.c| 34 ++ qemu-nbd.c | 12 +++- qemu-nbd.texi

[Qemu-block] [PATCH v6 07/15] nbd: Send message along with server NBD_REP_ERR errors

2016-10-13 Thread Eric Blake
The NBD Protocol allows us to send human-readable messages along with any NBD_REP_ERR error during option negotiation; make use of this fact for clients that know what to do with our message. Signed-off-by: Eric Blake --- v6: tweak comments, fix indentation v5: don't leak 'msg'

[Qemu-block] [PATCH v6 02/15] nbd: Treat flags vs. command type as separate fields

2016-10-13 Thread Eric Blake
some nearby code to keep checkpatch.pl happy. Signed-off-by: Eric Blake --- v6: no change v5: no change v4: rebase to earlier changes v3: rebase to other changes earlier in series --- include/block/nbd.h | 18 -- nbd/nbd-internal.h | 4 ++-- block/nbd-client.c | 9

[Qemu-block] [PATCH v6 04/15] nbd: Rename NbdClientSession to NBDClientSession

2016-10-13 Thread Eric Blake
It's better to use consistent capitalization of the namespace used for NBD functions; we have more instances of NBD* than Nbd*. Signed-off-by: Eric Blake --- v6: new patch --- block/nbd-client.h | 6 +++--- block/nbd-client.c | 26 +- block/nbd.c| 4 ++

[Qemu-block] [PATCH v6 05/15] nbd: Rename struct nbd_request and nbd_reply

2016-10-13 Thread Eric Blake
Our coding convention prefers CamelCase names, and we already have other existing structs with NBDFoo naming. Let's be consistent, before later patches add even more structs. Signed-off-by: Eric Blake --- v6: new patch --- block/nbd-client.h | 2 +- include/block/nbd.h | 10 ++

[Qemu-block] [PATCH v6 08/15] nbd: Share common option-sending code in client

2016-10-13 Thread Eric Blake
Rather than open-coding each option request, it's easier to have common helper functions do the work. That in turn requires having convenient packed types for handling option requests and replies. Signed-off-by: Eric Blake --- v6: comment and formatting tweaks v5: no change v4: reba

[Qemu-block] [PATCH v6 09/15] nbd: Let server know when client gives up negotiation

2016-10-13 Thread Eric Blake
with what we've sent, whether or not we've read everything the server has sent. Technically, the server then has to reply with NBD_REP_ACK, but it's not worth complicating the client to wait around for that reply. Signed-off-by: Eric Blake --- v6: rebase v5: no change v4: new patch --

[Qemu-block] [PATCH v6 00/15] nbd: efficient write zeroes

2016-10-13 Thread Eric Blake
ss allocation during NBD_OPT_LIST' 012/15:[] [-C] 'nbd: Support shorter handshake' 013/15:[] [-C] 'nbd: Improve server handling of shutdown requests' 014/15:[----] [-C] 'nbd: Implement NBD_CMD_WRITE_ZEROES on server' 015/15:[0006] [FC] 'nbd: Implement N

[Qemu-block] [PATCH v6 06/15] nbd: Share common reply-sending code in server

2016-10-13 Thread Eric Blake
Rather than open-coding NBD_REP_SERVER, reuse the code we already have by adding a length parameter. Additionally, the refactoring will make adding NBD_OPT_GO in a later patch easier. Signed-off-by: Eric Blake --- v6: improve (and add) function comments v5: no change v4: no change v3: rebase

[Qemu-block] [PATCH v6 14/15] nbd: Implement NBD_CMD_WRITE_ZEROES on server

2016-10-13 Thread Eric Blake
, the 'may use holes' scenario is optional (the server need not use a hole, and must not use a hole if subsequent reads would not see zeroes). Signed-off-by: Eric Blake --- v6: rebase, improve commit message v5: no change v4: rebase, fix value for constant v3: abandon NBD_CMD_CLOSE

[Qemu-block] [PATCH v6 10/15] nbd: Let client skip portions of server reply

2016-10-13 Thread Eric Blake
idea into the client where we have places where we want to ignore data (such as the description tacked on the end of NBD_REP_SERVER). Signed-off-by: Eric Blake --- v6: rebase v5: no change v4: rebase v3: rebase --- nbd/client.c | 47 +-- 1 file change

[Qemu-block] [PATCH v6 15/15] nbd: Implement NBD_CMD_WRITE_ZEROES on client

2016-10-13 Thread Eric Blake
-off-by: Eric Blake --- v6: rebase v5: enhance commit message v4: rebase to byte-based limits v3: rebase, tell block layer about our support --- block/nbd-client.h | 2 ++ block/nbd-client.c | 35 +++ block/nbd.c| 4 3 files changed, 41 insertions

[Qemu-block] [PATCH v6 13/15] nbd: Improve server handling of shutdown requests

2016-10-13 Thread Eric Blake
waits for the client to react, rather than just out-right quitting - but that's a bigger task for another day). Signed-off-by: Eric Blake --- v6: rebase v5: no change v4: new patch --- include/block/nbd.h | 13 + nbd/nbd-internal.h | 1 + nbd/client.c| 16

[Qemu-block] [PATCH v6 11/15] nbd: Less allocation during NBD_OPT_LIST

2016-10-13 Thread Eric Blake
27;t match what we are searching for. Signed-off-by: Eric Blake --- v6: rebase v5: alter signature of nbd_receive_list for simpler logic v4: rebase v3: tweak commit message --- nbd/client.c | 145 +-- 1 file changed, 70 insertions(+

[Qemu-block] [PATCH v6 12/15] nbd: Support shorter handshake

2016-10-13 Thread Eric Blake
doesn't shave much off the wire, but we might as well implement it. Signed-off-by: Eric Blake Reviewed-by: Alex Bligh --- v6: rebase v5: no change v4: rebase v3: rebase --- include/block/nbd.h | 6 -- nbd/client.c| 8 +++- nbd/server.c| 15 +++ 3 files ch

Re: [Qemu-block] [Qemu-devel] [PATCH v6 00/15] nbd: efficient write zeroes

2016-10-13 Thread Eric Blake
ssing errno value on mingw. I'll come up with something to squash in to 13/15. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH v6 00/15] nbd: efficient write zeroes

2016-10-14 Thread Eric Blake
: ret = ESHUTDOWN; return ret; (and so on for all the cases in the switch), to hide the fact that we intentionally want to return a positive errno value, if it bothers anyone enough to ask me to do so. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http:

[Qemu-block] [PATCH v7 04/16] nbd: Rename NbdClientSession to NBDClientSession

2016-10-14 Thread Eric Blake
It's better to use consistent capitalization of the namespace used for NBD functions; we have more instances of NBD* than Nbd*. Signed-off-by: Eric Blake --- v6: new patch --- block/nbd-client.h | 6 +++--- block/nbd-client.c | 26 +- block/nbd.c| 4 ++

[Qemu-block] [PATCH v7 00/16] nbd: efficient write zeroes

2016-10-14 Thread Eric Blake
Refactor conversion to errno to silence checkpatch' 014/16:[0012] [FC] 'nbd: Improve server handling of shutdown requests' 015/16:[] [--] 'nbd: Implement NBD_CMD_WRITE_ZEROES on server' 016/16:[] [--] 'nbd: Implement NBD_CMD_WRITE_ZEROES on client' Eric Blak

[Qemu-block] [PATCH v7 02/16] nbd: Treat flags vs. command type as separate fields

2016-10-14 Thread Eric Blake
some nearby code to keep checkpatch.pl happy. Signed-off-by: Eric Blake --- v6: no change v5: no change v4: rebase to earlier changes v3: rebase to other changes earlier in series --- include/block/nbd.h | 18 -- nbd/nbd-internal.h | 4 ++-- block/nbd-client.c | 9

[Qemu-block] [PATCH v7 03/16] nbd: Rename NBDRequest to NBDRequestData

2016-10-14 Thread Eric Blake
ng request callbacks, while leaving the shorter name for the description of the request sent over the wire in the NBD protocol. Signed-off-by: Eric Blake --- v6: new patch --- nbd/server.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/nbd/server.c

[Qemu-block] [PATCH v7 01/16] nbd: Add qemu-nbd -D for human-readable description

2016-10-14 Thread Eric Blake
g the description. Signed-off-by: Eric Blake --- v6: rebase to latest v5: rebase to latest v4: rebase to latest --- include/block/nbd.h | 1 + nbd/nbd-internal.h | 5 +++-- nbd/server.c| 34 ++ qemu-nbd.c | 12 +++- qemu-nbd.texi

[Qemu-block] [PATCH v7 08/16] nbd: Share common option-sending code in client

2016-10-14 Thread Eric Blake
Rather than open-coding each option request, it's easier to have common helper functions do the work. That in turn requires having convenient packed types for handling option requests and replies. Signed-off-by: Eric Blake --- v6: comment and formatting tweaks v5: no change v4: reba

[Qemu-block] [PATCH v7 06/16] nbd: Share common reply-sending code in server

2016-10-14 Thread Eric Blake
Rather than open-coding NBD_REP_SERVER, reuse the code we already have by adding a length parameter. Additionally, the refactoring will make adding NBD_OPT_GO in a later patch easier. Signed-off-by: Eric Blake --- v6: improve (and add) function comments v5: no change v4: no change v3: rebase

[Qemu-block] [PATCH v7 05/16] nbd: Rename struct nbd_request and nbd_reply

2016-10-14 Thread Eric Blake
Our coding convention prefers CamelCase names, and we already have other existing structs with NBDFoo naming. Let's be consistent, before later patches add even more structs. Signed-off-by: Eric Blake --- v6: new patch --- block/nbd-client.h | 2 +- include/block/nbd.h | 10 ++

[Qemu-block] [PATCH v7 09/16] nbd: Let server know when client gives up negotiation

2016-10-14 Thread Eric Blake
with what we've sent, whether or not we've read everything the server has sent. Technically, the server then has to reply with NBD_REP_ACK, but it's not worth complicating the client to wait around for that reply. Signed-off-by: Eric Blake --- v6: rebase v5: no change v4: new patch --

[Qemu-block] [PATCH v7 10/16] nbd: Let client skip portions of server reply

2016-10-14 Thread Eric Blake
idea into the client where we have places where we want to ignore data (such as the description tacked on the end of NBD_REP_SERVER). Signed-off-by: Eric Blake --- v6: rebase v5: no change v4: rebase v3: rebase --- nbd/client.c | 47 +-- 1 file change

[Qemu-block] [PATCH v7 07/16] nbd: Send message along with server NBD_REP_ERR errors

2016-10-14 Thread Eric Blake
The NBD Protocol allows us to send human-readable messages along with any NBD_REP_ERR error during option negotiation; make use of this fact for clients that know what to do with our message. Signed-off-by: Eric Blake --- v6: tweak comments, fix indentation v5: don't leak 'msg'

[Qemu-block] [PATCH v7 16/16] nbd: Implement NBD_CMD_WRITE_ZEROES on client

2016-10-14 Thread Eric Blake
-off-by: Eric Blake --- v6: rebase v5: enhance commit message v4: rebase to byte-based limits v3: rebase, tell block layer about our support --- block/nbd-client.h | 2 ++ block/nbd-client.c | 35 +++ block/nbd.c| 4 3 files changed, 41 insertions

[Qemu-block] [PATCH v7 14/16] nbd: Improve server handling of shutdown requests

2016-10-14 Thread Eric Blake
waits for the client to react, rather than just out-right quitting - but that's a bigger task for another day). Signed-off-by: Eric Blake --- v7: conditionalize ESHUTDOWN for mingw v6: rebase v5: no change v4: new patch --- include/block/nbd.h | 13 + nbd/nbd-internal.h | 1 +

[Qemu-block] [PATCH v7 13/16] nbd: Refactor conversion to errno to silence checkpatch

2016-10-14 Thread Eric Blake
Checkpatch complains that 'return EINVAL' is usually wrong (since we tend to favor 'return -EINVAL'). But it is a false positive for nbd_errno_to_system_errno(). Since NBD may add future defined wire values, refactor the code to keep checkpatch happy. Signed-off-by: Eri

[Qemu-block] [PATCH v7 12/16] nbd: Support shorter handshake

2016-10-14 Thread Eric Blake
doesn't shave much off the wire, but we might as well implement it. Signed-off-by: Eric Blake Reviewed-by: Alex Bligh --- v6: rebase v5: no change v4: rebase v3: rebase --- include/block/nbd.h | 6 -- nbd/client.c| 8 +++- nbd/server.c| 15 +++ 3 files ch

[Qemu-block] [PATCH v7 11/16] nbd: Less allocation during NBD_OPT_LIST

2016-10-14 Thread Eric Blake
27;t match what we are searching for. Signed-off-by: Eric Blake --- v6: rebase v5: alter signature of nbd_receive_list for simpler logic v4: rebase v3: tweak commit message --- nbd/client.c | 145 +-- 1 file changed, 70 insertions(+

[Qemu-block] [PATCH v7 15/16] nbd: Implement NBD_CMD_WRITE_ZEROES on server

2016-10-14 Thread Eric Blake
, the 'may use holes' scenario is optional (the server need not use a hole, and must not use a hole if subsequent reads would not see zeroes). Signed-off-by: Eric Blake --- v6: rebase, improve commit message v5: no change v4: rebase, fix value for constant v3: abandon NBD_CMD_CLOSE

Re: [Qemu-block] [v2 2/5] block/ssh: Add InetSocketAddress and accept it

2016-10-17 Thread Eric Blake
u want to treat both '0' and 'name' as an error, but that is not the only error you want to flag, thus atoi() is insufficient to flag all the errors you want. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [Qemu-devel] [PATCH v14 13/21] qdict: allow qdict_crumple to accept compound types as values

2016-10-17 Thread Eric Blake
P, where we no longer have to escape commas (even nicer than the drive hack where we support filename=json:{...} but have to double up all commas to make it through the QemuOpts layer). Encountering json= as anything other than the first option would be an error, and you would be unable to combine a json= option with any other old-style option. In other words, the use of leading json= would be the switch for whether to do old-style parsing or to use a saner syntax for everything else that needs structure, on a per-argument basis. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

<    1   2   3   4   5   6   7   8   9   10   >