Kasai Takanori
2006-Dec-26 12:01 UTC
[Xen-devel] [PATCH] fix free of event channel in blkfront
Hi All, We tested the xm block-attach/detach command. It repeats block-attach/detach command for DomU and pv-on-hvm on HVM Domain. (block-attach -> block-detach -> block-attach -> block-detach -> ...) The block-attach command failed when repeating 256 times. It is because the channel had not been freed in blkfront. Therefore, it remain using the event channel. This patch is corrected to free the event channel in blkfront. Thanks -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Steven Hand
2006-Dec-29 17:54 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
>We tested the xm block-attach/detach command. >It repeats block-attach/detach command for DomU and pv-on-hvm on HVM Domain. >(block-attach -> block-detach -> block-attach -> block-detach -> ...) > >The block-attach command failed when repeating 256 times.I can''t reproduce this - just tested 500 or so attach/detach pairs in a tight loop and worked for me. However I was using a regular domU - is it pv-on-hvm only? Can you give a more detailed repro case (or a script)? cheers, S. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Jan-09 00:33 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi Steven,>>We tested the xm block-attach/detach command. >>It repeats block-attach/detach command for DomU and pv-on-hvm on HVM Domain. >>(block-attach -> block-detach -> block-attach -> block-detach -> ...) >> >>The block-attach command failed when repeating 256 times. > > I can''t reproduce this - just tested 500 or so attach/detach pairs in > a tight loop and worked for me. However I was using a regular domU - > is it pv-on-hvm only? Can you give a more detailed repro case (or a > script)?We tested only pv-on-hvm. The script used when testing is appended. We will confirm it again with latest xen-unstable.hg. Thanks, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Jan-09 06:18 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi Steven,>>>We tested the xm block-attach/detach command. >>>It repeats block-attach/detach command for DomU and pv-on-hvm on HVM Domain. >>>(block-attach -> block-detach -> block-attach -> block-detach -> ...) >>> >>>The block-attach command failed when repeating 256 times. >> >> I can''t reproduce this - just tested 500 or so attach/detach pairs in >> a tight loop and worked for me. However I was using a regular domU - >> is it pv-on-hvm only? Can you give a more detailed repro case (or a >> script)? > > We tested only pv-on-hvm. > The script used when testing is appended.Sorry, the appended script was for network. It tested in the following scripts. ------------------------------------------------- #!/bin/sh DomainID=25 DevID=8448 Count=0 while : do echo "##### block-attach ##### $Count" xm block-attach $DomainID phy:/dev/sdc1 hde w sleep 1 xm block-list $DomainID sleep 1 echo "##### block-detach #####" xm block-detach $DomainID $DevID Count=`expr $Count + 1` #DevID=`expr $DevID + 1` sleep 1 xm block-list $DomainID sleep 1 done exit 0 -------------------------------------------------> We will confirm it again with latest xen-unstable.hg.I confirmed it with up-to-date xen-unstable.hg. (cs 13282) It did not reproduce it in DomU. Because VBD was not able to be used, pv-on-hvm was not able to confirm it. The following errors occur. # insmod xen-vbd.ko xen-vbd: Unknown symbol irq_to_evtchn_port insmod: error inserting ''xen-vbd.ko'': -1 Unknown symbol in module When reproducing it with pv-on-hvm, evtchn had not been liberated as follows. # xm block-attach <DomID> file:/test.img hde w # xm block-list <DomID> Vdev BE handle state evt-ch ring-ref BE-path 2049 0 0 4 6 8 /local/domain/0/backend/vbd/6/2049 8448 0 0 4 7 306 /local/domain/0/backend/vbd/6/8448 # xm block-detach <DomID> 8448 # xm block-list <DomID> Vdev BE handle state evt-ch ring-ref BE-path 2049 0 0 4 6 8 /local/domain/0/backend/vbd/6/2049 # xm block-attach <DomID> file:/test.img hde w # xm block-list <DomID> Vdev BE handle state evt-ch ring-ref BE-path 2049 0 0 4 6 8 /local/domain/0/backend/vbd/6/2049 8448 0 0 4 8 306 /local/domain/0/backend/vbd/6/8448 ^^^<= not 7 If the evtchn number is liberated, it is sure to become the same number. The evtchn number keeps increase if it repeats. I will confirm whether to be liberated as follows and correctly. ・xen-unstable.hg : cs 13192 Revert cset 13181:f087c013cf12 since the event channel is already unbound via blkif_free() -> unbind_from_irqhandler() -> unbind_from_irq() Thanks, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Jan-09 10:48 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi Steven,>>>>We tested the xm block-attach/detach command. >>>>It repeats block-attach/detach command for DomU and pv-on-hvm on HVM Domain. >>>>(block-attach -> block-detach -> block-attach -> block-detach -> ...) >>>> >>>>The block-attach command failed when repeating 256 times. >>> >>> I can''t reproduce this - just tested 500 or so attach/detach pairs in >>> a tight loop and worked for me. However I was using a regular domU - >>> is it pv-on-hvm only? Can you give a more detailed repro case (or a >>> script)?It already seems to have been corrected. ・xen-unstable.hg : cs 13198 [PV-ON-HVM] Update evtchn interface to match new PV Linux interfaces. ---------------------------------------------------------------------------------------------------- --- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Sat Dec 30 18:23:27 2006 +0000 +++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Sun Dec 31 11:59:47 2006 +0000 @@ -118,8 +144,12 @@ void unbind_from_irqhandler(unsigned int mask_evtchn(evtchn); evtchns[evtchn].handler = NULL; + + if (evtchns[evtchn].close) { + struct evtchn_close close = { .port = evtchn }; + HYPERVISOR_event_channel_op(EVTCHNOP_close, &close); + } } - EXPORT_SYMBOL(unbind_from_irqhandler); void notify_remote_via_irq(int irq) ---------------------------------------------------------------------------------------------------- However, the following problems remain. I think that it operates if the following problems can be solved. It is necessary to correct pv-on-hvm according to the following corrections. ・xen-unstable.hg : cs 13197 [LINUX] Extend the event-channel interfaces to provide helper methods> I confirmed it with up-to-date xen-unstable.hg. (cs 13282) > > It did not reproduce it in DomU. > Because VBD was not able to be used, pv-on-hvm was not able to confirm it. > The following errors occur. > > # insmod xen-vbd.ko > xen-vbd: Unknown symbol irq_to_evtchn_port > insmod: error inserting ''xen-vbd.ko'': -1 Unknown symbol in moduleThanks, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hi I am using the xen-3.0.3 on paravirtualVM and I try to use xm block-attach dom6 /vm1/tp.img sda2 w It seems to be ok, no error , but in the dom6 there is no sda2 and xm block-detach dom6 2050,it does not work and xm block-list dom6 as follows , [root@= dev]# xm block-list dom6 Vdev BE handle state evt-ch ring-ref BE-path 2049 0 0 4 7 8 /local/domain/0/backend/vbd/127/2049 2050 0 0 3 8 665 /local/domain/0/backend/vbd/127/2050 I am confused about the function of these commands and how to use these commands correctly could you give me a help Thanks in advance Kasai Takanori 写道:> Hi Steven, > >>>> We tested the xm block-attach/detach command. >>>> It repeats block-attach/detach command for DomU and pv-on-hvm on >>>> HVM Domain. >>>> (block-attach -> block-detach -> block-attach -> block-detach -> ...) >>>> >>>> The block-attach command failed when repeating 256 times. >>> >>> I can''t reproduce this - just tested 500 or so attach/detach pairs in >>> a tight loop and worked for me. However I was using a regular domU - >>> is it pv-on-hvm only? Can you give a more detailed repro case (or a >>> script)? >> >> We tested only pv-on-hvm. >> The script used when testing is appended. > > Sorry, the appended script was for network. > It tested in the following scripts. > > ------------------------------------------------- > #!/bin/sh > DomainID=25 > DevID=8448 > Count=0 > > while : > do > echo "##### block-attach ##### $Count" > xm block-attach $DomainID phy:/dev/sdc1 hde w > sleep 1 > xm block-list $DomainID > sleep 1 > echo "##### block-detach #####" > xm block-detach $DomainID $DevID > Count=`expr $Count + 1` > #DevID=`expr $DevID + 1` > sleep 1 > xm block-list $DomainID > sleep 1 > done > exit 0 > ------------------------------------------------- > > >> We will confirm it again with latest xen-unstable.hg. > > I confirmed it with up-to-date xen-unstable.hg. (cs 13282) > > It did not reproduce it in DomU. > Because VBD was not able to be used, pv-on-hvm was not able to confirm > it. > The following errors occur. > > # insmod xen-vbd.ko > xen-vbd: Unknown symbol irq_to_evtchn_port > insmod: error inserting ''xen-vbd.ko'': -1 Unknown symbol in module > > > When reproducing it with pv-on-hvm, evtchn had not been liberated as > follows. > > # xm block-attach <DomID> file:/test.img hde w > # xm block-list <DomID> > Vdev BE handle state evt-ch ring-ref BE-path > 2049 0 0 4 6 8 /local/domain/0/backend/vbd/6/2049 > 8448 0 0 4 7 306 /local/domain/0/backend/vbd/6/8448 > # xm block-detach <DomID> 8448 > # xm block-list <DomID> > Vdev BE handle state evt-ch ring-ref BE-path > 2049 0 0 4 6 8 /local/domain/0/backend/vbd/6/2049 > # xm block-attach <DomID> file:/test.img hde w > # xm block-list <DomID> > Vdev BE handle state evt-ch ring-ref BE-path > 2049 0 0 4 6 8 /local/domain/0/backend/vbd/6/2049 > 8448 0 0 4 8 306 /local/domain/0/backend/vbd/6/8448 > ^^^<= not 7 > > If the evtchn number is liberated, it is sure to become the same number. > The evtchn number keeps increase if it repeats. > I will confirm whether to be liberated as follows and correctly. > > ・xen-unstable.hg : cs 13192 > Revert cset 13181:f087c013cf12 since the event channel is already > unbound via > blkif_free() -> unbind_from_irqhandler() -> unbind_from_irq() > > > Thanks, > > -- > Takanori Kasai > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Feb-01 04:22 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi> I am using the xen-3.0.3 on paravirtualVM > and I try to use xm block-attach dom6 /vm1/tp.img sda2 w > It seems to be ok, no error , > but in the dom6 there is no sda2 > and xm block-detach dom6 2050,it does not work > and xm block-list dom6 as follows ,The block-attach command seems to have failed because your use is wrong. # xm block-attach dom6 /vm1/tp.img sda2 w ^^^^^^^^^^^ When backend device is a file, it is necessary to specify file. Moreover, when it is a physical device, it is necessary to specify phy. The example is as follows. # xm block-attach dom6 file:/vm1/tp.img sda2 w # xm block-attach dom6 phy:/dev/sdb sda2 w The block-detach command works correctly, if the block-attach command succeeds. Best Regards, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for reply I try to do it under your guide as follows # xm block-attach dom6 file:/vm1/template/tp.img sdb2 w [root@genode012 vmcserver]# xm block-list dom1 Vdev BE handle state evt-ch ring-ref BE-path 2049 0 0 4 7 8 /local/domain/0/backend/vbd/102/2049 2050 0 0 4 8 815 /local/domain/0/backend/vbd/102/2050 and xm block-detach can work but xm console dom1, then there is not the new disk in dom1 what is wrong with it? that is the log in /var/log/xen/xend.log as follows: [2007-02-01 14:08:47 xend 6460] DEBUG (DevController:110) DevController: writing {''backend-id'': ''0'', ''virtual-device'': ''2050'''' , ''device-type'': ''disk'', ''state'': ''1'', ''backend'': ''/local/domain/0/backend/vbd/102/2050''} to /local/domain/102/device/vbd/2055 0. [2007-02-01 14:08:47 xend 6460] DEBUG (DevController:112) DevController: writing {''domain'': ''dom1'', ''frontend'': ''/local/domaii n/102/device/vbd/2050'', ''dev'': ''sda2'', ''state'': ''1'', ''params'': ''/vm1/template/tp1.img'', ''mode'': ''w'', ''online'': ''1'', ''frontendd -id'': ''102'', ''type'': ''file''} to /local/domain/0/backend/vbd/102/2050. [2007-02-01 14:08:47 xend 6460] DEBUG (DevController:149) Waiting for 2050. [2007-02-01 14:08:47 xend 6460] DEBUG (DevController:464) hotplugStatusCallback /local/domain/0/backend/vbd/102/2050/hotplug-- status. [2007-02-01 14:08:47 xend 6460] DEBUG (DevController:464) hotplugStatusCallback /local/domain/0/backend/vbd/102/2050/hotplug-- status. [2007-02-01 14:08:47 xend 6460] DEBUG (DevController:478) hotplugStatusCallback 1. could you give me help Thanks in advance Kasai Takanori 写道:> Hi > >> I am using the xen-3.0.3 on paravirtualVM >> and I try to use xm block-attach dom6 /vm1/tp.img sda2 w >> It seems to be ok, no error , >> but in the dom6 there is no sda2 >> and xm block-detach dom6 2050,it does not work >> and xm block-list dom6 as follows , > > The block-attach command seems to have failed because your use is wrong. > # xm block-attach dom6 /vm1/tp.img sda2 w > ^^^^^^^^^^^ > When backend device is a file, it is necessary to specify file. > Moreover, when it is a physical device, it is necessary to specify phy. > > The example is as follows. > # xm block-attach dom6 file:/vm1/tp.img sda2 w > # xm block-attach dom6 phy:/dev/sdb sda2 w > > The block-detach command works correctly, if the block-attach command > succeeds. > > Best Regards, > > -- > Takanori Kasai > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Feb-01 09:03 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi> I try to do it under your guide as follows > # xm block-attach dom6 file:/vm1/template/tp.img sdb2 w > [root@genode012 vmcserver]# xm block-list dom1 > Vdev BE handle state evt-ch ring-ref BE-path > 2049 0 0 4 7 8 /local/domain/0/backend/vbd/102/2049 > 2050 0 0 4 8 815 /local/domain/0/backend/vbd/102/2050 > > and xm block-detach can work > but xm console dom1, then there is not the new disk in dom1 > what is wrong with it?Perhaps, it seems that xm block-attach/detach can work. Does the specified file have the partition? (/vm1/template/tp.img) Please attach to sdb if there is a partition. dom0# xm block-attach dom6 file:/vm1/template/tp.img sdb w It is recognized with dom1 as follows.(3 partitions) dom1# cat /proc/diskstats 8 16 sdb 78 353 927 632 8 1 18 4 0 360 636 8 17 sdb1 173 346 9 18 8 18 sdb2 185 185 0 0 8 19 sdb3 47 188 0 0 dom1# mount /dev/sdb3 /mnt dom1# ls /mnt bin dev home lost+found misc net proc sbin srv tmp var boot etc lib media mnt opt root selinux sys usr However, if SCSI driver can work on dom1, it is not possible to attach to sdx. It is because VBD overlaps with SCSI driver''s majors number. In that case, please attach to xvda. dom0# xm block-attach dom6 file:/vm1/template/tp.img xvda w Best Regards, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for reply I boot the VM with a img file and the conf file is as follows kernel = "/boot/vmlinuz-2.6.16-xenU" memory = 256 name = "dom3" vcpus = 1 vif = [ '''' ] disk = [ ''file:/vm/dom3.img,sda1,w'' ] netmask = "255.255.0.0" gateway = "192.168.150.1" hostname = "office2" ip = "192.168.104.5" root = "/dev/sda1 ro" extra = "4" and if I want to attach another img file to the VM ,then the VM boot img must have many partitions such as sda ,sda1, sda2 when the img file is made and xm block-attach file:/vm1/template/another.img sda1 w then in the VM ,mount the sda1,and access it I am not for sure whether I understand your mean or do you mean that the another img file with I want to attach to the VM needs have many partitions? could you make me clear about it Thank you in advance Kasai Takanori 写道:> Hi > >> I try to do it under your guide as follows >> # xm block-attach dom6 file:/vm1/template/tp.img sdb2 w >> [root@genode012 vmcserver]# xm block-list dom1 >> Vdev BE handle state evt-ch ring-ref BE-path >> 2049 0 0 4 7 8 /local/domain/0/backend/vbd/102/2049 >> 2050 0 0 4 8 815 /local/domain/0/backend/vbd/102/2050 >> >> and xm block-detach can work >> but xm console dom1, then there is not the new disk in dom1 >> what is wrong with it? > > Perhaps, it seems that xm block-attach/detach can work. Does the > specified file have the partition? (/vm1/template/tp.img) > > Please attach to sdb if there is a partition. > dom0# xm block-attach dom6 file:/vm1/template/tp.img sdb w > > It is recognized with dom1 as follows.(3 partitions) > dom1# cat /proc/diskstats > 8 16 sdb 78 353 927 632 8 1 18 4 0 360 636 > 8 17 sdb1 173 346 9 18 > 8 18 sdb2 185 185 0 0 > 8 19 sdb3 47 188 0 0 > dom1# mount /dev/sdb3 /mnt > dom1# ls /mnt > bin dev home lost+found misc net proc sbin srv tmp var > boot etc lib media mnt opt root selinux sys usr > > However, if SCSI driver can work on dom1, it is not possible to attach > to sdx. > It is because VBD overlaps with SCSI driver''s majors number. In that > case, please attach to xvda. > dom0# xm block-attach dom6 file:/vm1/template/tp.img xvda w > > Best Regards, > > -- > Takanori Kasai > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Feb-02 00:18 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi,> I boot the VM with a img file and the conf file is as follows > ... > disk = [ ''file:/vm/dom3.img,sda1,w'' ] > > and if I want to attach another img file to the VM ,then > the VM boot img must have many partitions such as sda ,sda1, sda2 when > the img file is made and > xm block-attach file:/vm1/template/another.img sda1 w > then in the VM ,mount the sda1,and access it > I am not for sure whether I understand your mean > or do you mean that the another img file with I want to attach to the VM > needs have many partitions?The boot image when starting has already been allocated to sda1. (BackDev: file:/vm/dom3.img) Therefore, it is not possible to attach to sda1 by block-attach command. Please do not overlap with FrontEnd device that has already been used. It is recognized as follows if there is a partition in the attached file. # xm block-attach file:/vm1/template/another.img sdb w another.img file (BackDev) | GuestOS(FrontDev) ------------------------------------------------------- 3 partitions(1,2,3) | sdb, sdb1, sdb2, sdb3 1 partitions(1) | sdb, sdb1 ※ 1 -> sdb1, 2 -> sdb2, 3->sdb3 It is possible to recognized as follows if there is no partition in attached file. # xm block-attach file:/vm1/template/another.img sdb1 w Best Regards, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for your detail reply Now I boot the VM with the conf file ... disk = [ ''file:/vm/dom3.img,sda1,w'' ] ... and then commit the commands as follows [root@genode012 vmcserver]# xm block-attach dom3 file:/vm1/template/tp1.img sda2 w [root@genode012 vmcserver]# xm block-list dom3 Vdev BE handle state evt-ch ring-ref BE-path 2049 0 0 4 6 8 /local/domain/0/backend/vbd/107/2049 2050 0 0 4 8 534 /local/domain/0/backend/vbd/107/2050 [root@genode012 vmcserver]# xm console dom3 [root@office2 ~]# cat /proc/diskstats 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 1 1 ram1 0 0 0 0 0 0 0 0 0 0 0 1 2 ram2 0 0 0 0 0 0 0 0 0 0 0 1 3 ram3 0 0 0 0 0 0 0 0 0 0 0 1 4 ram4 0 0 0 0 0 0 0 0 0 0 0 1 5 ram5 0 0 0 0 0 0 0 0 0 0 0 1 6 ram6 0 0 0 0 0 0 0 0 0 0 0 1 7 ram7 0 0 0 0 0 0 0 0 0 0 0 1 8 ram8 0 0 0 0 0 0 0 0 0 0 0 1 9 ram9 0 0 0 0 0 0 0 0 0 0 0 1 10 ram10 0 0 0 0 0 0 0 0 0 0 0 1 11 ram11 0 0 0 0 0 0 0 0 0 0 0 1 12 ram12 0 0 0 0 0 0 0 0 0 0 0 1 13 ram13 0 0 0 0 0 0 0 0 0 0 0 1 14 ram14 0 0 0 0 0 0 0 0 0 0 0 1 15 ram15 0 0 0 0 0 0 0 0 0 0 0 8 1 sda1 1837 184 60546 3330 1034 1155 17512 16510 0 2290 19840 9 0 md0 0 0 0 0 0 0 0 0 0 0 0 8 2 sda2 0 0 0 0 0 0 0 0 0 0 0 [root@office2 ~]# df -h Filesystem 瀹归噺 宸茬敤 鍙敤 宸茬敤% 鎸傝浇鐐? /dev/sda1 5.8G 4.0G 1.5G 73% / none 128M 0 128M 0% /dev/shm [root@office2 ~]# what do I do wrong? How should I make it ? I am really confused with it Kasai Takanori 写道:> Hi, > > >> I boot the VM with a img file and the conf file is as follows >> ... >> disk = [ ''file:/vm/dom3.img,sda1,w'' ] >> >> and if I want to attach another img file to the VM ,then >> the VM boot img must have many partitions such as sda ,sda1, sda2 when >> the img file is made and >> xm block-attach file:/vm1/template/another.img sda1 w >> then in the VM ,mount the sda1,and access it >> I am not for sure whether I understand your mean >> or do you mean that the another img file with I want to attach to the VM >> needs have many partitions? > > The boot image when starting has already been allocated to sda1. > (BackDev: file:/vm/dom3.img) > Therefore, it is not possible to attach to sda1 by block-attach command. > Please do not overlap with FrontEnd device that has already been used. > > It is recognized as follows if there is a partition in the attached file. > # xm block-attach file:/vm1/template/another.img sdb w > > another.img file (BackDev) | GuestOS(FrontDev) > ------------------------------------------------------- > 3 partitions(1,2,3) | sdb, sdb1, sdb2, sdb3 > 1 partitions(1) | sdb, sdb1 > ※ 1 -> sdb1, 2 -> sdb2, 3->sdb3 > > It is possible to recognized as follows if there is no partition in > attached file. > # xm block-attach file:/vm1/template/another.img sdb1 w > > Best Regards, > > -- > Takanori Kasai > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kasai Takanori
2007-Feb-02 03:39 UTC
Re: [Xen-devel] [PATCH] fix free of event channel in blkfront
Hi,> Now I boot the VM with the conf file > ... > disk = [ ''file:/vm/dom3.img,sda1,w'' ] > ... > and then commit the commands as follows > > [root@genode012 vmcserver]# xm block-attach dom3 file:/vm1/template/tp1.img > sda2 w > [root@genode012 vmcserver]# xm block-list dom3 > Vdev BE handle state evt-ch ring-ref BE-path > 2049 0 0 4 6 8 /local/domain/0/backend/vbd/107/2049 > 2050 0 0 4 8 534 /local/domain/0/backend/vbd/107/2050 > [root@genode012 vmcserver]# xm console dom3 > > [root@office2 ~]# cat /proc/diskstats > ... > > 8 2 sda2 0 0 0 0 0 0 0 0 0 0 0The block-attach command seems to have succeeded. It can be confirmed that sda2 is attached. It can confirm the content if the mount is done. # mount /dev/sda2 /mnt # ls /mnt> [root@office2 ~]# df -h > Filesystem /dev/sda1 5.8G 4.0G 1.5G 73% / > none 128M 0 128M 0% /dev/shm > > what do I do wrong? How should I make it ? > I am really confused with itIf the mount is done, it comes to see it. If it is recognized when starting, the block-attach command should not be used. Then, it is necessary to define two disks by configuration file. When starting, automatic mount will be able to be done if it set to /etc/fstab as well as Native Linux. Best Regards, -- Takanori Kasai _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Thank you for your patient and detail guide It works as you said there is something wrong with the img file which I want to attach to the VM Now it works well Thanks again Kasai Takanori 写道:> Hi, > >> Now I boot the VM with the conf file >> ... >> disk = [ ''file:/vm/dom3.img,sda1,w'' ] >> ... >> and then commit the commands as follows >> >> [root@genode012 vmcserver]# xm block-attach dom3 >> file:/vm1/template/tp1.img sda2 w >> [root@genode012 vmcserver]# xm block-list dom3 >> Vdev BE handle state evt-ch ring-ref BE-path >> 2049 0 0 4 6 8 /local/domain/0/backend/vbd/107/2049 >> 2050 0 0 4 8 534 /local/domain/0/backend/vbd/107/2050 >> [root@genode012 vmcserver]# xm console dom3 >> >> [root@office2 ~]# cat /proc/diskstats >> ... >> >> 8 2 sda2 0 0 0 0 0 0 0 0 0 0 0 > > The block-attach command seems to have succeeded. > It can be confirmed that sda2 is attached. > > It can confirm the content if the mount is done. > # mount /dev/sda2 /mnt > # ls /mnt > > >> [root@office2 ~]# df -h >> Filesystem /dev/sda1 5.8G 4.0G 1.5G 73% / >> none 128M 0 128M 0% /dev/shm >> >> what do I do wrong? How should I make it ? >> I am really confused with it > > If the mount is done, it comes to see it. > If it is recognized when starting, the block-attach command should not > be used. > Then, it is necessary to define two disks by configuration file. > When starting, automatic mount will be able to be done if it set to > /etc/fstab > as well as Native Linux. > > Best Regards, > > -- > Takanori Kasai > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
hi I try to understand the code relative to blk-attach it seems like that device_creat()->createdevice()->addStoreEntries() ,add store entry into xenstore then backend and frontend will watch and do several related work to real add-device in backend and frontend ,is it right? and xenstore have watches to check the related entry ,is it right? I am confused ,which code or function to the real adding work I guess there is somekind watches which do it ,but I cannot find that fucntions I am confused about it could you help me Thanks in advance Kasai Takanori 写道:> Hi, > >> Now I boot the VM with the conf file >> ... >> disk = [ ''file:/vm/dom3.img,sda1,w'' ] >> ... >> and then commit the commands as follows >> >> [root@genode012 vmcserver]# xm block-attach dom3 >> file:/vm1/template/tp1.img sda2 w >> [root@genode012 vmcserver]# xm block-list dom3 >> Vdev BE handle state evt-ch ring-ref BE-path >> 2049 0 0 4 6 8 /local/domain/0/backend/vbd/107/2049 >> 2050 0 0 4 8 534 /local/domain/0/backend/vbd/107/2050 >> [root@genode012 vmcserver]# xm console dom3 >> >> [root@office2 ~]# cat /proc/diskstats >> ... >> >> 8 2 sda2 0 0 0 0 0 0 0 0 0 0 0 > > The block-attach command seems to have succeeded. > It can be confirmed that sda2 is attached. > > It can confirm the content if the mount is done. > # mount /dev/sda2 /mnt > # ls /mnt > > >> [root@office2 ~]# df -h >> Filesystem /dev/sda1 5.8G 4.0G 1.5G 73% / >> none 128M 0 128M 0% /dev/shm >> >> what do I do wrong? How should I make it ? >> I am really confused with it > > If the mount is done, it comes to see it. > If it is recognized when starting, the block-attach command should not > be used. > Then, it is necessary to define two disks by configuration file. > When starting, automatic mount will be able to be done if it set to > /etc/fstab > as well as Native Linux. > > Best Regards, > > -- > Takanori Kasai > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel