[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/16] nvme: factor out block backend setup
From: |
Klaus Birkelund Jensen |
Subject: |
Re: [PATCH 11/16] nvme: factor out block backend setup |
Date: |
Wed, 15 Apr 2020 13:02:58 +0200 |
On Apr 15 12:52, Philippe Mathieu-Daudé wrote:
> On 4/15/20 12:24 PM, Klaus Jensen wrote:
> > From: Klaus Jensen <address@hidden>
> >
> > Signed-off-by: Klaus Jensen <address@hidden>
> > ---
> > hw/block/nvme.c | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> > index e67f578fbf79..f0989cbb4335 100644
> > --- a/hw/block/nvme.c
> > +++ b/hw/block/nvme.c
> > @@ -1348,6 +1348,17 @@ static void nvme_init_state(NvmeCtrl *n)
> > n->cq = g_new0(NvmeCQueue *, n->params.max_ioqpairs + 1);
> > }
> > +static int nvme_init_blk(NvmeCtrl *n, Error **errp)
> > +{
> > + blkconf_blocksizes(&n->conf);
> > + if (!blkconf_apply_backend_options(&n->conf,
> > blk_is_read_only(n->conf.blk),
> > + false, errp)) {
> > + return -1;
> > + }
> > +
> > + return 0;
>
> I'm not sure this is a correct usage of the 'propagating errors' API (see
> CODING_STYLE.rst and include/qapi/error.h), I'd expect this function to
> return void, and use a local_error & error_propagate() in nvme_realize().
>
> However this works, so:
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>
So, I get that and did use the propagate functionality earlier. But I
still used the int return. I'm not sure about the style if returning
void - should I check if errp is now non-NULL? Point is that I need to
return early since the later calls could fail if previous calls did not
complete successfully.
- [PATCH 10/16] nvme: factor out device state setup, (continued)
- [PATCH 10/16] nvme: factor out device state setup, Klaus Jensen, 2020/04/15
- [PATCH 07/16] nvme: add max_ioqpairs device parameter, Klaus Jensen, 2020/04/15
- [PATCH 08/16] nvme: remove redundant cmbloc/cmbsz members, Klaus Jensen, 2020/04/15
- [PATCH 04/16] nvme: move device parameters to separate struct, Klaus Jensen, 2020/04/15
- [PATCH 02/16] nvme: rename trace events to nvme_dev, Klaus Jensen, 2020/04/15
- [PATCH 11/16] nvme: factor out block backend setup, Klaus Jensen, 2020/04/15
- [PATCH 12/16] nvme: add namespace helpers, Klaus Jensen, 2020/04/15
- [PATCH 14/16] nvme: factor out pci setup, Klaus Jensen, 2020/04/15
- [PATCH 13/16] nvme: factor out namespace setup, Klaus Jensen, 2020/04/15
[PATCH 15/16] nvme: factor out cmb setup, Klaus Jensen, 2020/04/15