qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 15f084: xen-block: only advertize discard to


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 15f084: xen-block: only advertize discard to the frontend ...
Date: Thu, 04 Apr 2019 20:50:15 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 15f084505a8556b70134e9081176e90a1c178b7b
      
https://github.com/qemu/qemu/commit/15f084505a8556b70134e9081176e90a1c178b7b
  Author: Paul Durrant <address@hidden>
  Date:   2019-04-04 (Thu, 04 Apr 2019)

  Changed paths:
    M hw/block/xen-block.c

  Log Message:
  -----------
  xen-block: only advertize discard to the frontend when it is enabled...

...and properly enable it when synthesizing a drive.

The Xen toolstack sets 'discard-enable' to '1' in xenstore when it wants
to enable discard on a specified image. The code in
xen_block_drive_create() correctly parses this and uses it to set
'discard' to 'unmap' for the file_layer, but fails to do the same for the
driver_layer (which effectively disables it). Meanwhile the code in
xen_block_realize() advertizes discard support to the frontend in the
default case (because conf->discard_granularity defaults to -1), even when
the underlying image may not handle it.

This patch adds the missing option to the driver_layer in
xen_block_driver_create() and checks whether BDRV_O_UNMAP is actually
set on the block device before advertizing discard to the frontend.
In the case that discard is supported it also makes sure that the
granularity is set to the physical block size.

Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Anthony PERARD <address@hidden>


  Commit: 2bcd05cf24a7de34e7e265247c010977e43f40bc
      
https://github.com/qemu/qemu/commit/2bcd05cf24a7de34e7e265247c010977e43f40bc
  Author: Paul Durrant <address@hidden>
  Date:   2019-04-04 (Thu, 04 Apr 2019)

  Changed paths:
    M hw/block/dataplane/xen-block.c
    M hw/block/xen-block.c
    M hw/block/xen_blkif.h

  Log Message:
  -----------
  xen-block: scale sector based quantities correctly

The Xen blkif protocol requires that sector based quantities should be
interpreted strictly as multiples of 512 bytes. Specifically:

"first_sect and last_sect in blkif_request_segment, as well as
sector_number in blkif_request, are always expressed in 512-byte units."

Commit fcab2b464e06 "xen: add header and build dataplane/xen-block.c"
incorrectly modified behaviour to use the block device logical_block_size
property as the scale, instead of correctly shifting values by the
hardcoded BDRV_SECTOR_BITS (and hence scaling them to 512 byte units).
This patch undoes that change and restores compliance with the spec.

Furthermore, this patch also restores the original xen_disk behaviour
of advertizing a hardcoded 'sector-size' value of 512 in xenstore and
scaling 'sectors' accordingly. The realize() method is also modified to
fail if logical_block_size is set to anything other than 512.

Signed-off-by: Paul Durrant <address@hidden>
Reviewed-by: Anthony PERARD <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Anthony PERARD <address@hidden>


  Commit: bc939abe00cd7c34bfd9412af3fffff40132dd50
      
https://github.com/qemu/qemu/commit/bc939abe00cd7c34bfd9412af3fffff40132dd50
  Author: Peter Maydell <address@hidden>
  Date:   2019-04-05 (Fri, 05 Apr 2019)

  Changed paths:
    M hw/block/dataplane/xen-block.c
    M hw/block/xen-block.c
    M hw/block/xen_blkif.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190404' into 
staging

Xen queue

xen-block fixes

# gpg: Signature made Thu 04 Apr 2019 18:04:38 BST
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg:                issuer "address@hidden"
# gpg: Good signature from "Anthony PERARD <address@hidden>" [marginal]
# gpg:                 aka "Anthony PERARD <address@hidden>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
#      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF

* remotes/aperard/tags/pull-xen-20190404:
  xen-block: scale sector based quantities correctly
  xen-block: only advertize discard to the frontend when it is enabled...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/f4b37171378b...bc939abe00cd



reply via email to

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