qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH V4 4/6] hw/block/nvme: support for multi-controller in subsys


From: Minwoo Im
Subject: Re: [PATCH V4 4/6] hw/block/nvme: support for multi-controller in subsystem
Date: Fri, 22 Jan 2021 08:41:53 +0900
User-agent: Mutt/1.11.4 (2019-03-13)

On 21-01-21 15:17:16, Keith Busch wrote:
> On Fri, Jan 22, 2021 at 07:09:06AM +0900, Minwoo Im wrote:
> > -static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev)
> > +static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev, uint16_t 
> > cntlid)
> >  {
> >      NvmeIdCtrl *id = &n->id_ctrl;
> >      uint8_t *pci_conf = pci_dev->config;
> >  
> > +    n->cntlid = cntlid;
> 
> I don't think 'cntlid' is important enough to be a function parameter.
> You can just set it within the 'NvmeCtrl' struct before calling this
> function like all the other properties.

Okay.  Rather than adding a parameter to this function,
nvme_init_subsys() may take this job to assign cntlid to the controller
instance first.  Let me fix one!

> > @@ -4517,7 +4543,11 @@ static void nvme_realize(PCIDevice *pci_dev, Error 
> > **errp)
> >          return;
> >      }
> >  
> > -    nvme_init_ctrl(n, pci_dev);
> > +    cntlid = nvme_init_subsys(n, errp);
> > +    if (cntlid < 0) {
> 
>     error_propogate();

Thanks for catching this.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]