qemu-devel
[Top][All Lists]
Advanced

[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!



reply via email to

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