Re: [PATCH] virsysinfo: Use more virSkipSpacesBackwards()

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

 



On Tue, 2018-03-13 at 16:21 +0100, Michal Privoznik wrote:
> Some fields reported by dmidecode have plenty of useless spaces
> (in fact some have nothing but spaces). To deal with this we have
> introduced virSkipSpacesBackwards() and use it in
> virSysinfoParseX86Processor() and virSysinfoParseX86Memory().
> However, other functions (e.g. virSysinfoParseX86Chassis()) don't
> use it at all and thus we are reporting nonsense:
> 
>   <sysinfo type='smbios'>
>     <chassis>
>       <entry name='manufacturer'>FUJITSU</entry>
>       <entry name='version'>                      </entry>
>       <entry name='serial'>                </entry>
>       <entry name='asset'>                                        </entry>
>       <entry name='sku'>Default string</entry>
>     </chassis>
>   </sysinfo>
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/util/virsysinfo.c | 34 ++++++++++++++++++++++++++++++----
>  1 file changed, 30 insertions(+), 4 deletions(-)

This would be the perfect time to add test coverage for such odd
smbios data, wouldn't it? :)

You can just modify tests/sysinfodata/x86sysinfo.data and add some
extra spaces eg. after "LENOVO" to show that they are now ignored.

-- 
Andrea Bolognani / Red Hat / Virtualization

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