Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: fd8d372dd36e839568a718684914d9960d8b1ebd
      
https://github.com/qemu/qemu/commit/fd8d372dd36e839568a718684914d9960d8b1ebd
  Author: Eric Blake <ebl...@redhat.com>
  Date:   2018-03-01 (Thu, 01 Mar 2018)

  Changed paths:
    M block/nbd-client.c
    M block/nbd.c

  Log Message:
  -----------
  nbd: Honor server's advertised minimum block size

Commit 79ba8c98 (v2.7) changed the setting of request_alignment
to occur only during bdrv_refresh_limits(), rather than at at
bdrv_open() time; but at the time, NBD was unaffected, because
it still used sector-based callbacks, so the block layer
defaulted NBD to use 512 request_alignment.

Later, commit 70c4fb26 (also v2.7) changed NBD to use byte-based
callbacks, without setting request_alignment.  This resulted in
NBD using request_alignment of 1, which works great when the
server supports it (as is the case for qemu-nbd), but falls apart
miserably if the server requires alignment (but only if qemu
actually sends a sub-sector request; qemu-io can do it, but
most qemu operations still perform on sectors or larger).

Even later, the NBD protocol was updated to document that clients
should learn the server's minimum alignment during NBD_OPT_GO;
and recommended that clients should assume a minimum size of 512
unless the server understands NBD_OPT_GO and replied with a smaller
size.  Commit 081dd1fe (v2.10) attempted to do that, by assigning
request_alignment to whatever was learned from the server; but
it has two flaws: the assignment is done during bdrv_open() so
it gets unconditionally wiped out back to 1 during any later
bdrv_refresh_limits(); and the code is not using a default of 512
when the server did not report a minimum size.

Fix these issues by moving the assignment to request_alignment
to the right function, and by using a sane default when the
server does not advertise a minimum size.

CC: qemu-sta...@nongnu.org
Signed-off-by: Eric Blake <ebl...@redhat.com>
Message-Id: <20180215032905.27146-1-ebl...@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy<vsement...@virtuozzo.com>


  Commit: 6bc8695725f82bcce160a9b1612c2737edb1e21c
      
https://github.com/qemu/qemu/commit/6bc8695725f82bcce160a9b1612c2737edb1e21c
  Author: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
  Date:   2018-03-01 (Thu, 01 Mar 2018)

  Changed paths:
    M include/block/nbd.h

  Log Message:
  -----------
  nbd: change indenting in nbd.h

Prepared indenting for the following patch.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
Message-Id: <1518702707-7077-3-git-send-email-vsement...@virtuozzo.com>
Signed-off-by: Eric Blake <ebl...@redhat.com>


  Commit: 25c146789f533c755923b941262be8072586728c
      
https://github.com/qemu/qemu/commit/25c146789f533c755923b941262be8072586728c
  Author: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
  Date:   2018-03-01 (Thu, 01 Mar 2018)

  Changed paths:
    M include/block/nbd.h
    M nbd/common.c

  Log Message:
  -----------
  nbd: BLOCK_STATUS constants

Expose the new constants and structs that will be used by both
server and client implementations of NBD_CMD_BLOCK_STATUS (the
command is currently experimental at
https://github.com/NetworkBlockDevice/nbd/blob/extension-blockstatus/doc/proto.md
but will hopefully be stabilized soon).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
Message-Id: <1518702707-7077-4-git-send-email-vsement...@virtuozzo.com>
[eblake: split from larger patch on server implementation]
Signed-off-by: Eric Blake <ebl...@redhat.com>


  Commit: 28fb494f9b8827c6087d515e20a3c78baaf443cc
      
https://github.com/qemu/qemu/commit/28fb494f9b8827c6087d515e20a3c78baaf443cc
  Author: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
  Date:   2018-03-01 (Thu, 01 Mar 2018)

  Changed paths:
    M nbd/client.c
    M nbd/server.c
    M nbd/trace-events

  Log Message:
  -----------
  nbd/client: fix error messages in nbd_handle_reply_err

1. NBD_REP_ERR_INVALID is not only about length, so, make message more
   general

2. hex format is not very good: it's hard to read something like
   "option a (set meta context)", so switch to dec.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
Message-Id: <1518702707-7077-6-git-send-email-vsement...@virtuozzo.com>
[eblake: expand scope of patch: ALL uses of nbd_opt_lookup and
nbd_rep_lookup are now decimal]
Signed-off-by: Eric Blake <ebl...@redhat.com>


  Commit: 2e7b766594e17f786a6b2e5be690bc5b43ce6036
      
https://github.com/qemu/qemu/commit/2e7b766594e17f786a6b2e5be690bc5b43ce6036
  Author: Peter Maydell <peter.mayd...@linaro.org>
  Date:   2018-03-02 (Fri, 02 Mar 2018)

  Changed paths:
    M block/nbd-client.c
    M block/nbd.c
    M include/block/nbd.h
    M nbd/client.c
    M nbd/common.c
    M nbd/server.c
    M nbd/trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-03-01' into 
staging

nbd patches for 2018-03-01

- Eric Blake: nbd: Honor server's advertised minimum block size
- Vladimir Sementsov-Ogievskiy: partial: nbd block status base:allocation

# gpg: Signature made Thu 01 Mar 2018 21:01:22 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <ebl...@redhat.com>"
# gpg:                 aka "Eric Blake (Free Software Programmer) 
<e...@byu.net>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2018-03-01:
  nbd/client: fix error messages in nbd_handle_reply_err
  nbd: BLOCK_STATUS constants
  nbd: change indenting in nbd.h
  nbd: Honor server's advertised minimum block size

Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>


Compare: https://github.com/qemu/qemu/compare/427cbc7e4136...2e7b766594e1

Reply via email to