From: Tom Lendacky Subject: QemuOpts changes breaks multiple nic options Date: Mon, 12 Oct 2009 17:05:03 -0500 Message-ID: <200910121705.03870.tahm@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from e36.co.us.ibm.com ([32.97.110.154]:37419 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933345AbZJLWFn (ORCPT ); Mon, 12 Oct 2009 18:05:43 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e36.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n9CM34bt009619 for ; Mon, 12 Oct 2009 16:03:04 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9CM55FE242544 for ; Mon, 12 Oct 2009 16:05:05 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9CM5555020061 for ; Mon, 12 Oct 2009 16:05:05 -0600 Sender: kvm-owner@vger.kernel.org List-ID: 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