Re: [PATCHv2 3/7] interface: implement public APIs for libvirt transactional network changes

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

 



On Tue, May 24, 2011 at 02:13:12PM +0800, Daniel Veillard wrote:
> On Thu, May 19, 2011 at 04:51:25PM -0400, Laine Stump wrote:
> > From: Michal Privoznik <mprivozn@xxxxxxxxxx>
> > 
> > ---
> >  src/libvirt.c |  141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 files changed, 139 insertions(+), 2 deletions(-)
> > 
> > diff --git a/src/libvirt.c b/src/libvirt.c
> > index ff16c48..786ce15 100644
> > --- a/src/libvirt.c
> > +++ b/src/libvirt.c
> > @@ -8143,7 +8143,9 @@ error:
> >   * @xml: the XML description for the interface, preferably in UTF-8
> >   * @flags: and OR'ed set of extraction flags, not used yet
> >   *
> > - * Define an interface (or modify existing interface configuration)
> > + * Define an interface (or modify existing interface configuration).
> > + * This can, however be affected by virInterfaceChangeBegin
> > + * and/or friends.
> 
>   Small nit, I would suggest making the 4 extra comments a bit more
>   explicit that it's about transaction support, something along the
>   lines of:
> 
>     * This can however be affected by the transaction support for
>     * interface configuration change, see virInterfaceChangeBegin(),
>     * virInterfaceChangeCommit() and related functions.
> 
> [...]
> > @@ -8374,6 +8382,135 @@ virInterfaceFree(virInterfacePtr iface)
> >      return 0;
> >  }
> >  
> > +/**
> > + * virInterfaceChangeBegin:
> > + * @conn: pointer to hypervisor connection
> > + * @flags: flags, not used yet
> > + *
> > + * This functions creates a restore point to which one can return
> > + * later by calling virInterfaceChangeRollback. This function should
> > + * be called before any transaction with interface configuration.
> > + * Once knowing, new configuration works, it can be commited via
> > + * virInterfaceChangeCommit, which frees restore point.
> 
>    which frees the restore point.
> 
> I would like the description of what happens ona  sequence of
>    virInterfaceChangeBegin()
>    virInterfaceChangeBegin()
> 
> calls for the same connection, is that an error ? Will netcf implement
> this, this behaviour should probably be documented.

It should return the VIR_ERR_INVALID_OPERATION code with
a message that a transaction is already active.

> > +/**
> > + * virInterfaceChangeCommit:
> > + * @conn: pointer to hypervisor connection
> > + * @flags: flags, not used yet
> > + *
> > + * This commits the changes made to interfaces and frees restore point
> 
>   "frees the restore point"
> 
> > + * created by virInterfaceChangeBegin.
> 
>   Same thing behaviour of virInterfaceChangeCommit() in case there was
>   no Begin() associated should be documented.

Likewise VIR_ERR_INVALID_OPERATION

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 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]