aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGollu Appalanaidu <anaidu.gollu@samsung.com>2021-01-24 21:05:32 +0530
committerKlaus Jensen <k.jensen@samsung.com>2021-02-08 21:15:54 +0100
commit0065f42ef1206527188a44e9c456c9b6d10de5ec (patch)
tree40e57f7e2493a2d9b115efe9162d5a6038304526 /hw
parent56990c777a635ded6e2f191c470ca6410cf5c11a (diff)
downloadqemu-0065f42ef1206527188a44e9c456c9b6d10de5ec.zip
qemu-0065f42ef1206527188a44e9c456c9b6d10de5ec.tar.gz
qemu-0065f42ef1206527188a44e9c456c9b6d10de5ec.tar.bz2
hw/block/nvme: fix set feature save field check
Currently, no features are saveable, so the current check is not wrong, but add a check against the feature capabilities to make sure this will not regress if saveable features are added later. Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/nvme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index b3d072c..c99a3fb 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -3324,7 +3324,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req)
trace_pci_nvme_setfeat(nvme_cid(req), nsid, fid, save, dw11);
- if (save) {
+ if (save && !(nvme_feature_cap[fid] & NVME_FEAT_CAP_SAVE)) {
return NVME_FID_NOT_SAVEABLE | NVME_DNR;
}