iscsi: ignore flushes on scsi-generic devices
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 2 Apr 2014 13:04:41 +0000 (15:04 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 3 Apr 2014 11:10:45 +0000 (13:10 +0200)
Non-block SCSI devices do not support flushing, but we may still send
them requests via bdrv_flush_all.  Just ignore them.

Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block/iscsi.c

index 2f96a8e037a57f0b5624149bf8a43d8bdcd3a900..e68aa0ffdece32ea222411f0a7ce5af6463ae4e3 100644 (file)
@@ -417,6 +417,10 @@ static int coroutine_fn iscsi_co_flush(BlockDriverState *bs)
     IscsiLun *iscsilun = bs->opaque;
     struct IscsiTask iTask;
 
+    if (bs->sg) {
+        return 0;
+    }
+
     iscsi_co_init_iscsitask(iscsilun, &iTask);
 
 retry: