[libvirt] [PATCH] test_driver: provide virDomainGetTime implementation

Pavel Hrdina phrdina at redhat.com
Tue Apr 9 12:39:35 UTC 2019


On Tue, Apr 09, 2019 at 12:16:22PM +0200, Ján Tomko wrote:
> On Mon, Apr 08, 2019 at 01:43:17AM +0200, Ilias Stamatis wrote:
> > Implement testDomainGetTime by returning the current time.
> > 
> > Signed-off-by: Ilias Stamatis <stamatis.iliass at gmail.com>
> > ---
> > I initially implemented this using clock_gettime, but Pavel suggested
> > that this might not be a good idea since it isn't a cross-platform
> > function. So I used virTimeMillisNow instead and set the nanoseconds
> > part to 0 which can be ok for the test driver.
> > 
> 
> Do you have a consumer for this?

There is probably no consumer for now.  However the ultimate goal is to
implement all APIs in the test driver in order to make the test driver
implementation mandatory for every new API.

> IIUC these APIs are used for testing by higher layers like virt-manager
> or libvirt-dbus and having it return a different value every time does
> not seem that useful. For example for nodeCPUstats we return hardcoded
> values.

I'm OK with hard-coding some specific value, my guess is that no
management application will check the specific value but we can
give them that possibility.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190409/d8866480/attachment-0001.sig>


More information about the libvir-list mailing list