WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Disk configuration problem

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Disk configuration problem
From: Naoki Takayama <takayama.naoki@xxxxxxxxxxxxxx>
Date: Tue, 14 Nov 2006 17:00:18 +0900
Delivery-date: Tue, 14 Nov 2006 00:01:06 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>