mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-22 22:13:18 +00:00
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:
parent
02fc93d624
commit
3d038d101f
1
AUTHORS
1
AUTHORS
@ -51,6 +51,7 @@ Patches have also been contributed by:
|
|||||||
Charles Duffy <Charles_Duffy@messageone.com>
|
Charles Duffy <Charles_Duffy@messageone.com>
|
||||||
Nguyen Anh Quynh <aquynh@gmail.com>
|
Nguyen Anh Quynh <aquynh@gmail.com>
|
||||||
James Morris <jmorris@namei.org>
|
James Morris <jmorris@namei.org>
|
||||||
|
Chris Wrigh <chrisw@redhat.com>
|
||||||
|
|
||||||
|
|
||||||
[....send patches to get your name here....]
|
[....send patches to get your name here....]
|
||||||
|
@ -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>
|
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
|
* src/domain_conf.c src/hash.c src/internal.h src/lxc_conf.c
|
||||||
|
@ -3374,7 +3374,7 @@ char *virDomainConfigFile(virConnectPtr conn,
|
|||||||
|
|
||||||
/* Translates a device name of the form (regex) "[fhv]d[a-z]+" into
|
/* 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),
|
* 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 disk The disk device
|
||||||
* @param busIdx parsed bus number
|
* @param busIdx parsed bus number
|
||||||
* @param devIdx parsed device number
|
* @param devIdx parsed device number
|
||||||
|
@ -1036,7 +1036,7 @@ const char *virEnumToString(const char *const*types,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Translates a device name of the form (regex) "[fhv]d[a-z]+" into
|
/* 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
|
* @param name The name of the device
|
||||||
* @return name's index, or -1 on failure
|
* @return name's index, or -1 on failure
|
||||||
*/
|
*/
|
||||||
@ -1056,8 +1056,8 @@ int virDiskNameToIndex(const char *name) {
|
|||||||
if (!ptr)
|
if (!ptr)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
while (*ptr) {
|
for (i = 0; *ptr; i++) {
|
||||||
idx = idx * 26;
|
idx = (idx + i) * 26;
|
||||||
|
|
||||||
if (!c_islower(*ptr))
|
if (!c_islower(*ptr))
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user