aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-04-30 11:44:17 +0200
committerKevin Wolf <kwolf@redhat.com>2015-05-22 17:08:00 +0200
commitaacd5650c68ef2e9e19079ba60cb0df51e15880c (patch)
treeb67b475e17bcda3701145c78a0fdd6b79bda44e4 /hw/block
parentecbda7a22576591a84f44de1be0150faf6001f1c (diff)
downloadqemu-aacd5650c68ef2e9e19079ba60cb0df51e15880c.zip
qemu-aacd5650c68ef2e9e19079ba60cb0df51e15880c.tar.gz
qemu-aacd5650c68ef2e9e19079ba60cb0df51e15880c.tar.bz2
nvme: support NVME_VOLATILE_WRITE_CACHE feature
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>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/nvme.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index ad988d7..4b6d5e6 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -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;
}