Re: [PATCH 3/5] nodedev: Fix sysfs paths for vport operations

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

 



> > +    if (stat(operation_path, &st) != 0) {
> > +        VIR_FREE(operation_path);
> > +        if (virAsprintf(&operation_path,
> > +                        "%shost%d%s",
> > +                        LINUX_SYSFS_SCSI_HOST_PREFIX,
> > +                        parent_host,
> > +                        operation_file) < 0) {
> 
> It's slightly more efficient to write:
> 
> virAsprintf(&operation_path, LINUX_SYSFS_SCSI_HOST_PREFIX "host%d%s",
>             parent_host, operation_file)

Yeah, it is but the original version is used on several places in node_device
so guess it's better to be consistent with the rest of the code. And although
it's slightly more efficient, I don't think it's a good idea to rewrite
existing code since it could lead into some ugly long lines, such as

    LINUX_SYSFS_FC_HOST_PREFIX "host%d" LINUX_SYSFS_VPORT_CREATE_POSTFIX

:-)

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]