[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V4 1/6] hw/block/nvme: introduce nvme-subsys device
From: |
Minwoo Im |
Subject: |
Re: [PATCH V4 1/6] hw/block/nvme: introduce nvme-subsys device |
Date: |
Fri, 22 Jan 2021 08:40:26 +0900 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
On 21-01-21 14:52:02, Keith Busch wrote:
> On Fri, Jan 22, 2021 at 07:09:03AM +0900, Minwoo Im wrote:
> > +static void nvme_subsys_setup(NvmeSubsystem *subsys)
> > +{
> > + char *subnqn;
> > +
> > + subnqn = g_strdup_printf("nqn.2019-08.org.qemu:%s",
> > subsys->parent_obj.id);
> > + strpadcpy((char *)subsys->subnqn, sizeof(subsys->subnqn), subnqn,
> > '\0');
> > + g_free(subnqn);
>
> Instead of the duplication and copy, you could format the string
> directly into the destination:
>
> snprintf(subsys->subnqn, sizeof(subsys->subnqn),
> "nqn.2019-08.org.qemu:%s",
> subsys->parent_obj.id);
Oh, Thanks. Will fix it!
- [PATCH V4 0/6] hw/block/nvme: support multi-path for ctrl/ns, Minwoo Im, 2021/01/21
- [PATCH V4 1/6] hw/block/nvme: introduce nvme-subsys device, Minwoo Im, 2021/01/21
- [PATCH V4 2/6] hw/block/nvme: support to map controller to a subsystem, Minwoo Im, 2021/01/21
- [PATCH V4 3/6] hw/block/nvme: add CMIC enum value for Identify Controller, Minwoo Im, 2021/01/21
- [PATCH V4 4/6] hw/block/nvme: support for multi-controller in subsystem, Minwoo Im, 2021/01/21
- [PATCH V4 6/6] hw/block/nvme: support for shared namespace in subsystem, Minwoo Im, 2021/01/21
- [PATCH V4 5/6] hw/block/nvme: add NMIC enum value for Identify Namespace, Minwoo Im, 2021/01/21