]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuOpenVhostNet: Decrease vhostfdSize on open failure
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 24 May 2013 12:45:06 +0000 (14:45 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 29 May 2013 07:20:04 +0000 (09:20 +0200)
commitd10cfaec3b4049dbe060ff55127fcfe46e91fa0b
treeabd794487f2b33bfe04871856164c8dad5f8aed2
parentf6817c70b430c1cfdbdc7795cf09626c1fa810d8
qemuOpenVhostNet: Decrease vhostfdSize on open failure

Currently, if there's an error opening /dev/vhost-net (e.g. because
it doesn't exist) but it's not required we proceed with vhostfd array
filled with -1 and vhostfdSize unchanged. Later, when constructing
the qemu command line only non-negative items within vhostfd array
are taken into account. This means, vhostfdSize may be greater than
the actual count of non-negative items in vhostfd array. This results
in improper command line arguments being generated, e.g.:

-netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=(null)
src/qemu/qemu_command.c