Re: [PATCH] tests: viriscsitest: make it work on big endian archs

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

 



On Wednesday, 1 August 2018 15:24:05 CEST Daniel P. Berrangé wrote:
> On Wed, Aug 01, 2018 at 03:08:07PM +0200, Pino Toscano wrote:
> > viriscsitest tries to ensure the interface IQN used is a specific one,
> > checking later on that it is the same all during the whole test.  Since
> > the IQN generation involves random bytes, viriscsitest got a fake
> > virRandomBytes from the virrandommock helper library, setting static
> > values.  virRandomBits(), called by virStorageBackendCreateIfaceIQN(),
> > always requests 8 random bytes, chopping off the ones not requested by
> > the caller -- this meant that on big endian machines it would chop bytes
> > from the wrong size of the data buffer, and thus not returning the
> > expected numbers.
> > 
> > As a fix, do not rely on the mock virRandomBytes, but provide an own
> > version of it: this version will fill the values in the expected order,
> > depending on the endianness of the system.  This way, the result of
> > virStorageBackendCreateIfaceIQN() will be what the test actually
> > expects.
> > 
> > Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx>
> 
> Mailman is having deliver problems so you might not have received
> the patch that was sent earlier for this problem:
> 
> https://www.redhat.com/archives/libvir-list/2018-August/msg00039.html
> 
> I prefer that approach since it avoids the endianness problems for
> all future usage too.

I replied to that patch, as IMHO there is no "endianness" for random
data, and thus virRandomBytes() ought to not do any manipulation.

-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.

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