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

[PATCH] xen-block: fix reporting of discard feature


  • To: <qemu-devel@xxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 Jan 2021 16:33:30 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=414HAnI51gzZNcMd8XEwXwGUTwqdX0TMfXgV5vrF0kQ=; b=jYkCA2+GhmvKAOD/X17EvmllYFsnj0Evgjgk0OBaELlrl51teyQh7cU/I4kqYyEuZv9bfCLWx+ZxzfzlwttCjWQtSS/WhAmxUX8xPJx740rclxbkptNEg9fbD1z+ajSH29SGzwM/G8VFriT1LHVcubKOlCR3USQFAWfJUtP1vpeZ6LweU9B7poW/Wo6cPsz//KbmQUahj6I4t9cXssHHV8fPmwzsObfzAZBNIlqizUTf8O/F5gNWGJSwNN1PQFIz41zcjrCKtmt/P5POMtloyH0uX3sxb7a94+IQRpjKRjs6/w2u+MDuUcBOT38IeR6iLLqVFBdrSTXQX3eW6TRqKQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MFK6eCmH6+D8WPgct5aBDEebF0wYe11xD+9uVv0hFopyviKeHFk0Pgx1ChSWMwElbHC19RkGxqd+DFXo3pCqTlzVId1L9AO61J0aAN9n+rqeaRtSybFj8YV3Y+qdRRLsfxJOqLVet0ltkP/XOKWD7xB5TOClQkog/CwooTLARNXQo2uBEpDsgKqHVGdFJOWWTD6NC4tJvI3mfD1zq08bRDynHJKbOwe5jFki6Dd1T3DwgJ40k7mJLIa5hk1Cz4hxuKWFTIVVr3LOwqRjpHMYDuCBfITpd2LorTst9euqzYEZvPqLw+zmqtq+J95lkeBofD4Ol66IvYIp/FoHgAZYkw==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Arthur Borsboom <arthurborsboom@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Kevin Wolf <kwolf@xxxxxxxxxx>, Max Reitz <mreitz@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <qemu-block@xxxxxxxxxx>
  • Delivery-date: Mon, 18 Jan 2021 15:33:42 +0000
  • Ironport-sdr: VGue1MCqGxbMfd6Neo4leRV//MEVur/8VqgbzCLedVS3x5ugx/22Jwv/scH/7MGUZVgdSDlZdR OhuQ38U4/1pUiyGW3KbPvfXJHAXmx/SD18Dg3loMfR3/OzghWKrnLLLhuwEsZ/JdEQ8YGc9xrr O/PF1NLaFDzmQusCWrJTvdlAVaSUmJuP4oRujJvKewDNFtggzWUHjUKX8zRD+Nt4u6YuRIl/Qu z2FqZh6PsRCl5PAmhnXpUVMyG1lYW5AabGoiUv7hqNmgUZxVfbKPtMzJWBThdMMXoUs/8RhT/o zQ0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Linux blkfront expects both "discard-granularity" and
"discard-alignment" present on xenbus in order to properly enable the
feature, not exposing "discard-alignment" left some Linux blkfront
versions with a broken discard setup. This has also been addressed in
Linux with:

https://lore.kernel.org/lkml/20210118151528.81668-1-roger.pau@xxxxxxxxxx/T/#u

Fix QEMU to report a "discard-alignment" of 0, in order for it to work
with older Linux frontends.

Reported-by: Arthur Borsboom <arthurborsboom@xxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>
Cc: Paul Durrant <paul@xxxxxxx>
Cc: Kevin Wolf <kwolf@xxxxxxxxxx>
Cc: Max Reitz <mreitz@xxxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
Cc: qemu-block@xxxxxxxxxx
---
 hw/block/xen-block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 718d886e5c..246d9c23a2 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -253,6 +253,7 @@ static void xen_block_realize(XenDevice *xendev, Error 
**errp)
         xen_device_backend_printf(xendev, "feature-discard", "%u", 1);
         xen_device_backend_printf(xendev, "discard-granularity", "%u",
                                   conf->discard_granularity);
+        xen_device_backend_printf(xendev, "discard-alignment", "%u", 0);
     }
 
     xen_device_backend_printf(xendev, "feature-flush-cache", "%u", 1);
-- 
2.29.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.