Parcourir la source

[3587] Added warnings to the CfgMgr::revert and SrvConfig::copy functions.

Marcin Siodelski il y a 10 ans
Parent
commit
3c5e189ef8
2 fichiers modifiés avec 13 ajouts et 0 suppressions
  1. 5 0
      src/lib/dhcpsrv/cfgmgr.h
  2. 8 0
      src/lib/dhcpsrv/srv_config.h

+ 5 - 0
src/lib/dhcpsrv/cfgmgr.h

@@ -331,6 +331,11 @@ public:
     /// @warning Revert operation will rollback any changes to the staging
     /// configuration (if it exists).
     ///
+    /// @warning This function requires that the entire previous configuration
+    /// is copied to the new configuration object. This is not working for
+    /// some of the complex configuration objects, e.g. subnets. Hence, the
+    /// "revert" operation is not really usable at this point.
+    ///
     /// @param index A distance from the current configuration to the
     /// past configuration to be reverted. The minimal value is 1 which points
     /// to the nearest configuration.

+ 8 - 0
src/lib/dhcpsrv/srv_config.h

@@ -209,6 +209,14 @@ public:
     /// an object passed as parameter. The configuration sequence is not
     /// copied.
     ///
+    /// @warning Some of the configuration objects are not copied at
+    /// this point, e.g. subnets. This is because they contain quite complex
+    /// data structures and they make use of pointers, so in many cases
+    /// the default copy constructors can't be used. Implementing this
+    /// requires quite a lot of time so this is left as is for now.
+    /// The lack of ability to copy the entire configuration makes
+    /// revert function of the @c CfgMgr unsuable.
+    ///
     /// @param [out] new_config An object to which the configuration will
     /// be copied.
     void copy(SrvConfig& new_config) const;