Skip to contentSkip to conversation

Issue Using netdev or vlan with qemu 15.

Qemu-devel srinivasan Sundararajan 2 participants 2 messages Nov 10, 2011 – Nov 11, 2011

lore
Share & tools
lore
#0 lore raw

Trying the following and can¹t seem to make it work ? This is with qemu-kvm 15 . What am I doing wrong here ? I get this id1 not found error.

qemu-system-x86_64 \
-enable-kvm -cpu qemu64,+vmx -boot c -m 16000M \
-drive file=my.disk,if=virtio \
-netdev user,id=id0 -device virtio-net-pci,netdev=id0,id=myid0 \
-netdev socket,listen=:12345,id=id1 -device virtio-net-pci,netdev=id1,id=myid1 \
-monitor telnet:127.0.0.1:65012,server,nowait,nodelay \
-nographic

qemu-system-x86_64: -device virtio-net-pci,netdev=id1,id=myid1: Property 'virtio-net-pci.netdev' can't find value 'id1'

If I modify the above to

qemu-system-x86_64 \
-enable-kvm -cpu qemu64,+vmx -boot c -m 16000M \
-drive file=my.disk,if=virtio \
-net nic,vlan=0,model=virtio -net user,vlan=0 \
-net nic,vlan=1,model=virtio -net socket,vlan=1,listen=:12345 \
-monitor telnet:127.0.0.1:65012,server,nowait,nodelay \
-nographic

Warning: vlan 1 is not connected to host network

Whats the correct syntax in both formats ?
Many thanks
Srini

#1 lore raw
Quoted 13 lines · srinivasan Sundararajan

Trying the following and can’t seem to make it work ?  This is with qemu-kvm 15 .  What am I doing wrong here ? I get this id1 not found error.

qemu-system-x86_64 \

(quoted diff) +0 -4
-enable-kvm  -cpu qemu64,+vmx -boot c -m 16000M \
-drive file=my.disk,if=virtio \
-netdev user,id=id0 -device virtio-net-pci,netdev=id0,id=myid0 \
-netdev socket,listen=:12345,id=id1 -device

virtio-net-pci,netdev=id1,id=myid1 \

(quoted diff) +0 -2
-monitor telnet:127.0.0.1:65012,server,nowait,nodelay \
-nographic
Quoted 2 lines

qemu-system-x86_64: -device virtio-net-pci,netdev=id1,id=myid1: Property 'virtio-net-pci.netdev' can't find value 'id1'

This is a bug in QEMU and is still present in the upcoming 1.0.

It is due to the way that socket listen is implemented. During the listen state where we wait to accept a client connection the -netdev has not yet been fully created. Therefore the virtio-net-pci initialization fails because it cannot find the id0 -netdev.

Patches will be required to fix this. I think net/socket.c needs an initial state where NetClientInfo .receive() does nothing because there is no client connected yet.

Stefan