summary refs log tree commit diff stats
path: root/results/classifier/zero-shot/105/graphic/648128
blob: 8867537842c7c62e39c392dc5748eeffe48ea36b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
graphic: 0.960
other: 0.960
instruction: 0.959
semantic: 0.949
assembly: 0.948
socket: 0.945
mistranslation: 0.944
device: 0.942
boot: 0.941
network: 0.929
vnc: 0.926
KVM: 0.891

VirtFS: Cannot mount 9p during boot

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/Linux

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=root.img,if=virtio -net nic,macaddr=02:ca:ff:ee:ba:be,model=virtio,vlan=1 -net tap,ifname=tap1,vlan=1,script=no -virtfs local,path=/host,security_model=passthrough,mount_tag=host -nographic

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=virtio 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=virtio 0 0



I intercepted the boot by adding `set -v; set +e; mount -t 9p -o trans=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 actually called host and not host_share as I wrote inside the rc.local. So why does it work at all? Let me change it to `set -v; set +e; mount -t 9p -o trans=virtio 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=virtio host /mnt
mount -v -t 9p -o trans=virtio 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/virtio-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/drivers/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=virtio 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=virtio hostA /mnt
[  406.218462] device: '9p-4': device_add
hostA on /mnt type 9p (rw,trans=virtio)
$ env
CONSOLE=/dev/console
HOME=/
runlevel=2
INIT_VERSION=sysvinit-2.88
COLUMNS=80
TERM=linux
PATH=/sbin:/usr/sbin:/bin:/usr/bin
RUNLEVEL=2
PREVLEVEL=N
SHELL=/bin/sh
PWD=/
previous=N
LINES=24
VERBOSE=no
$ id
uid=0(root) gid=0(root) groups=0(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 real 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=0(root) gid=0(root) groups=0(root)
$ env
TERM=linux
HOME=/root
SHELL=/bin/zsh
USER=root
LOGNAME=root
PATH=/host/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAIL=/var/mail/root
HUSHLOGIN=FALSE
SHLVL=1
PWD=/root
OLDPWD=/root
COLORTERM=yes
LINKS_XTERM=screen
EDITOR=vim
PAGER=less -r
BROWSER=iceweasel
LESS=-RIM
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
HISTFILE=/root/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
_=/usr/bin/env
$ mount  -v -t 9p -o trans=virtio host /mnt
[  224.087952] device: '9p-2': device_add
host on /mnt type 9p (rw,trans=virtio)

So the next step was to change my login shell to /bin/sh (dash) and reboot:
$ id
uid=0(root) gid=0(root) groups=0(root)
$ env
USER=root
MAIL=/var/mail/root
OLDPWD=/root
HOME=/root
HUSHLOGIN=FALSE
PS1=\h:\w\$ 
LOGNAME=root
TERM=linux
PATH=/host/usr/bin:/host/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SHELL=/bin/sh
PWD=/host
$ mount  -v -t 9p -o trans=virtio host /mnt
[   15.330643] device: '9p-2': device_add
host on /mnt type 9p (rw,trans=virtio)

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 PWD; do unset $i; done
$ env
$ /bin/mount  -v -t 9p -o trans=virtio host /mnt
[  431.742839] device: '9p-2': device_add
host on /mnt type 9p (rw,trans=virtio)

Next steps were to use the old envs:

$ for i in USER MAIL OLDPWD HOME HUSHLOGIN PS1 LOGNAME TERM PATH SHELL PWD; do unset $i; done
$ export CONSOLE=/dev/console
$ export HOME=/
$ export runlevel=2
$ export INIT_VERSION=sysvinit-2.88
$ export COLUMNS=80
$ export TERM=linux
$ export PATH=/sbin:/usr/sbin:/bin:/usr/bin
$ export RUNLEVEL=2
$ export PREVLEVEL=N
$ export SHELL=/bin/sh
$ export PWD=/
$ export previous=N
$ export LINES=24
$ export VERBOSE=no
$ /bin/sh
$ env
CONSOLE=/dev/console
HOME=/
runlevel=2
INIT_VERSION=sysvinit-2.88
COLUMNS=80
TERM=linux
PATH=/sbin:/usr/sbin:/bin:/usr/bin
RUNLEVEL=2
PREVLEVEL=N
SHELL=/bin/sh
PWD=/host
previous=N
LINES=24
VERBOSE=no
$ mount -v -t 9p -o trans=virtio host /mnt
[   44.554805] device: '9p-2': device_add
host on /mnt type 9p (rw,trans=virtio)

Next step was to strace on rc.local sh:
/bin/sh: can't access tty; job control turned off
$ strace -o /mount1 mount -v -t 9p -o trans=virtio host /mnt
[  131.002908] device: '9p-2': device_add
[  131.006914] 9p: no channels available
[  131.009720] device: '9p-2': device_unregister
[  131.013135] device: '9p-2': device_create_release
mount: No such file or directory

And then inside the normal root shell
$ strace -o /mount2 mount -v -t 9p -o trans=virtio host /mnt

Important information: There exists a folder /host in the guest filesystem

So it is a problem that pwd inside the root shell is / and thus it finds /host and informs the kernel that it should mount /host using 9p to /mnt (which is of course bogus). I am quite unsure how to work around that problem without a stupid hack in rc.local instead of /etc/fstab

So there is still the problem that it mounts host_share even if that does not exists

Fixed for me by http://article.gmane.org/gmane.linux.utilities.util-linux-ng/3500/raw and http://article.gmane.org/gmane.linux.kernel/1041020/raw

If I've got the previous comments right, this was not a QEMU bug, but a bug in "mount" and the guest kernel ... so closing this QEMU ticket here now.