qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] fd8d37: nbd: Honor server's advertised minimu


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] fd8d37: nbd: Honor server's advertised minimum block size
Date: Fri, 02 Mar 2018 05:48:25 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: fd8d372dd36e839568a718684914d9960d8b1ebd
      
https://github.com/qemu/qemu/commit/fd8d372dd36e839568a718684914d9960d8b1ebd
  Author: Eric Blake <address@hidden>
  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: address@hidden
Signed-off-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy<address@hidden>


  Commit: 6bc8695725f82bcce160a9b1612c2737edb1e21c
      
https://github.com/qemu/qemu/commit/6bc8695725f82bcce160a9b1612c2737edb1e21c
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  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 <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Eric Blake <address@hidden>


  Commit: 25c146789f533c755923b941262be8072586728c
      
https://github.com/qemu/qemu/commit/25c146789f533c755923b941262be8072586728c
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  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 <address@hidden>
Message-Id: <address@hidden>
[eblake: split from larger patch on server implementation]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 28fb494f9b8827c6087d515e20a3c78baaf443cc
      
https://github.com/qemu/qemu/commit/28fb494f9b8827c6087d515e20a3c78baaf443cc
  Author: Vladimir Sementsov-Ogievskiy <address@hidden>
  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 <address@hidden>
Message-Id: <address@hidden>
[eblake: expand scope of patch: ALL uses of nbd_opt_lookup and
nbd_rep_lookup are now decimal]
Signed-off-by: Eric Blake <address@hidden>


  Commit: 2e7b766594e17f786a6b2e5be690bc5b43ce6036
      
https://github.com/qemu/qemu/commit/2e7b766594e17f786a6b2e5be690bc5b43ce6036
  Author: Peter Maydell <address@hidden>
  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 <address@hidden>"
# gpg:                 aka "Eric Blake (Free Software Programmer) 
<address@hidden>"
# 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 <address@hidden>


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]