Two small fixes for regressions reported by Alexander Graf and Bin Meng.

v2: spotted one bug in the error handling.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmAlSwIACgkQTeGvMW1P
 DelEvggAoCgDY+FbKbFbioRmuE/4Z9kPk6H99eAIlLDeFzVLhJWnwwCMIC9uK973
 Tfut5emc4/sdR7ZeWeLhe6r5b4SNA+2E/FU5TpVnIm8WqHt3OCSnbMiYmZQuQAgI
 0TYod8pPr9cfoybkKtnjxFVa9gEh7LJBqr8i9NEf+fCpIR6r4+cIM6Yd9Pdbxmqw
 UwmN1xbL/ttL+vBUuyaACrfXa9ZFuiFssg7vOAG4yO0znCy3nTscNyyltBdnB7QJ
 vgmqxtUdHSriWyS23XfU23TiXgDu/HN3eqdu5zHCC1nd/KdVYzDXKbdZnNduqs9g
 /YzLZ9Z54TwZ3yI0RhmyVUbvRlr3OQ==
 =qwWR
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/nvme/tags/nvme-fixes-pull-request' into staging

Two small fixes for regressions reported by Alexander Graf and Bin Meng.

v2: spotted one bug in the error handling.

# gpg: Signature made Thu 11 Feb 2021 15:19:30 GMT
# gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg:                 aka "Klaus Jensen <k.jensen@samsung.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
#      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9

* remotes/nvme/tags/nvme-fixes-pull-request:
  hw/block/nvme: fix error handling in nvme_ns_realize
  hw/block/nvme: Fix a build error in nvme_get_feature()
  hw/block/nvme: fix legacy namespace registration

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2021-02-11 15:32:28 +00:00
commit c973f06521
2 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}
}
}