[Kimchi-devel] [PATCH v2 3/5] storagepool: rename and consolidate arguments of creating (front end)

Aline Manera alinefm at linux.vnet.ibm.com
Thu Dec 26 15:18:40 UTC 2013


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 12/22/2013 08:55 AM, Zhou Zheng Sheng wrote:
> As we are adding support to new type of storage pool, the current naming
> scheme of the storage pool creating arguments should be rearranged to be
> more extendable. This patch renames some arguments and consolidates the
> argument of the same purposes as follow.
>
> nfsserver -> source.host
> nfspath -> source.path
> devices -> source.devices
>
> This patch contains the front end changes of the consolidation work. It
> just changes the formData transferred to kimchi backend, and leaves the
> templates and other related scripts untouched.
> ---
>   ui/js/src/kimchi.storagepool_add_main.js | 13 ++++++++++---
>   1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
> index b31610a..a154933 100644
> --- a/ui/js/src/kimchi.storagepool_add_main.js
> +++ b/ui/js/src/kimchi.storagepool_add_main.js
> @@ -148,14 +148,21 @@ kimchi.addPool = function(event) {
>           if (poolType === 'dir') {
>               formData.path = $('#pathId').val();
>           } else if (poolType === 'logical') {
> +            var source = {};
>               if (!$.isArray(formData.devices)) {
>                   var deviceObj = [];
>                   deviceObj[0] =  formData.devices;
> -                formData.devices = deviceObj;
> +                source.devices = deviceObj;
> +            } else {
> +                source.devices = formData.devices;
>               }
> +            delete formData.devices;
> +            formData.source = source;
>           } else {
> -            formData.nfspath = $('#nfspathId').val();
> -            formData.nfsserver = $('#nfsserverId').val();
> +            var source = {};
> +            source.path = $('#nfspathId').val();
> +            source.host = $('#nfsserverId').val();
> +            formData.source = source;
>           }
>           if (poolType === 'logical') {
>               var settings = {




More information about the Kimchi-devel mailing list