]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
interface: new public API for network config change transactions
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 5 May 2011 09:21:41 +0000 (11:21 +0200)
committerLaine Stump <laine@laine.org>
Fri, 27 May 2011 18:28:23 +0000 (14:28 -0400)
This is the API agreed on in:

  https://www.redhat.com/archives/libvir-list/2011-May/msg00026.html

(with a slight name change to use "...begin" rather than
"...start"). This implements transactional changes to the host network
config. When a transaction is begun with ncf_change_begin(), all other
netcf APIs will continue to work as they always have, but a snapshot
of the existing config will be taken, allowing reversion (rollback,
using ncf_change_rollback()) to the exact state of config at the time
ncf_change_begin() was called. Alternately, if it's determined that
the new changes are acceptable, ncf_change_commit() can be called,
which will eliminate the snapshot and make the changes permanent.

As a failsafe measure, if neither ncf_change_commit() or
ncf_change_rollback() is called by the next time the system reboots,
the netcf-transaction initscript will be automatically called to
rollback the changes.

include/libvirt/libvirt.h.in
src/libvirt_public.syms

index 212d8ec31672a6e397de606df03f796b3c4b0862..91dabfbacacd75a2977dfc2068b35e9897e960e0 100644 (file)
@@ -1424,6 +1424,13 @@ int                     virInterfaceDestroy       (virInterfacePtr iface,
 int                     virInterfaceRef           (virInterfacePtr iface);
 int                     virInterfaceFree          (virInterfacePtr iface);
 
+int                     virInterfaceChangeBegin   (virConnectPtr conn,
+                                                   unsigned int flags);
+int                     virInterfaceChangeCommit  (virConnectPtr conn,
+                                                   unsigned int flags);
+int                     virInterfaceChangeRollback(virConnectPtr conn,
+                                                   unsigned int flags);
+
 /**
  * virStoragePool:
  *
index cd23f6903ef5815a0052be30ca54bf6fd13c69d6..022db3c93e770478b93b54d583eaf6e6437653b8 100644 (file)
@@ -444,6 +444,9 @@ LIBVIRT_0.9.2 {
         virDomainSetSchedulerParametersFlags;
        virDomainMigrate2;
        virDomainMigrateToURI2;
+        virInterfaceChangeBegin;
+        virInterfaceChangeCommit;
+        virInterfaceChangeRollback;
 } LIBVIRT_0.9.0;
 
 # .... define new API here using predicted next version number ....