From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvoqY-0004EC-Je for qemu-devel@nongnu.org; Fri, 22 May 2015 11:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvoqX-0006X0-Qw for qemu-devel@nongnu.org; Fri, 22 May 2015 11:26:50 -0400 From: Kevin Wolf Date: Fri, 22 May 2015 17:26:20 +0200 Message-Id: <1432308400-13958-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1432308400-13958-1-git-send-email-kwolf@redhat.com> References: <1432308400-13958-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 02/22] nvme: support NVME_VOLATILE_WRITE_CACHE feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Christoph Hellwig 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 Acked-by: Keith Busch Signed-off-by: Kevin Wolf --- hw/block/nvme.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 1.8.3.1