[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



Hi Simon,
Thanks for your teaching! I totally agree with all your points. They are kind 
of legacy codes. We might put effort to review those codes if we can't rename 
xvdb back to sdb elegantly.
Thanks,
Huaxiang

-----Original Message-----
From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
[mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Simon Hobson
Sent: Thursday, May 12, 2011 3:11 PM
To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: 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
<br>To report this as spam, please forward to spam@xxxxxxxxxxxxx  Thank you.

Protected by Websense Email Security Gateway - www.websense.com


 Protected by Websense Hosted Email Security -- www.websense.com 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.