qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API
Date: Fri, 20 Jul 2012 12:38:30 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Jul 19, 2012 at 01:37:11PM +0200, Paolo Bonzini wrote:
> Il 18/07/2012 17:35, Daniel P. Berrange ha scritto:
> > Oh, and will this library depend on glib
> 
> Yes, in all likelihood.
> 
> , and will it have the
> > abort-on-oom behaviour QEMU has ? From a libvirt POV, we won't
> > use any library that aborts-on-oom.
> 
> Out of curiosity, how do you test OOM?

There's two aspects to it. First we forbid use of malloc/free/realloc
in favour of an alternative set of APIs designed such that we can get
compile time errors when people don't check the result for NULL.

  
http://berrange.com/posts/2008/05/23/better-living-through-api-design-low-level-memory-allocation/

This has been very successful in ensuring code checks for OOM correctly.
Second there is a mode in our test suites where you can run under
simulated OOM - it runs once to count the total set of mallocs in the
test, and then re-run it 'n' times failing each malloc in turn and
verifying that we correctly report the OOM error condition.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]