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-users

RE: [Xen-users] disk devices are always /dev/xvdX

Fan, Huaxiang wrote:

We have some bash/python scripts hardcode /dev/sdb and /sys/block/sdb/size. udev rules can not change sysfs, right? Those scripts work on 2.6.18-xen domu, but when we migrate to 2.6.32.39 domu, it seems we are reluctant to adjust those codes.

Oops. It's always a good idea to set values like that once at the top of a script, if not in a separate config file. With bash it's fairly easy to do :

  config=/etc/default/myscript-settings
  [ -r "${config} ] && . "${config} || <report an error>

It's even more important to do this if you have several separate scripts that woudl share common settings.

Never hard code them throughout the code or you find it causes maintenance problems down the road. It doesn't need Xen to change device names under you - some recent changes have meant hd* devices changing to sd* devices for example.

--
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users