Received: from [140.186.70.92] (port=49309 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzGib-0007CZ-K6 for qemu-devel@nongnu.org; Mon, 14 Mar 2011 18:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzGia-0001fT-6w for qemu-devel@nongnu.org; Mon, 14 Mar 2011 18:58:29 -0400 Received: from adelie.canonical.com ([91.189.90.139]:42514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzGiZ-0001fJ-RZ for qemu-devel@nongnu.org; Mon, 14 Mar 2011 18:58:28 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PzGiX-0006rp-Tq for ; Mon, 14 Mar 2011 22:58:26 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id DE6A42E8033 for ; Mon, 14 Mar 2011 22:58:25 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Mon, 14 Mar 2011 22:46:49 -0000 From: "Venkateswararao Jujjuri \(JV\)" <648128@bugs.launchpad.net> Sender: bounces@canonical.com References: <20100926131925.32734.31908.malonedeb@soybean.canonical.com> Message-Id: <20110314224649.18623.29544.launchpad@soybean.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 648128] Re: VirtFS: Cannot mount 9p during boot Reply-To: Bug 648128 <648128@bugs.launchpad.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ** Changed in: qemu Status: In Progress =3D> Fix Committed -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/648128 Title: VirtFS: Cannot mount 9p during boot Status in QEMU: Fix Committed Bug description: I use as client Debian squeeze i386 with a custom kernel: Linux (none) 2.6.35.5 #3 Thu Sep 23 18:36:02 UTC 2010 i686 GNU/Linux And as host Debian squeeze amd64 Linux asd 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/L= inux kvm version is: kvm-88-5908-gdd67374 Started the client using: sudo /usr/local/kvm/bin/qemu-system-x86_64 -m 1024 -kernel linux-2.6.35.5= .qemu -drive file=3Droot.img,if=3Dvirtio -net nic,macaddr=3D02:ca:ff:ee:ba:= be,model=3Dvirtio,vlan=3D1 -net tap,ifname=3Dtap1,vlan=3D1,script=3Dno -vir= tfs local,path=3D/host,security_model=3Dpassthrough,mount_tag=3Dhost -nogra= phic I noticed that I cannot mount it (mapped or passthrough) using /etc/rc.local or /etc/fstab, but after login as root using mount /mnt or mount -t 9p -o trans=3Dvirtio host /mnt (the same stuff i tried inside /etc/rc.local) The only output on a failed mount in rc.local/fstab I get is [ 15.035920] device: '9p-1': device_add [ 15.038180] 9p: no channels available [ 15.038937] device: '9p-1': device_unregister [ 15.049123] device: '9p-1': device_create_release The stuff in /etc/fstab is: host /mnt 9p trans=3Dvirtio 0 0 I intercepted the boot by adding `set -v; set +e; mount -t 9p -o trans=3D= virtio host_share /mnt; /bin/sh` on top of my /etc/rc.local: ... but than it works quite well... well that is not what I expected. So = I changed it to `set -v; mount /mnt || true; /bin/sh`.. and then it doesn't= work anymore... mysterios but hey, did you notice that the share is actual= ly called host and not host_share as I wrote inside the rc.local. So why do= es it work at all? Let me change it to `set -v; set +e; mount -t 9p -o tran= s=3Dvirtio host /mnt; /bin/sh` and reboot again. What should i say: it says: [ 8.004754] device: '9p-1': device_add [ 8.006446] 9p: no channels available [ 8.007156] device: '9p-1': device_unregister [ 8.008650] device: '9p-1': device_create_release mount: No such file or directory But i have a shell now and can type the mount stuff inside it: $ mount -v -t 9p -o trans=3Dvirtio host /mnt mount -v -t 9p -o trans=3Dvirtio host /mnt [ 70.982688] device: '9p-2': device_add [ 70.986508] 9p: no channels available [ 70.987969] device: '9p-2': device_unregister [ 70.992937] device: '9p-2': device_create_release mount: No such file or directory $ ls -l /sys/bus/virtio/drivers/9pnet_virtio total 0 --w------- 1 root root 4096 Sep 26 12:58 bind --w------- 1 root root 4096 Sep 26 12:58 uevent --w------- 1 root root 4096 Sep 26 12:58 unbind lrwxrwxrwx 1 root root 0 Sep 26 12:58 virtio1 -> ../../../../devices/v= irtio-pci/virtio1 $ ls -l /sys/devices/virtio-pci/virtio1 total 0 lrwxrwxrwx 1 root root 0 Sep 26 13:00 bus -> ../../../bus/virtio -r--r--r-- 1 root root 4096 Sep 26 13:00 device lrwxrwxrwx 1 root root 0 Sep 26 13:00 driver -> ../../../bus/virtio/dr= ivers/9pnet_virtio -r--r--r-- 1 root root 4096 Sep 26 13:00 features -r--r--r-- 1 root root 4096 Sep 26 13:00 modalias -r--r--r-- 1 root root 4096 Sep 26 13:00 mount_tag drwxr-xr-x 2 root root 0 Sep 26 12:58 power -r--r--r-- 1 root root 4096 Sep 26 13:00 status lrwxrwxrwx 1 root root 0 Sep 26 13:00 subsystem -> ../../../bus/virtio -rw-r--r-- 1 root root 4096 Sep 26 13:00 uevent -r--r--r-- 1 root root 4096 Sep 26 13:00 vendor $ cat /sys/devices/virtio-pci/virtio1/mount_tag host$ mount -v -t 9p -o trans=3Dvirtio host /mnt [ 340.559853] device: '9p-3': device_add [ 340.563699] 9p: no channels available [ 340.565602] device: '9p-3': device_unregister [ 340.569201] device: '9p-3': device_create_release mount: No such file or director $ mount -v -t 9p -o trans=3Dvirtio hostA /mnt [ 406.218462] device: '9p-4': device_add hostA on /mnt type 9p (rw,trans=3Dvirtio) $ env CONSOLE=3D/dev/console HOME=3D/ runlevel=3D2 INIT_VERSION=3Dsysvinit-2.88 COLUMNS=3D80 TERM=3Dlinux PATH=3D/sbin:/usr/sbin:/bin:/usr/bin RUNLEVEL=3D2 PREVLEVEL=3DN SHELL=3D/bin/sh PWD=3D/ previous=3DN LINES=3D24 VERBOSE=3Dno $ id uid=3D0(root) gid=3D0(root) groups=3D0(root) $ hexdump asd 0000000 6f68 7473 0000 0000 0000 0000 0000 0000 0000010 0000 0000 = 0000014 I rebooted again and now just ctrl+d in my rc.local shell to get to my re= al root login with zsh: $ cat /sys/devices/virtio-pci/virtio1/mount_tag > asd $ hexdump asd 0000000 6f68 7473 0000 0000 0000 0000 0000 0000 0000010 0000 0000 = 0000014 $ id uid=3D0(root) gid=3D0(root) groups=3D0(root) $ env TERM=3Dlinux HOME=3D/root SHELL=3D/bin/zsh USER=3Droot LOGNAME=3Droot PATH=3D/host/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/s= bin:/bin MAIL=3D/var/mail/root HUSHLOGIN=3DFALSE SHLVL=3D1 PWD=3D/root OLDPWD=3D/root COLORTERM=3Dyes LINKS_XTERM=3Dscreen EDITOR=3Dvim PAGER=3Dless -r BROWSER=3Diceweasel LESS=3D-RIM LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36:mh=3D00:pi=3D40;33:so=3D01;35:do= =3D01;35:bd=3D40;33;01:cd=3D40;33;01:or=3D40;31;01:su=3D37;41:sg=3D30;43:ca= =3D30;41:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D01;32:*.tar=3D01;31:*.tgz=3D= 01;31:*.arj=3D01;31:*.taz=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D01;3= 1:*.txz=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.Z=3D01;31:*.dz=3D01;31:*.gz=3D0= 1;31:*.lz=3D01;31:*.xz=3D01;31:*.bz2=3D01;31:*.bz=3D01;31:*.tbz=3D01;31:*.t= bz2=3D01;31:*.tz=3D01;31:*.deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.rar=3D= 01;31:*.ace=3D01;31:*.zoo=3D01;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:= *.jpg=3D01;35:*.jpeg=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=3D01;35:*.pg= m=3D01;35:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.tif=3D0= 1;35:*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svgz=3D01;35:*.mng=3D01;3= 5:*.pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.mpeg=3D01;35:*.m2v=3D01;35:*.= mkv=3D01;35:*.ogm=3D01;35:*.mp4=3D01;35:*.m4v=3D01;35:*.mp4v=3D01;35:*.vob= =3D01;35:*.qt=3D01;35:*.nuv=3D01;35:*.wmv=3D01;35:*.asf=3D01;35:*.rm=3D01;3= 5:*.rmvb=3D01;35:*.flc=3D01;35:*.avi=3D01;35:*.fli=3D01;35:*.flv=3D01;35:*.= gl=3D01;35:*.dl=3D01;35:*.xcf=3D01;35:*.xwd=3D01;35:*.yuv=3D01;35:*.cgm=3D0= 1;35:*.emf=3D01;35:*.axv=3D01;35:*.anx=3D01;35:*.ogv=3D01;35:*.ogx=3D01;35:= *.aac=3D00;36:*.au=3D00;36:*.flac=3D00;36:*.mid=3D00;36:*.midi=3D00;36:*.mk= a=3D00;36:*.mp3=3D00;36:*.mpc=3D00;36:*.ogg=3D00;36:*.ra=3D00;36:*.wav=3D00= ;36:*.axa=3D00;36:*.oga=3D00;36:*.spx=3D00;36:*.xspf=3D00;36: HISTFILE=3D/root/.zsh_history HISTSIZE=3D10000 SAVEHIST=3D10000 _=3D/usr/bin/env $ mount -v -t 9p -o trans=3Dvirtio host /mnt [ 224.087952] device: '9p-2': device_add host on /mnt type 9p (rw,trans=3Dvirtio) So the next step was to change my login shell to /bin/sh (dash) and reboo= t: $ id uid=3D0(root) gid=3D0(root) groups=3D0(root) $ env USER=3Droot MAIL=3D/var/mail/root OLDPWD=3D/root HOME=3D/root HUSHLOGIN=3DFALSE PS1=3D\h:\w\$ = LOGNAME=3Droot TERM=3Dlinux PATH=3D/host/usr/bin:/host/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sb= in:/usr/bin:/sbin:/bin SHELL=3D/bin/sh PWD=3D/host $ mount -v -t 9p -o trans=3Dvirtio host /mnt [ 15.330643] device: '9p-2': device_add host on /mnt type 9p (rw,trans=3Dvirtio) Next step was to boot up, change my env and then use the correct mount: $ for i in USER MAIL OLDPWD HOME HUSHLOGIN PS1 LOGNAME TERM PATH SHELL PW= D; do unset $i; done $ env $ /bin/mount -v -t 9p -o trans=3Dvirtio host /mnt [ 431.742839] device: '9p-2': device_add host on /mnt type 9p (rw,trans=3Dvirtio)