]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
nvme: support NVME_VOLATILE_WRITE_CACHE feature
authorChristoph Hellwig <hch@lst.de>
Thu, 30 Apr 2015 09:44:17 +0000 (11:44 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 22 May 2015 15:08:00 +0000 (17:08 +0200)
The SCSI emulation in the Linux NVMe driver really wants to know
if a device has a volatile write cache.  Given that qemu has moved
away from a model where we report the backing store WCE bit to
one where the WCE bit is supposed to be part of the migratable
guest-visible state we always return 1 here.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/nvme.c

index ad988d7c24edc56f3d3692578ef03bf3a8417a51..4b6d5e607860c7929de19c6d0ab00832013c9dd0 100644 (file)
@@ -479,6 +479,9 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
         req->cqe.result =
             cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));
         break;
+    case NVME_VOLATILE_WRITE_CACHE:
+        req->cqe.result = cpu_to_le32(1);
+        break;
     default:
         return NVME_INVALID_FIELD | NVME_DNR;
     }