diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2006-06-13 19:08:40 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2006-06-13 19:08:40 +0000 |
commit | e85fa600e786bf269404661ccb5d68d3e72d4606 (patch) | |
tree | 928434d3a240d8f5837ba09867c10244f7aa5693 /src | |
parent | * src/libvirt.c src/xen_internal.c src/xend_internal.c (diff) | |
download | libvirt-e85fa600e786bf269404661ccb5d68d3e72d4606.tar.gz libvirt-e85fa600e786bf269404661ccb5d68d3e72d4606.tar.bz2 libvirt-e85fa600e786bf269404661ccb5d68d3e72d4606.zip |
Switch float -> double when calculating CPU time in dominfo command to avoid loss of precision
Diffstat (limited to 'src')
-rw-r--r-- | src/virsh.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/virsh.c b/src/virsh.c index ff8aff04a..3b5e242c7 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -773,11 +773,11 @@ cmdDominfo(vshControl * ctl, vshCmd * cmd) vshPrint(ctl, "%-15s %d\n", "CPU(s):", info.nrVirtCpu); if (info.cpuTime != 0) { - float cpuUsed = info.cpuTime; + double cpuUsed = info.cpuTime; - cpuUsed /= 1000000000; + cpuUsed /= 1000000000.0; - vshPrint(ctl, "%-15s %.1fs\n", "CPU time:", cpuUsed); + vshPrint(ctl, "%-15s %.1lfs\n", "CPU time:", cpuUsed); } vshPrint(ctl, "%-15s %lu kB\n", "Max memory:", |