fix index creation for disks

* src/domain_conf.c src/util.c: fix index creation for disks >
  {sd,hd,xvd,vd}z (Sanjay Rao and Chris Wright)
Daniel
This commit is contained in:
Daniel Veillard 2008-10-10 08:37:35 +00:00
parent 02fc93d624
commit 3d038d101f
4 changed files with 10 additions and 4 deletions

View File

@ -51,6 +51,7 @@ Patches have also been contributed by:
Charles Duffy <Charles_Duffy@messageone.com>
Nguyen Anh Quynh <aquynh@gmail.com>
James Morris <jmorris@namei.org>
Chris Wrigh <chrisw@redhat.com>
[....send patches to get your name here....]

View File

@ -1,3 +1,8 @@
Fri Oct 10 10:33:29 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/domain_conf.c src/util.c: fix index creation for disks >
{sd,hd,xvd,vd}z (Sanjay Rao and Chris Wright)
Thu Oct 9 11:30:00 EST Cole Robinson <crobinso@redhat.com>
* src/domain_conf.c src/hash.c src/internal.h src/lxc_conf.c

View File

@ -3374,7 +3374,7 @@ char *virDomainConfigFile(virConnectPtr conn,
/* Translates a device name of the form (regex) "[fhv]d[a-z]+" into
* the corresponding bus,index combination (e.g. sda => (0,0), sdi (1,1),
* hdd => (1,1), vdaa => (0,27))
* hdd => (1,1), vdaa => (0,26))
* @param disk The disk device
* @param busIdx parsed bus number
* @param devIdx parsed device number

View File

@ -1036,7 +1036,7 @@ const char *virEnumToString(const char *const*types,
}
/* Translates a device name of the form (regex) "[fhv]d[a-z]+" into
* the corresponding index (e.g. sda => 1, hdz => 26, vdaa => 27)
* the corresponding index (e.g. sda => 0, hdz => 25, vdaa => 26)
* @param name The name of the device
* @return name's index, or -1 on failure
*/
@ -1056,8 +1056,8 @@ int virDiskNameToIndex(const char *name) {
if (!ptr)
return -1;
while (*ptr) {
idx = idx * 26;
for (i = 0; *ptr; i++) {
idx = (idx + i) * 26;
if (!c_islower(*ptr))
return -1;