qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCHv2 10/11] iscsi: ignore aio_discard if unsupported


From: Peter Lieven
Subject: [Qemu-devel] [PATCHv2 10/11] iscsi: ignore aio_discard if unsupported
Date: Thu, 27 Jun 2013 15:11:34 +0200

if the target does not support UNMAP or the request
is too big silently ignore the discard request.

Signed-off-by: Peter Lieven <address@hidden>
---
 block/iscsi.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index e9ecfce..0567b46 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -694,6 +694,14 @@ iscsi_aio_discard(BlockDriverState *bs,
     acb->sector_num  = sector_num;
     acb->retries     = ISCSI_CMD_RETRIES;
 
+    if (!iscsilun->lbpu ||
+        sector_qemu2lun(nb_sectors, iscsilun) > iscsilun->max_unmap) {
+        /* silently ignore discard request */
+        acb->status = 0;
+        iscsi_schedule_bh(acb);
+        return &acb->common;
+    }
+
     if (iscsi_aio_discard_acb(acb) != 0) {
         qemu_aio_release(acb);
         return NULL;
-- 
1.7.9.5




reply via email to

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