Skip to contentSkip to conversation

[email protected], [email protected], [email protected], [email protected]

DISCUSSION Lingfei Kong 4 participants 12 messages Apr 18, 2014 – Apr 24, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

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

Waiting for domain hvm-7.0-64-1 (domid 5) to die [pid 16670] Domain 5 has been destroyed.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw

Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: [email protected], [email protected], [email protected], [email protected]

Quoted 7 lines · Lingfei Kong

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?

Quoted 7 lines

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.

Quoted 7 lines

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?

Quoted 3 lines

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)

Quoted 61 lines

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
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw

Re: Is: Xen 4.4 and 'cpus="X-Y" command line parsing borked Was:Re: [email protected], [email protected], [email protected], [email protected]

Quoted 11 lines · Konrad Rzeszutek Wilk
Quoted 7 lines · Lingfei Kong

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

Quoted 9 lines
Quoted 9 lines

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):

Quoted 7 lines
Quoted 5 lines

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

Quoted 8 lines
Quoted 4 lines

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.

Quoted 54 lines
Quoted 53 lines

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

Quoted 8 lines
Quoted 7 lines

Waiting for domain hvm-7.0-64-1 (domid 5) to die [pid 16670] Domain 5 has been destroyed.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Thanks and Best Regards
Lingfei Kong

#4 lore raw
In reply to Lingfei Kong
Quoted 22 lines · Lingfei Kong

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

Quoted 7 lines
# 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

#5 lore raw
Quoted 31 lines · George Dunlap
Quoted 22 lines · Lingfei Kong

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

Quoted 7 lines
# 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
Quoted 7 lines

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

#6 lore raw
Quoted 34 lines · Lingfei Kong
Quoted 33 lines · George Dunlap
Quoted 22 lines · Lingfei Kong

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

Quoted 7 lines
# 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:

Quoted 6 lines
Quoted 4 lines
# 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

#7 lore raw
Quoted 52 lines · George Dunlap
Quoted 41 lines · Lingfei Kong
Quoted 40 lines · George Dunlap
Quoted 29 lines · Lingfei Kong

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

Quoted 7 lines
# 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:

Quoted 6 lines
Quoted 4 lines
# 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:

Quoted 6 lines
# 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

#8 lore raw
Quoted 1 line · Lingfei Kong

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.

Quoted 5 lines

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.

#9 lore raw
Quoted 5 lines · Ian Campbell
Quoted 1 line · Lingfei Kong

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.

Quoted 7 lines
Quoted 5 lines

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

#10 lore raw
Quoted 11 lines · George Dunlap
Quoted 10 lines · Ian Campbell
Quoted 1 line · Lingfei Kong

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.

Quoted 5 lines

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.

Quoted 7 lines
Quoted 2 lines

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.

Quoted 2 lines

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?

Quoted 6 lines

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

#11 lore raw
Quoted 12 lines · Ian Campbell
Quoted 11 lines · George Dunlap
Quoted 10 lines · Ian Campbell
Quoted 1 line · Lingfei Kong

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.

Quoted 5 lines

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.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

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".

Quoted 5 lines
Quoted 3 lines

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

#12 lore raw
Quoted 19 lines · George Dunlap
Quoted 18 lines · Ian Campbell
Quoted 17 lines · George Dunlap
Quoted 5 lines · Ian Campbell
Quoted 1 line · Lingfei Kong

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.

Quoted 7 lines
Quoted 5 lines

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.

Quoted 6 lines
Quoted 2 lines

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.