* drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com [not found] <648058658.7316781.1397784467480.JavaMail.zimbra@redhat.com> @ 2014-04-18 1:40 ` Lingfei Kong 2014-04-21 13:02 ` Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: " Konrad Rzeszutek Wilk 2014-04-22 10:59 ` George Dunlap 0 siblings, 2 replies; 12+ messages in thread From: Lingfei Kong @ 2014-04-18 1:40 UTC (permalink / raw) To: xen-devel [-- Attachment #1: Type: text/plain, Size: 2746 bytes --] Hello, When i create a guest with option 'cpus="0-3"' on the command line, xl can not parse the config. But it works well when i specify 'cpus=1' on the command line. I read the man page xl.cfg, learned that xl support the following format: "0-3,5,^1" so it would be very nice if xl can support this format on the command line too. Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line The following are the details: Description of problem: option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line. Version-Release number of selected component (if applicable): How reproducible: 100% Steps to Reproduce: 1. Install a host with xen4 2. Create a guest, add option 'cpus="0-3"' on the command line # xl -v create hvm-7.0-64-1.cfg cpus="0-3" Parsing config from hvm-7.0-64-1.cfg hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error warning: Config file looks like it contains Python code. warning: Arbitrary Python is no longer supported. warning: See http://wiki.xen.org/wiki/PythonInXlConfig Failed to parse config: Invalid argument Actual results: Failed to create the guest Expected results: Guest can be created successfully. Additional info: # xl info host : hp-z220-02.qe.lab.eng.nay.redhat.com release : 3.11.10-301.fc20.x86_64 version : #1 SMP Thu Dec 5 14:01:17 UTC 2013 machine : x86_64 nr_cpus : 8 max_cpu_id : 7 nr_nodes : 1 cores_per_socket : 4 threads_per_core : 2 cpu_mhz : 3392 hw_caps : bfebfbff:28100800:00000000:00007f00:77bae3ff:00000000:00000001:00000281 virt_caps : hvm hvm_directio total_memory : 16258 free_memory : 10185 sharing_freed_memory : 0 sharing_used_memory : 0 outstanding_claims : 0 free_cpus : 0 xen_major : 4 xen_minor : 3 xen_extra : .2 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xffff800000000000 xen_changeset : xen_commandline : placeholder cc_compiler : gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) cc_compile_by : mockbuild cc_compile_domain : [unknown] cc_compile_date : Wed Mar 26 20:46:37 UTC 2014 xend_config_format : 4 The attachment is the log file /var/log/xen/xl-${DOMNAME}.log Best Regards Lingfei Kong [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: xl-hvm-7.0-64-1.log --] [-- Type: text/x-log; name=xl-hvm-7.0-64-1.log, Size: 90 bytes --] Waiting for domain hvm-7.0-64-1 (domid 5) to die [pid 16670] Domain 5 has been destroyed. [-- Attachment #3: Type: text/plain, Size: 126 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel ^ permalink raw reply [flat|nested] 12+ messages in thread
* Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-18 1:40 ` drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com Lingfei Kong @ 2014-04-21 13:02 ` Konrad Rzeszutek Wilk 2014-04-22 1:33 ` Lingfei Kong 2014-04-22 10:59 ` George Dunlap 1 sibling, 1 reply; 12+ messages in thread From: Konrad Rzeszutek Wilk @ 2014-04-21 13:02 UTC (permalink / raw) To: Lingfei Kong; +Cc: xen-devel On Thu, Apr 17, 2014 at 09:40:46PM -0400, Lingfei Kong wrote: > Hello, > When i create a guest with option 'cpus="0-3"' on the command line, xl can not parse the config. But it works well when i specify 'cpus=1' on the command line. I read the man page xl.cfg, learned that xl support the following format: > "0-3,5,^1" > so it would be very nice if xl can support this format on the command line too. > > Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line > On what bugzilla system? > > > The following are the details: > > Description of problem: > option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line. > > Version-Release number of selected component (if applicable): > > How reproducible: > 100% > > Steps to Reproduce: > 1. Install a host with xen4 How did you install that? Did you use the Xen RPMs? > 2. Create a guest, add option 'cpus="0-3"' on the command line > # xl -v create hvm-7.0-64-1.cfg cpus="0-3" > Parsing config from hvm-7.0-64-1.cfg Does it work if you have the 'cpus="0-3"' in the guest config file (from hvm-7.0-64-1.cfg) > hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error > warning: Config file looks like it contains Python code. > warning: Arbitrary Python is no longer supported. > warning: See http://wiki.xen.org/wiki/PythonInXlConfig > Failed to parse config: Invalid argument > > > Actual results: > Failed to create the guest > > Expected results: > Guest can be created successfully. > > Additional info: > # xl info > host : hp-z220-02.qe.lab.eng.nay.redhat.com > release : 3.11.10-301.fc20.x86_64 > version : #1 SMP Thu Dec 5 14:01:17 UTC 2013 > machine : x86_64 > nr_cpus : 8 > max_cpu_id : 7 > nr_nodes : 1 > cores_per_socket : 4 > threads_per_core : 2 > cpu_mhz : 3392 > hw_caps : bfebfbff:28100800:00000000:00007f00:77bae3ff:00000000:00000001:00000281 > virt_caps : hvm hvm_directio > total_memory : 16258 > free_memory : 10185 > sharing_freed_memory : 0 > sharing_used_memory : 0 > outstanding_claims : 0 > free_cpus : 0 > xen_major : 4 > xen_minor : 3 > xen_extra : .2 > xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 > xen_scheduler : credit > xen_pagesize : 4096 > platform_params : virt_start=0xffff800000000000 > xen_changeset : > xen_commandline : placeholder > cc_compiler : gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) > cc_compile_by : mockbuild > cc_compile_domain : [unknown] > cc_compile_date : Wed Mar 26 20:46:37 UTC 2014 > xend_config_format : 4 > > > The attachment is the log file /var/log/xen/xl-${DOMNAME}.log > > Best Regards > Lingfei Kong > Waiting for domain hvm-7.0-64-1 (domid 5) to die [pid 16670] > Domain 5 has been destroyed. > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-21 13:02 ` Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: " Konrad Rzeszutek Wilk @ 2014-04-22 1:33 ` Lingfei Kong 0 siblings, 0 replies; 12+ messages in thread From: Lingfei Kong @ 2014-04-22 1:33 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: xen-devel On 04/21/2014 09:02 PM, Konrad Rzeszutek Wilk wrote: > On Thu, Apr 17, 2014 at 09:40:46PM -0400, Lingfei Kong wrote: >> Hello, >> When i create a guest with option 'cpus="0-3"' on the command line, xl can not parse the config. But it works well when i specify 'cpus=1' on the command line. I read the man page xl.cfg, learned that xl support the following format: >> "0-3,5,^1" >> so it would be very nice if xl can support this format on the command line too. >> >> Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line >> > > On what bugzilla system? > I follow the steps descripted in xl command's man page. Here is the link of this bug: http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1886 >> >> >> The following are the details: >> >> Description of problem: >> option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line. >> >> Version-Release number of selected component (if applicable): >> >> How reproducible: >> 100% >> >> Steps to Reproduce: >> 1. Install a host with xen4 > > How did you install that? Did you use the Xen RPMs? Yes. Here are my steps 1. Install Fedora20 2. Install xen packages #yum -y install xen 3. Configure grub2.cfg, Set 'Fedora, with Xen hypervisor' as the default menuentry and reboot the host 4. Use option `cpus="0-3"` on the command line to create the guest > >> 2. Create a guest, add option 'cpus="0-3"' on the command line >> # xl -v create hvm-7.0-64-1.cfg cpus="0-3" >> Parsing config from hvm-7.0-64-1.cfg > > Does it work if you have the 'cpus="0-3"' in the guest config file > (from hvm-7.0-64-1.cfg) > When I specify it in t he guest config file, it works well. >> hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error >> warning: Config file looks like it contains Python code. >> warning: Arbitrary Python is no longer supported. >> warning: See http://wiki.xen.org/wiki/PythonInXlConfig >> Failed to parse config: Invalid argument >> >> >> Actual results: >> Failed to create the guest >> >> Expected results: >> Guest can be created successfully. >> >> Additional info: >> # xl info >> host : hp-z220-02.qe.lab.eng.nay.redhat.com >> release : 3.11.10-301.fc20.x86_64 >> version : #1 SMP Thu Dec 5 14:01:17 UTC 2013 >> machine : x86_64 >> nr_cpus : 8 >> max_cpu_id : 7 >> nr_nodes : 1 >> cores_per_socket : 4 >> threads_per_core : 2 >> cpu_mhz : 3392 >> hw_caps : bfebfbff:28100800:00000000:00007f00:77bae3ff:00000000:00000001:00000281 >> virt_caps : hvm hvm_directio >> total_memory : 16258 >> free_memory : 10185 >> sharing_freed_memory : 0 >> sharing_used_memory : 0 >> outstanding_claims : 0 >> free_cpus : 0 >> xen_major : 4 >> xen_minor : 3 >> xen_extra : .2 >> xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 >> xen_scheduler : credit >> xen_pagesize : 4096 >> platform_params : virt_start=0xffff800000000000 >> xen_changeset : >> xen_commandline : placeholder >> cc_compiler : gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7) >> cc_compile_by : mockbuild >> cc_compile_domain : [unknown] >> cc_compile_date : Wed Mar 26 20:46:37 UTC 2014 >> xend_config_format : 4 >> >> >> The attachment is the log file /var/log/xen/xl-${DOMNAME}.log >> >> Best Regards >> Lingfei Kong > >> Waiting for domain hvm-7.0-64-1 (domid 5) to die [pid 16670] >> Domain 5 has been destroyed. > >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel > Thanks and Best Regards Lingfei Kong ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-18 1:40 ` drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com Lingfei Kong 2014-04-21 13:02 ` Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: " Konrad Rzeszutek Wilk @ 2014-04-22 10:59 ` George Dunlap 2014-04-23 0:56 ` Lingfei Kong 1 sibling, 1 reply; 12+ messages in thread From: George Dunlap @ 2014-04-22 10:59 UTC (permalink / raw) To: Lingfei Kong; +Cc: xen-devel@lists.xen.org On Fri, Apr 18, 2014 at 2:40 AM, Lingfei Kong <lkong@redhat.com> wrote: > Hello, > When i create a guest with option 'cpus="0-3"' on the command line, xl can not parse the config. But it works well when i specify 'cpus=1' on the command line. I read the man page xl.cfg, learned that xl support the following format: > "0-3,5,^1" > so it would be very nice if xl can support this format on the command line too. > > Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line > > > > The following are the details: > > Description of problem: > option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line. > > Version-Release number of selected component (if applicable): > > How reproducible: > 100% > > Steps to Reproduce: > 1. Install a host with xen4 > 2. Create a guest, add option 'cpus="0-3"' on the command line > # xl -v create hvm-7.0-64-1.cfg cpus="0-3" > Parsing config from hvm-7.0-64-1.cfg > hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error > warning: Config file looks like it contains Python code. > warning: Arbitrary Python is no longer supported. > warning: See http://wiki.xen.org/wiki/PythonInXlConfig > Failed to parse config: Invalid argument The problem here is that your shell is discarding the quotes; so what xl sees is 'cpus=0-3', not 'cpus="0-3"'. Try the following: # xl -v create hvm-7.0-64-1.cfg cpus=\"0-3\" -George ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-22 10:59 ` George Dunlap @ 2014-04-23 0:56 ` Lingfei Kong 2014-04-23 10:58 ` George Dunlap 0 siblings, 1 reply; 12+ messages in thread From: Lingfei Kong @ 2014-04-23 0:56 UTC (permalink / raw) To: George Dunlap; +Cc: xen-devel@lists.xen.org On 04/22/2014 06:59 PM, George Dunlap wrote: > On Fri, Apr 18, 2014 at 2:40 AM, Lingfei Kong <lkong@redhat.com> wrote: >> Hello, >> When i create a guest with option 'cpus="0-3"' on the command line, xl can not parse the config. But it works well when i specify 'cpus=1' on the command line. I read the man page xl.cfg, learned that xl support the following format: >> "0-3,5,^1" >> so it would be very nice if xl can support this format on the command line too. >> >> Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line >> >> >> >> The following are the details: >> >> Description of problem: >> option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line. >> >> Version-Release number of selected component (if applicable): >> >> How reproducible: >> 100% >> >> Steps to Reproduce: >> 1. Install a host with xen4 >> 2. Create a guest, add option 'cpus="0-3"' on the command line >> # xl -v create hvm-7.0-64-1.cfg cpus="0-3" >> Parsing config from hvm-7.0-64-1.cfg >> hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error >> warning: Config file looks like it contains Python code. >> warning: Arbitrary Python is no longer supported. >> warning: See http://wiki.xen.org/wiki/PythonInXlConfig >> Failed to parse config: Invalid argument > > The problem here is that your shell is discarding the quotes; so what > xl sees is 'cpus=0-3', not 'cpus="0-3"'. Try the following: > > # xl -v create hvm-7.0-64-1.cfg cpus=\"0-3\" > > -George > Hi George, Thanks for your hlep. It works with cpus=\"0-3\". Lingfei Kong ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-23 0:56 ` Lingfei Kong @ 2014-04-23 10:58 ` George Dunlap 2014-04-24 0:14 ` Lingfei Kong 0 siblings, 1 reply; 12+ messages in thread From: George Dunlap @ 2014-04-23 10:58 UTC (permalink / raw) To: Lingfei Kong; +Cc: Ian Jackson, xen-devel@lists.xen.org On 04/23/2014 01:56 AM, Lingfei Kong wrote: > On 04/22/2014 06:59 PM, George Dunlap wrote: >> On Fri, Apr 18, 2014 at 2:40 AM, Lingfei Kong <lkong@redhat.com> wrote: >>> Hello, >>> When i create a guest with option 'cpus="0-3"' on the command line, xl can not parse the config. But it works well when i specify 'cpus=1' on the command line. I read the man page xl.cfg, learned that xl support the following format: >>> "0-3,5,^1" >>> so it would be very nice if xl can support this format on the command line too. >>> >>> Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line >>> >>> >>> >>> The following are the details: >>> >>> Description of problem: >>> option `cpus="0-3"` works well when you specify it in a configure file, but it give a error feadback when you add it to the command line. >>> >>> Version-Release number of selected component (if applicable): >>> >>> How reproducible: >>> 100% >>> >>> Steps to Reproduce: >>> 1. Install a host with xen4 >>> 2. Create a guest, add option 'cpus="0-3"' on the command line >>> # xl -v create hvm-7.0-64-1.cfg cpus="0-3" >>> Parsing config from hvm-7.0-64-1.cfg >>> hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error >>> warning: Config file looks like it contains Python code. >>> warning: Arbitrary Python is no longer supported. >>> warning: See http://wiki.xen.org/wiki/PythonInXlConfig >>> Failed to parse config: Invalid argument >> The problem here is that your shell is discarding the quotes; so what >> xl sees is 'cpus=0-3', not 'cpus="0-3"'. Try the following: >> >> # xl -v create hvm-7.0-64-1.cfg cpus=\"0-3\" >> >> -George >> > Hi George, > Thanks for your hlep. It works with cpus=\"0-3\". Actually, a better way would be to enclose the whole thing in single quotes, and separate variables with a ; like so: # xl -v create hvm.cfg 'cpus="0-3"; memory=2048' This should at very least be documented better -- I'll send a patch to update the xl man page. -George ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-23 10:58 ` George Dunlap @ 2014-04-24 0:14 ` Lingfei Kong 2014-04-24 8:44 ` Ian Campbell 0 siblings, 1 reply; 12+ messages in thread From: Lingfei Kong @ 2014-04-24 0:14 UTC (permalink / raw) To: George Dunlap; +Cc: Ian Jackson, xen-devel@lists.xen.org On 04/23/2014 06:58 PM, George Dunlap wrote: > On 04/23/2014 01:56 AM, Lingfei Kong wrote: >> On 04/22/2014 06:59 PM, George Dunlap wrote: >>> On Fri, Apr 18, 2014 at 2:40 AM, Lingfei Kong <lkong@redhat.com> wrote: >>>> Hello, >>>> When i create a guest with option 'cpus="0-3"' on the command line, >>>> xl can not parse the config. But it works well when i specify >>>> 'cpus=1' on the command line. I read the man page xl.cfg, learned >>>> that xl support the following format: >>>> "0-3,5,^1" >>>> so it would be very nice if xl can support this format on the >>>> command line too. >>>> >>>> Also i have file a bug on bugzilla: Bug 1886 - option `cpus="0-3"` >>>> works well when you specify it in a configure file, but it give a >>>> error feadback when you add it to the command line >>>> >>>> >>>> >>>> The following are the details: >>>> >>>> Description of problem: >>>> option `cpus="0-3"` works well when you specify it in a configure >>>> file, but it give a error feadback when you add it to the command line. >>>> >>>> Version-Release number of selected component (if applicable): >>>> >>>> How reproducible: >>>> 100% >>>> >>>> Steps to Reproduce: >>>> 1. Install a host with xen4 >>>> 2. Create a guest, add option 'cpus="0-3"' on the command line >>>> # xl -v create hvm-7.0-64-1.cfg cpus="0-3" >>>> Parsing config from hvm-7.0-64-1.cfg >>>> hvm-7.0-64-1.cfg:28: config parsing error near `-3': lexical error >>>> warning: Config file looks like it contains Python code. >>>> warning: Arbitrary Python is no longer supported. >>>> warning: See http://wiki.xen.org/wiki/PythonInXlConfig >>>> Failed to parse config: Invalid argument >>> The problem here is that your shell is discarding the quotes; so what >>> xl sees is 'cpus=0-3', not 'cpus="0-3"'. Try the following: >>> >>> # xl -v create hvm-7.0-64-1.cfg cpus=\"0-3\" >>> >>> -George >>> >> Hi George, >> Thanks for your hlep. It works with cpus=\"0-3\". > > Actually, a better way would be to enclose the whole thing in single > quotes, and separate variables with a ; like so: > > # xl -v create hvm.cfg 'cpus="0-3"; memory=2048' > > This should at very least be documented better -- I'll send a patch to > update the xl man page. > > -George Thanks for your explanation. Maybe another solution is to change the xl command to adapt this. On RHEL5 xen hypervisor, I can create a guest with `xm create hvm.cfg cpus="0-3"`. As a user I prefer this method, because this will be consistent with it's config file and it is strange to use ' to enclose the parameters. Best Regards Lingfei Kong ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-24 0:14 ` Lingfei Kong @ 2014-04-24 8:44 ` Ian Campbell 2014-04-24 9:01 ` George Dunlap 0 siblings, 1 reply; 12+ messages in thread From: Ian Campbell @ 2014-04-24 8:44 UTC (permalink / raw) To: Lingfei Kong; +Cc: George Dunlap, Ian Jackson, xen-devel@lists.xen.org On Thu, 2014-04-24 at 08:14 +0800, Lingfei Kong wrote: > Maybe another solution is to change the xl command to adapt this. Feel free to propose a patch but I suspect this would involve too much surgery to the config file parser. > On > RHEL5 xen hypervisor, I can create a guest with `xm create hvm.cfg > cpus="0-3"`. As a user I prefer this method, because this will be > consistent with it's config file and it is strange to use ' to enclose > the parameters. That is perfectly normal shell quoting behaviour, nothing strange about it IMHO. Ian. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-24 8:44 ` Ian Campbell @ 2014-04-24 9:01 ` George Dunlap 2014-04-24 9:32 ` Ian Campbell 0 siblings, 1 reply; 12+ messages in thread From: George Dunlap @ 2014-04-24 9:01 UTC (permalink / raw) To: Ian Campbell, Lingfei Kong; +Cc: Ian Jackson, xen-devel@lists.xen.org On 04/24/2014 09:44 AM, Ian Campbell wrote: > On Thu, 2014-04-24 at 08:14 +0800, Lingfei Kong wrote: >> Maybe another solution is to change the xl command to adapt this. > Feel free to propose a patch but I suspect this would involve too much > surgery to the config file parser. > >> On >> RHEL5 xen hypervisor, I can create a guest with `xm create hvm.cfg >> cpus="0-3"`. As a user I prefer this method, because this will be >> consistent with it's config file and it is strange to use ' to enclose >> the parameters. > That is perfectly normal shell quoting behaviour, nothing strange about > it IMHO. Well having the config file syntax include quotes and brackets is natural. The fact that the shell interprets quotes and brackets is also natural. But the combination of the two leads to a rather unexpected and clunky user interface. Unfortunately I'm not sure what we can really do at this point to maintain the general flexibility while avoiding backticks. We might be able to modify the parser for specific cases, such as the cpus one, to tolerate 'cpus=0-3' rather than the canonical 'cpus="0-3"'. But in the general case it would require re-writing the config format such that it can be written without requiring any characters treated specially by the shell; that's just a bit more work than it's really worth, I think. -George ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-24 9:01 ` George Dunlap @ 2014-04-24 9:32 ` Ian Campbell 2014-04-24 11:27 ` George Dunlap 0 siblings, 1 reply; 12+ messages in thread From: Ian Campbell @ 2014-04-24 9:32 UTC (permalink / raw) To: George Dunlap; +Cc: Lingfei Kong, Ian Jackson, xen-devel@lists.xen.org On Thu, 2014-04-24 at 10:01 +0100, George Dunlap wrote: > On 04/24/2014 09:44 AM, Ian Campbell wrote: > > On Thu, 2014-04-24 at 08:14 +0800, Lingfei Kong wrote: > >> Maybe another solution is to change the xl command to adapt this. > > Feel free to propose a patch but I suspect this would involve too much > > surgery to the config file parser. > > > >> On > >> RHEL5 xen hypervisor, I can create a guest with `xm create hvm.cfg > >> cpus="0-3"`. As a user I prefer this method, because this will be > >> consistent with it's config file and it is strange to use ' to enclose > >> the parameters. > > That is perfectly normal shell quoting behaviour, nothing strange about > > it IMHO. > > Well having the config file syntax include quotes and brackets is > natural. The fact that the shell interprets quotes and brackets is also > natural. But the combination of the two leads to a rather unexpected > and clunky user interface. This happens all the time though, "in find -exec foo \;" in sed and perl -e etc etc. It's just the way Unix shells work. > Unfortunately I'm not sure what we can really do at this point to > maintain the general flexibility while avoiding backticks. Hang on, how did we end up with backticks here? I think you just means normal quotes? > We might be > able to modify the parser for specific cases, such as the cpus one, to > tolerate 'cpus=0-3' rather than the canonical 'cpus="0-3"'. But in the > general case it would require re-writing the config format such that it > can be written without requiring any characters treated specially by the > shell; that's just a bit more work than it's really worth, I think. Yes, it isn't worth it IMHO either. Ian ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-24 9:32 ` Ian Campbell @ 2014-04-24 11:27 ` George Dunlap 2014-04-24 11:33 ` Ian Campbell 0 siblings, 1 reply; 12+ messages in thread From: George Dunlap @ 2014-04-24 11:27 UTC (permalink / raw) To: Ian Campbell; +Cc: Lingfei Kong, Ian Jackson, xen-devel@lists.xen.org On 04/24/2014 10:32 AM, Ian Campbell wrote: > On Thu, 2014-04-24 at 10:01 +0100, George Dunlap wrote: >> On 04/24/2014 09:44 AM, Ian Campbell wrote: >>> On Thu, 2014-04-24 at 08:14 +0800, Lingfei Kong wrote: >>>> Maybe another solution is to change the xl command to adapt this. >>> Feel free to propose a patch but I suspect this would involve too much >>> surgery to the config file parser. >>> >>>> On >>>> RHEL5 xen hypervisor, I can create a guest with `xm create hvm.cfg >>>> cpus="0-3"`. As a user I prefer this method, because this will be >>>> consistent with it's config file and it is strange to use ' to enclose >>>> the parameters. >>> That is perfectly normal shell quoting behaviour, nothing strange about >>> it IMHO. >> Well having the config file syntax include quotes and brackets is >> natural. The fact that the shell interprets quotes and brackets is also >> natural. But the combination of the two leads to a rather unexpected >> and clunky user interface. > This happens all the time though, "in find -exec foo \;" in sed and perl > -e etc etc. It's just the way Unix shells work. Maybe it would be more clear then, rather than saying "key=value pairs" in the man page, to say "a config file snippet"? That might put people in the mindset of thinking more like "perl -e". > >> Unfortunately I'm not sure what we can really do at this point to >> maintain the general flexibility while avoiding backticks. > Hang on, how did we end up with backticks here? I think you just means > normal quotes? Actually I have no idea where that came from... you get the main idea though -- escape sequences or single quotes. -George ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com 2014-04-24 11:27 ` George Dunlap @ 2014-04-24 11:33 ` Ian Campbell 0 siblings, 0 replies; 12+ messages in thread From: Ian Campbell @ 2014-04-24 11:33 UTC (permalink / raw) To: George Dunlap; +Cc: Lingfei Kong, Ian Jackson, xen-devel@lists.xen.org On Thu, 2014-04-24 at 12:27 +0100, George Dunlap wrote: > On 04/24/2014 10:32 AM, Ian Campbell wrote: > > On Thu, 2014-04-24 at 10:01 +0100, George Dunlap wrote: > >> On 04/24/2014 09:44 AM, Ian Campbell wrote: > >>> On Thu, 2014-04-24 at 08:14 +0800, Lingfei Kong wrote: > >>>> Maybe another solution is to change the xl command to adapt this. > >>> Feel free to propose a patch but I suspect this would involve too much > >>> surgery to the config file parser. > >>> > >>>> On > >>>> RHEL5 xen hypervisor, I can create a guest with `xm create hvm.cfg > >>>> cpus="0-3"`. As a user I prefer this method, because this will be > >>>> consistent with it's config file and it is strange to use ' to enclose > >>>> the parameters. > >>> That is perfectly normal shell quoting behaviour, nothing strange about > >>> it IMHO. > >> Well having the config file syntax include quotes and brackets is > >> natural. The fact that the shell interprets quotes and brackets is also > >> natural. But the combination of the two leads to a rather unexpected > >> and clunky user interface. > > This happens all the time though, "in find -exec foo \;" in sed and perl > > -e etc etc. It's just the way Unix shells work. > > Maybe it would be more clear then, rather than saying "key=value pairs" > in the man page, to say "a config file snippet"? That might put people > in the mindset of thinking more like "perl -e". I thought (having glanced really quickly yesterday as I filed it in my queue) that your proposed docs change looked pretty good. Ian. ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-04-24 11:33 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <648058658.7316781.1397784467480.JavaMail.zimbra@redhat.com> 2014-04-18 1:40 ` drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com Lingfei Kong 2014-04-21 13:02 ` Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: " Konrad Rzeszutek Wilk 2014-04-22 1:33 ` Lingfei Kong 2014-04-22 10:59 ` George Dunlap 2014-04-23 0:56 ` Lingfei Kong 2014-04-23 10:58 ` George Dunlap 2014-04-24 0:14 ` Lingfei Kong 2014-04-24 8:44 ` Ian Campbell 2014-04-24 9:01 ` George Dunlap 2014-04-24 9:32 ` Ian Campbell 2014-04-24 11:27 ` George Dunlap 2014-04-24 11:33 ` Ian Campbell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).