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

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

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



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