[CentOS-virt] get xen name from guest

Brett Worth brett at worth.id.au
Wed Mar 10 08:07:10 UTC 2010


On 03/10/2010 05:53 PM, Mr. X wrote:

> the Xen xm .PY config has an 
> extra = 'console=ttyS0  xxyyzz=HOSTNAME'

That's brilliant!

So if the parameter was "myname" then you could do:

hostname `cat /proc/cmdline  | tr ' ' '\n' | awk -F= ' $1 == "myname" { print $2 } '  `

Brett


More information about the CentOS-virt mailing list