]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: don't read cpuid on non-live systems
authorKarel Zak <kzak@redhat.com>
Thu, 14 Feb 2013 14:38:08 +0000 (15:38 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 14 Feb 2013 14:38:08 +0000 (15:38 +0100)
Reported-by: Luis Aranguren <pizzaman@hotmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c

index 824c8b77b26b7e6f0a7917558f24ffef46295ba2..b4fe02dd6706be222ef80bda6a1ffac2cb7a937b 100644 (file)
@@ -518,9 +518,10 @@ read_hypervisor_cpuid(struct lscpu_desc *desc)
 #endif
 
 static void
-read_hypervisor(struct lscpu_desc *desc)
+read_hypervisor(struct lscpu_desc *desc, struct lscpu_modifier *mod)
 {
-       read_hypervisor_cpuid(desc);
+       if (mod->system != SYSTEM_SNAPSHOT)
+               read_hypervisor_cpuid(desc);
 
        if (desc->hyper)
                /* hvm */
@@ -1385,7 +1386,7 @@ int main(int argc, char *argv[])
                                sizeof(struct cpu_cache), cachecmp);
 
        read_nodes(desc);
-       read_hypervisor(desc);
+       read_hypervisor(desc, mod);
 
        switch(mod->mode) {
        case OUTPUT_SUMMARY: