diff --git a/AUTHORS b/AUTHORS index 8680d5668c..b7c065f5a9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -51,6 +51,7 @@ Patches have also been contributed by: Charles Duffy Nguyen Anh Quynh James Morris + Chris Wrigh [....send patches to get your name here....] diff --git a/ChangeLog b/ChangeLog index 4e75c0572f..845dee4548 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 10 10:33:29 CEST 2008 Daniel Veillard + + * 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 * src/domain_conf.c src/hash.c src/internal.h src/lxc_conf.c diff --git a/src/domain_conf.c b/src/domain_conf.c index e8d248f55e..cbad43c59d 100644 --- a/src/domain_conf.c +++ b/src/domain_conf.c @@ -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 diff --git a/src/util.c b/src/util.c index ebe86b2c81..915e738a53 100644 --- a/src/util.c +++ b/src/util.c @@ -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;