Doron Shoham wrote:
> Add -f flag (force) when changing node parameters that are
> defined as ATTR_DEFERRED.
> 
> When using this flag, changing of ATTR_DEFERRED parameter
> while in active session can take place.
> The change itself will take effect only in the next session.
> A warning message is displayed.
> 
> Signed-off-by: Doron Shoham <[EMAIL PROTECTED]>

Thanks for doing this. Just some dumb coding style nits.


> diff --git a/usr/idbm.c b/usr/idbm.c
> index c77042a..35390b3 100644
> --- a/usr/idbm.c
> +++ b/usr/idbm.c
> @@ -593,10 +593,15 @@ static int idbm_verify_param(recinfo_t *info, char 
> *name, int is_active)
>               else if (info[i].can_modify == ATTR_DEFERRED) {
>                       if (is_active == 0)
>                               return 0;
> -                     else {
> +                     else if (is_active == 1) {
>                               log_error("Cannot modify %s. Please logout 
> before modifing it", name);
>                               return EINVAL;
>                       }
> +                     else if (is_active == 2) {

We follow the kernel style where the "else if"/"else" goes on the line 
with the closing bracket. So it would be

} else if


> +                             log_warning("Modify %s while in active session. 
>  \
> +                             \n\t  Changes will take effect only in the next 
> login", name);


Follow the coding style of the rest of the code for multiline prints.


> +                             return 0;
> +                     }
>               }
>               else if (info[i].can_modify == ATTR_IMMUTABLE) {
>                       log_error("Cannot modify %s. This value is immutable "
> diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
> index 847393d..a79c7e9 100644
> --- a/usr/iscsiadm.c
> +++ b/usr/iscsiadm.c
> @@ -85,9 +85,10 @@ static struct option const long_options[] =
>       {"show", no_argument, NULL, 'S'},
>       {"version", no_argument, NULL, 'V'},
>       {"help", no_argument, NULL, 'h'},
> +     {"force", no_argument, NULL, 'f'},

Need to update the man pages, iscsiadm --help and README for the new param.


>       {NULL, 0, NULL, 0},
>  };
> -static char *short_options = "RlVhm:p:P:T:H:I:U:k:L:d:r:n:v:o:sSt:u";
> +static char *short_options = "RlVhfm:p:P:T:H:I:U:k:L:d:r:n:v:o:sSt:u";
>  
>  static void usage(int status)
>  {
> @@ -1757,7 +1758,7 @@ static void catch_sigint( int signo ) {
>  }
>  
>  /* TODO: merge iter helpers and clean them up, so we can use them here */
> -static int exec_iface_op(idbm_t *db, int op, int do_show, int info_level,
> +static int exec_iface_op(idbm_t *db, int op, int do_show, int do_force, int 
> info_level,
>                        struct iface_rec *iface, char *name, char *value)
>  {
>       struct db_set_param set_param;
> @@ -1873,11 +1874,14 @@ delete_fail:
>               set_param.value = value;
>  
>               /* pass rec's iface because it has the db values */
> -             if (check_for_session_through_iface(rec))
> -                     set_param.connected = 1;
> -             else 
> +             if (check_for_session_through_iface(rec)) {
> +                     if (do_force == 1)
> +                             set_param.connected = 2;
> +                     else
> +                             set_param.connected = 1;
> +             } else 
>                       set_param.connected = 0;

Probably a enum would be nice, because what 1, 2 and 0 mean is not so nice.


> -
> +             

You added a new line with just spaces.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to