Re: [PATCH 17/26] cputest: Test CPU signatures

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

 



On Thu, Feb 28, 2019 at 17:29:15 +0100, Ján Tomko wrote:
> On Wed, Feb 27, 2019 at 02:29:07PM +0100, Jiri Denemark wrote:
> >The signature computation code is not too complicated and it will likely
> >never change so testing it is not very important. We do it mostly for a
> >nice side effect of easily accessible signature numbers for all CPU
> >data files.
> >
> >Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> >---
> >+static int
> >+cpuTestCompareSignature(const struct data *data,
> >+                        virCPUDataPtr hostData)
> >+{
> >+    unsigned long signature;
> >+    unsigned int family;
> >+    unsigned int model;
> >+    unsigned int stepping;
> >+    char *result = NULL;
> >+    char *sigStr = NULL;
> 
> Could have used VIR_AUTOFREE
> 
> >+    int ret = -1;
> >+
> >+    signature = virCPUx86DataGetSignature(hostData, &family, &model, &stepping);
> >+
> >+    if (virAsprintf(&result, "%s/cputestdata/%s-cpuid-%s.sig",
> >+                    abs_srcdir, virArchToString(data->arch), data->host) < 0)
> >+        goto cleanup;
> >+
> >+    if (virAsprintf(&sigStr,
> >+                    "%1$06lx\n"
> >+                    "family:   %2$2u (0x%2$02x)\n"
> >+                    "model:    %3$2u (0x%3$02x)\n"
> >+                    "stepping: %4$2u (0x%4$02x)\n",
> 
> $3u to nicely align numbers greater than 0x63

Done (both changes).

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]

  Powered by Linux