aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/block/nvme-ns.c7
-rw-r--r--hw/block/nvme.c5
2 files changed, 6 insertions, 6 deletions
diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
index dfed71a950..93ac6e107a 100644
--- a/hw/block/nvme-ns.c
+++ b/hw/block/nvme-ns.c
@@ -358,17 +358,12 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
NvmeNamespace *ns = NVME_NS(dev);
BusState *s = qdev_get_parent_bus(dev);
NvmeCtrl *n = NVME(s->parent);
- Error *local_err = NULL;
- if (nvme_ns_setup(ns, &local_err)) {
- error_propagate_prepend(errp, local_err,
- "could not setup namespace: ");
+ if (nvme_ns_setup(ns, errp)) {
return;
}
if (nvme_register_namespace(n, ns, errp)) {
- error_propagate_prepend(errp, local_err,
- "could not register namespace: ");
return;
}
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 5ce21b7100..fb83636abd 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -3228,6 +3228,7 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeRequest *req)
result = ns->features.err_rec;
goto out;
case NVME_VOLATILE_WRITE_CACHE:
+ result = 0;
for (i = 1; i <= n->num_namespaces; i++) {
ns = nvme_ns(n, i);
if (!ns) {
@@ -4507,6 +4508,10 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)
if (nvme_ns_setup(ns, errp)) {
return;
}
+
+ if (nvme_register_namespace(n, ns, errp)) {
+ return;
+ }
}
}