Bug 237421

Summary: Bad cpuTime retrieved from Sys::Virt::Domain->get_info
Product: [Fedora] Fedora Reporter: Guillaume Bougard <g+fedora>
Component: perl-Sys-VirtAssignee: Stepan Kasal <kasal>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: berrange, kasal, perl-devel, triage
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-18 00:55:17 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Guillaume Bougard 2007-04-22 10:23:02 EDT
Description of problem:
I tried the API on a AMD Athlon(tm) XP 3000+, I got bad values with some
negative one for the cpuTime of a domain.

Version-Release number of selected component (if applicable):
perl-Sys-Virt-0.1.1

How reproducible:
every time

Steps to Reproduce:
1. Run a server with some xen domains
2. Try the example included in the package:
/usr/share/doc/perl-Sys-Virt-0.1.1/examples/dump-info.pl
3. Observe the "cpuTime" values
  
Actual results:
False

Expected results:
Good

Additional info:
I search the sources and I found this value is in fact unsigned long long value
in libvirt library to represent nanoseconds (cf
http://libvirt.org/html/libvirt-libvirt.html#virDomainInfo). I didn't try on a
64 bits arch but I think the it could work on it.

I managed to obtain the expected results by patching the sources: I edit Virt.xs
from the source and changed the line 359 from:
      hv_store (RETVAL, "cpuTime", 7, newSViv(info.cpuTime), 0);
to
      hv_store (RETVAL, "cpuTime", 7, newSVnv(info.cpuTime), 0);

So the unsigned long long is read as a float scalar and not an integer scalar.
Comment 1 Bug Zapper 2008-04-04 02:55:58 EDT
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
Comment 2 Marcela Mašláňová 2008-05-05 08:15:50 EDT
Could someone with xen reproduce it?
Comment 3 Bug Zapper 2008-05-06 15:31:50 EDT
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen thus bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 4 Daniel Berrange 2008-05-06 15:36:02 EDT
Stupid bot. Re-opening this still relevant issue.
Comment 5 Guillaume Bougard 2008-05-06 17:21:38 EDT
Hi, indeed,

just tried that case on my production server with some Xen host but on a 64 bits
arch. Fedora is version 7 and package is perl-Sys-Virt-0.1.1-9.fc7.x86_64.

As expected, cpuTime are correct and are set in nano-second. As example, 'xm
list' gives me '218775.2' sec for a given virtual host and the perl script
returns '218775244013148' for cpuTime.

Sorry but I can't try on i686 as my production server is now x86_64.
Comment 6 Bug Zapper 2008-11-26 02:14:08 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Bug Zapper 2009-01-09 02:06:17 EST
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 8 Daniel Berrange 2009-03-27 20:10:52 EDT
Re-opening as this bug is still valid, and a fix is now available in upstream 0.2.0 release of Sys-Virt
Comment 9 Stepan Kasal 2009-03-30 11:57:05 EDT
perl-Sys-Virt-0.2.0-2.fc11 should appear in rawhide tomorrow.

Still working on a fix for Fedora 10.
Comment 10 Bug Zapper 2009-11-18 03:11:30 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 11 Bug Zapper 2009-12-18 00:55:17 EST
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.