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

[Xen-devel] Disk configuration problem



Hi All.

My name is Naoki Takayama, work for FUJITSU.

I found following disk configuration problem.
When I specify 'file:yy.img,hde,w' in domain config file as below,
the vnc connection demands to input the password.

  disk = [ 'file:xx.img,ioemu:hda,w','file:yy.img,hde,w' ]

If I change the 'hde' to 'hdf', this problem does not occur.


This problem is caused by xenstore_parse_domain_config function 
in tools/ioemu/xenstore.c 

in line 102: hd_index variable is assigned value 4.

in line 123: bs_table array is accsessed by the index(4).
(the vncpasswd variable is overwritten)

Here, bs_table is defined as "BlockDriverState *bs_table[MAX_DISKS]" in vl.c
and MAX_DISKS is defined as value 4 in vl.h

Does anyone have a suggetion how to fix this problem?


tools/ioemu/xenstore.c 

 55 void xenstore_parse_domain_config(int domid)
 56 {
 57     char **e = NULL;
 58     char *buf = NULL, *path;
 59     char *bpath = NULL, *dev = NULL, *params = NULL, *type = NULL;
 60     int i;
 61     unsigned int len, num, hd_index;
[snip]
102         hd_index = dev[2] - 'a';               <== assign value 4.
103         if (hd_index > MAX_DISKS)
104             continue;
105         /* read the type of the device */
106         if (pasprintf(&buf, "%s/device/vbd/%s/device-type", path, e[i]) == 
-1)
107             continue;
108         free(type);
109         type = xs_read(xsh, XBT_NULL, buf, &len);
110         /* read params to get the patch of the image -- read it last
111          * so that we have its path in buf when setting up the
112          * watch */
113         if (pasprintf(&buf, "%s/params", bpath) == -1)
114             continue;
115         free(params);
116         params = xs_read(xsh, XBT_NULL, buf, &len);
117         if (params == NULL)
118             continue;
119         if (params[0]) {
120             hd_filename[hd_index] = params;     /* strdup() */
121             params = NULL;              /* don't free params on re-use */
122         }
123         bs_table[hd_index] = bdrv_new(dev);    <== overwrite occur
[snip]

--
Naoki Takayama


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


 


Rackspace

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