From: "Kasai Takanori" Subject: [PATCH] Fix change of CDROM for block-configure command Date: Tue, 19 Jun 2007 16:05:09 +0900 Message-ID: <2bf101c7b240$32c80990$dab2220a@VF03007L> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_2BEE_01C7B28B.9C06FB50" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. ------=_NextPart_000_2BEE_01C7B28B.9C06FB50 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit Hi All, We contributed the problem when CD-ROM was changed as follows. There was especially no comment though we confirmed the correction method. Therefore, the patch that corrects these problems is contributed. Signed-off-by: Takanori Kasai Best Regards, --- Takanori Kasai ----- Original Message ----- From: "Kasai Takanori" To: "xen-devel" Sent: Thursday, June 14, 2007 7:30 PM Subject: [Xen-devel] About change of CDROM > Hi All, > > We tested xm block-configure command. > Because when the domain image is made, we install it from multiple CDROM. > > The procedure of the installation is as follows. > 1) The HVM domain is started with the CDROM device. >  ・configuration file : >  disk = [ > 'file:/xen/test/install-test.img,hda,w','phy:/dev/cdrom,hdc:cdrom,r' ] >  boot="d" > 2) When the installation from CDROM of the first piece is completed, CDROM is > exchanged. > 3) The exchange of CD-ROM is set by the xm block-configure command. > # xm block-configure phy:/dev/cdrom hdc:cdrom r > 4) The installation from CDROM of the second piece is continued. > > However, there are two problems in this procedure. > 1) It takes time to recognize the exchange of CDROM. > 2) Even if the same device is specified, it is not recognized. > > We investigated these problems. > > 1) It takes time to recognize the exchange of CDROM. > > The problem that it takes time for recognition is to wait intentionally on the > qemu-dm side. > ・tools/ioemu/xenstore.c > 314 void xenstore_process_event(void *opaque) > 315 { > ... > 343 if (image[0]) { > 344 media_filename[hd_index] = strdup(image); > 345 xenstore_check_new_media_present(5000); << This > 346 } > > The processing recognized after it waits for five seconds is executed. > We think that this waiting is unnecessary after exchanges CDROM. > > Why do you wait for five seconds before CDROM recognizes it? > If it is unnecessary, we want to correct not to wait. > > 2) Even if the same device is specified, it is not recognized. > > Therefore, we allocated it in other devices once. > # xm block-configure phy:/dev/null hdc:cdrom r > # xm block-configure phy:/dev/cdrom hdc:cdrom r > > It is made not to recognize that the same device is specified in qemu-dm. > ・tools/ioemu/xenstore.c > 314 void xenstore_process_event(void *opaque) > 315 { > ... > 332 image = xs_read(xsh, XBT_NULL, vec[XS_WATCH_PATH], &len); > 333 if (image == NULL || !strcmp(image, bs_table[hd_index]->filename)) << > This > 334 goto out; /* gone or identical */ > > It doesn't operate because it becomes naturally the same name > when physics CDROM is allocated. > Even if the name is the same, the content might be not same. > Only when CDROM is exchanged, it is executed. > > When the same device is specified, should we check it? > We want to correct not to check it. > > > We have confirmed these problems are canceled by the appended patch. > > Best Regards, > > -- > Takanori Kasai > ------=_NextPart_000_2BEE_01C7B28B.9C06FB50 Content-Type: application/octet-stream; name="ioemu-nocheck-change.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ioemu-nocheck-change.patch" # HG changeset patch=0A= # User kasai.takanori@jp.fujitsu.com=0A= # Date 1182234223 -32400=0A= # Node ID 0ac9a762d013746efe81ccefeea7ed9e143bd3a8=0A= # Parent c82934987a257e49101b657c54fea0a27b7d25e5=0A= Do not check the same device=0A= =0A= Signed-off-by: Takanori Kasai =0A= =0A= diff -r c82934987a25 -r 0ac9a762d013 tools/ioemu/xenstore.c=0A= --- a/tools/ioemu/xenstore.c Tue Jun 19 15:19:24 2007 +0900=0A= +++ b/tools/ioemu/xenstore.c Tue Jun 19 15:23:43 2007 +0900=0A= @@ -330,7 +330,7 @@ void xenstore_process_event(void *opaque=0A= goto out;=0A= hd_index =3D vec[XS_WATCH_TOKEN][2] - 'a';=0A= image =3D xs_read(xsh, XBT_NULL, vec[XS_WATCH_PATH], &len);=0A= - if (image =3D=3D NULL || !strcmp(image, = bs_table[hd_index]->filename))=0A= + if (image =3D=3D NULL)=0A= goto out; /* gone or identical */=0A= =0A= do_eject(0, vec[XS_WATCH_TOKEN]);=0A= ------=_NextPart_000_2BEE_01C7B28B.9C06FB50 Content-Type: application/octet-stream; name="ioemu-nowait-change.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ioemu-nowait-change.patch" # HG changeset patch=0A= # User kasai.takanori@jp.fujitsu.com=0A= # Date 1182233964 -32400=0A= # Node ID c82934987a257e49101b657c54fea0a27b7d25e5=0A= # Parent c3f280acf41af0ca876002e6e501cd67e72b3725=0A= Do not wait by changing CDROM. =0A= =0A= Signed-off-by: Takanori Kasai =0A= =0A= diff -r c3f280acf41a -r c82934987a25 tools/ioemu/xenstore.c=0A= --- a/tools/ioemu/xenstore.c Mon Jun 18 16:59:06 2007 +0100=0A= +++ b/tools/ioemu/xenstore.c Tue Jun 19 15:19:24 2007 +0900=0A= @@ -342,7 +342,7 @@ void xenstore_process_event(void *opaque=0A= =0A= if (image[0]) {=0A= media_filename[hd_index] =3D strdup(image);=0A= - xenstore_check_new_media_present(5000);=0A= + xenstore_check_new_media_present(0);=0A= }=0A= =0A= out:=0A= ------=_NextPart_000_2BEE_01C7B28B.9C06FB50 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_NextPart_000_2BEE_01C7B28B.9C06FB50--