From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lingfei Kong Subject: Re: drjones@redhat.com, vkuznets@redhat.com, leiwang@redhat.com, wshi@redhat.com Date: Thu, 24 Apr 2014 08:14:27 +0800 Message-ID: <53585763.40105@redhat.com> References: <648058658.7316781.1397784467480.JavaMail.zimbra@redhat.com> <1914427839.7319088.1397785246986.JavaMail.zimbra@redhat.com> <53570FCF.9050708@redhat.com> <53579CDC.1050605@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53579CDC.1050605@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.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 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