QemuOpts changes breaks multiple nic options
The recent change to QemuOpts for the -net nic option breaks specifying -net nic,... more than once. The net_init_nic function's return value in net.c is a table index, which is non-zero after the first time it is called. The qemu_opts_foreach function in qemu-option.c receives the non-zero return value and stops processing further -net options (like associated -net tap options). It looks like the usb net function makes use of the index value, so the fix might best be to have qemu_opts_foreach check for a return code < 0 as being an error?
Tom Lendacky
Hi Tom,
Quoted 8 lines · Tom Lendacky
The recent change to QemuOpts for the -net nic option breaks specifying -net nic,... more than once. The
net_init_nicfunction's return value innet.cis a table index, which is non-zero after the first time it is called. Theqemu_opts_foreachfunction inqemu-option.creceives the non-zero return value and stops processing further -net options (like associated -net tap options). It looks like the usb net function makes use of the index value, so the fix might best be to haveqemu_opts_foreachcheck for a return code < 0 as being an error?
Thanks for the report; I sent a patch to qemu-devel yesterday:
http://lists.gnu.org/archive/html/qemu-devel/2009-10/msg01070.html
Cheers,
Mark.