[Libvir] RFC: PATCH 0/5: asynchronous background jobs

Daniel P. Berrange berrange at redhat.com
Mon Jan 14 13:59:01 UTC 2008


On Mon, Jan 14, 2008 at 10:39:25AM +0000, Richard W.M. Jones wrote:
> Daniel P. Berrange wrote:
> >There are a number of existing APIs which can benefit from
> >this, hence I decided to work on this separately from the
> >main storage APIs. The APIs which can make use of this are
> >virDomainCreateLinux, virDomainCreate, virNetworkCreate,
> >virNetworkCreateXML, virDomainSave, virDomainRestore, and
> >virDomainDumpCore. For all of these we add a second variant
> >postfixed with 'Job' in the name, returning a virJobPtr object
> 
> Another way to do this is to overload the domain etc. objects and make 
> them into suspensions.  The advantages being (a) no new API is needed 
> and (b) some code benefits from overlapping computation even without 
> being changed.  See also my reply here:
> 
> http://www.redhat.com/archives/libvir-list/2007-July/msg00257.html
> 
> OTOH, suspensions require "interesting" code changes inside libvirt, 
> although not necessarily requiring threads - there are several possible 
> implementations.

That's an interesting idea though i think we'd still need a fair number
of new APIs. Only a handful of existing APIs have a 'flags' param where
we could request async operation, so even if we could keep the same
return type by using a suspension we still need extra args to indicate
sync vs async. 

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 




More information about the libvir-list mailing list