Skip to contentSkip to conversation

xen-block: fix reporting of discard feature

PATCH Applied roger.pau--- via 3 participants 3 messages Jan 18, 2021 – Feb 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-block: fix reporting of discard feature

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/[email protected]/T/#u

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

---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Cc: Paul Durrant <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 hw/block/xen-block.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/xen-block.c +1 -0
index 718d886e5c..246d9c23a2 100644
@@ -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);
Signature · 1 line
2.29.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines

-----Original Message-----
From: Roger Pau Monne <[email protected]>
Sent: 18 January 2021 15:34
To: [email protected]
Cc: Roger Pau Monne <[email protected]>; Arthur Borsboom <[email protected]>; Stefano Stabellini <[email protected]>; Anthony Perard <[email protected]>; Paul Durrant <[email protected]>; Kevin Wolf <[email protected]>; Max Reitz <[email protected]>; xen- [email protected]; [email protected]
Subject: [PATCH] xen-block: fix reporting of discard feature

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:

Quoted 7 lines

https://lore.kernel.org/lkml/[email protected]/T/#u

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

Quoted 26 lines

---
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Cc: Paul Durrant <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 hw/block/xen-block.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/xen-block.c +1 -1
index 718d886e5c..246d9c23a2 100644
@@ -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

Applied
#2 lore raw

Am 18.01.2021 um 16:49 hat Paul Durrant geschrieben:

Quoted 18 lines
Quoted 18 lines

-----Original Message-----
From: Roger Pau Monne <[email protected]>
Sent: 18 January 2021 15:34
To: [email protected]
Cc: Roger Pau Monne <[email protected]>; Arthur Borsboom <[email protected]>; Stefano Stabellini <[email protected]>; Anthony Perard <[email protected]>; Paul Durrant <[email protected]>; Kevin Wolf <[email protected]>; Max Reitz <[email protected]>; xen- [email protected]; [email protected]
Subject: [PATCH] xen-block: fix reporting of discard feature

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/[email protected]/T/#u

Quoted 7 lines
Quoted 5 lines

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

Thanks, applied to the block branch.

Kevin