WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH]add bash completion to VCPUs-params param-key

To: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH]add bash completion to VCPUs-params param-key
From: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2010 11:59:20 +0800
Delivery-date: Mon, 19 Apr 2010 20:57:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Add bash completion to VCPUs-params param-key

Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>

diff -r ad754527bddd ocaml/xe-cli/bash-completion
--- a/ocaml/xe-cli/bash-completion      Fri Apr 16 11:44:32 2010 +0100
+++ b/ocaml/xe-cli/bash-completion      Tue Apr 20 07:56:32 2010 -0400
@@ -204,9 +204,12 @@ _xe()
                vmselectors=`${xe} help ${COMP_WORDS[1]} 2>/dev/null | grep 
"optional params" | grep "<vm-selectors>"`
                hostselectors=`${xe} help ${COMP_WORDS[1]} 2>/dev/null | grep 
"optional params" | grep "<host-selectors>"`
                isdeviceconfig=`echo "${param}" | grep "device-config:"`
+               isvcpusparams=`echo "${param}" | grep "VCPUs-params:"`
                if [ "${isdeviceconfig}" ]; then
                        IFS=" " type=$(for i in ${COMP_WORDS[@]:2}; do echo $i 
| grep "^type="; done | sed -e 's/^type=//' | tr [A-Z] [a-z])
                        extraargs=,$(IFS=";"; for i in `xe sm-list type=${type} 
params=configuration --minimal 2>/dev/null`; do echo device-config:$i | cut -d 
':' -f 1-2; done | sed -e 's/ //g' -e 's/$/=/')
+               elif [ "${isvcpusparams}" ]; then
+                       extraargs=,$(for i in weight cap mask; do echo 
"VCPUs-params:$i="; done)
                elif [ "${vmselectors}" ]; then
                   if [ "${param}" ] ; then
                      extraargs=",vm=,"$(params "vm-list" | sed 's/params=//g')

-- 
Regards
Yang Hongyang
diff -r ad754527bddd ocaml/xe-cli/bash-completion
--- a/ocaml/xe-cli/bash-completion      Fri Apr 16 11:44:32 2010 +0100
+++ b/ocaml/xe-cli/bash-completion      Tue Apr 20 07:56:32 2010 -0400
@@ -204,9 +204,12 @@ _xe()
                vmselectors=`${xe} help ${COMP_WORDS[1]} 2>/dev/null | grep 
"optional params" | grep "<vm-selectors>"`
                hostselectors=`${xe} help ${COMP_WORDS[1]} 2>/dev/null | grep 
"optional params" | grep "<host-selectors>"`
                isdeviceconfig=`echo "${param}" | grep "device-config:"`
+               isvcpusparams=`echo "${param}" | grep "VCPUs-params:"`
                if [ "${isdeviceconfig}" ]; then
                        IFS=" " type=$(for i in ${COMP_WORDS[@]:2}; do echo $i 
| grep "^type="; done | sed -e 's/^type=//' | tr [A-Z] [a-z])
                        extraargs=,$(IFS=";"; for i in `xe sm-list type=${type} 
params=configuration --minimal 2>/dev/null`; do echo device-config:$i | cut -d 
':' -f 1-2; done | sed -e 's/ //g' -e 's/$/=/')
+               elif [ "${isvcpusparams}" ]; then
+                       extraargs=,$(for i in weight cap mask; do echo 
"VCPUs-params:$i="; done)
                elif [ "${vmselectors}" ]; then
                   if [ "${param}" ] ; then
                      extraargs=",vm=,"$(params "vm-list" | sed 's/params=//g')
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>