From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynl16-0006as-Hh for qemu-devel@nongnu.org; Thu, 30 Apr 2015 05:44:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ynl11-0001wv-NN for qemu-devel@nongnu.org; Thu, 30 Apr 2015 05:44:24 -0400 Received: from verein.lst.de ([213.95.11.211]:46238 helo=newverein.lst.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ynl11-0001vD-H5 for qemu-devel@nongnu.org; Thu, 30 Apr 2015 05:44:19 -0400 Date: Thu, 30 Apr 2015 11:44:17 +0200 From: Christoph Hellwig Message-ID: <20150430094417.GA18671@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] nvme: support NVME_VOLATILE_WRITE_CACHE feature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Keith Busch , qemu-devel@nongnu.org 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 diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 1e07166..50d76f1 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; }