Re: [PATCH 2/3] conf: Clean up nodedev code

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

 



On Thu, Mar 02, 2017 at 10:47:20 +0100, Michal Privoznik wrote:
> On 03/02/2017 10:16 AM, Peter Krempa wrote:
> > On Thu, Mar 02, 2017 at 10:04:24 +0100, Michal Privoznik wrote:
> >> On 03/02/2017 09:58 AM, Peter Krempa wrote:
> >>> On Wed, Mar 01, 2017 at 19:27:15 -0500, John Ferlan wrote:
> >>>> Alter the static functions from virNodeDev* to just nodeDev* as a visual
> >>>> cue to determine which are local or not when reading code.
> >>>>
> >>>> Cleanup spacing between functions, function defs, etc. to match more modern
> >>>> techniques used in libvirt
> >>>>
> >>>> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> >>>> ---
> >>>>  src/conf/node_device_conf.c | 476 +++++++++++++++++++++++---------------------
> >>>>  src/conf/virnodedeviceobj.c | 128 ++++++------
> >>>>  2 files changed, 322 insertions(+), 282 deletions(-)

[...]

> > The static function name may still show up in logs and backtraces. It's
> > better to see what belongs to libvirt and what does not.
> 
> I don't know about your backtraces, but mine show the filename too.
> Either actual source file or .so file where the symbol comes from. We
> can rely on that.
> Or if a static function of ours calls a function from another library,
> it's going to be visible too:
> 
> #0 virExposedAPI
> #1 someStaticFunc
> #2 someOtherStaticFunc
> #3 glfs_creat
> #4 yetAnotherStaticFunc

Let's try some real example where our namespace collides with others:

#0  0x00007fdaa6651770 in udev_device_get_devtype () from /lib64/libudev.so.1
#1  0x00007fda989e9ea6 in udevGetDeviceType (type=0x55c03b7df050, device=0x55c03b7ae650) at node_device/node_device_udev.c:992
#2  udevAddOneDevice (device=device@entry=0x55c03b7ae650) at node_device/node_device_udev.c:1194
#3  0x00007fda989ebb9a in udevEventHandleCallback (watch=watch@entry=8, fd=<optimized out>, events=events@entry=1, 
    data=data@entry=0x0) at node_device/node_device_udev.c:1405

Yes you can see it by looking at 'from' or due to the fact that libudev
uses undescores rather than camel case, but on first glance the
difference is impossible to spot.

Attachment: signature.asc
Description: PGP signature

--
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]
  Powered by Linux