From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50886 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oy4Iz-0004Gi-QW for qemu-devel@nongnu.org; Tue, 21 Sep 2010 10:58:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oy4Ik-0001gh-UE for qemu-devel@nongnu.org; Tue, 21 Sep 2010 10:58:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27606) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oy4Ik-0001gR-Lb for qemu-devel@nongnu.org; Tue, 21 Sep 2010 10:58:34 -0400 Date: Tue, 21 Sep 2010 16:52:36 +0200 From: "Michael S. Tsirkin" Message-ID: <20100921145236.GA11337@redhat.com> References: <1284479215-24679-1-git-send-email-bernhard.kohl@nsn.com> <20100919160759.GB10730@redhat.com> <4C98BED0.2040406@nsn.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C98BED0.2040406@nsn.com> Subject: [Qemu-devel] Re: [PATCH] new parameter boot=on|off for "-net nic" and "-device" NIC devices List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bernhard Kohl Cc: "Ostler, Thomas (NSN - DE/Munich)" , qemu-devel@nongnu.org, ext Chris Krumme On Tue, Sep 21, 2010 at 04:18:56PM +0200, Bernhard Kohl wrote: > Am 19.09.2010 18:07, schrieb ext Michael S. Tsirkin: > >On Tue, Sep 14, 2010 at 05:46:55PM +0200, Bernhard Kohl wrote: > >>> This patch was motivated by the following use case: In our system > >>> the VMs usually have 4 NICs, any combination of virtio-net-pci and > >>> pci-assign NIC devices. The VMs boot via gPXE preferably over the > >>> pci-assign devices. > >>> > There is no way to make this working with a combination of > >>the > >>> current options -net -pcidevice -device -optionrom -boot. > >>> > With the parameter boot=off it is possible to avoid > >>loading > >>> and using gPXE option ROMs either for old style "-net nic" or > >>> for "-device" NIC devices. So we can select which NIC is used > >>> for booting. > >>> > A side effect of the boot=off parameter is that unneeded > >>ROMs > >>> which might waste memory are not longer loaded. E.g. if you have > >>> 2 virtio-net-pci and 2 pci-assign NICs in sum 4 option ROMs are > >>> loaded and the virtio ROMs take precedence over the pci-assign > >>> ROMs. The BIOS uses the first gPXE ROM which it finds and only > >>> needs one of them even if there are more NICs of the same type. > >>> > Without using the boot=on|off parameter the current > >>behaviour > >>> does not change. > >>> > Signed-off-by: Thomas Ostler > >>> Signed-off-by: Bernhard Kohl > >I think this is useful, however: > > > >- We have bit properties which handle parsing on/off > > and other formats automatically. Please don't use string. > >- boot is not a great property name for PCI: what > > you actually do is disable option rom. > > So maybe call it 'rom' or something like that? > Our main goal is to select a certain NIC's option rom for booting. > So the other roms are not needed and not loaded. We used 'boot' > as the property name as it is similar as in the '-drive' option to > select a certain disk for booting. What's about to call it 'bootrom'? Sounds good. > >- given you have added a property, it can now > > be changed with -device. and visible in -device ? > > This also has an advantage of only applying to pci devices > > (-net option would appear to apply to non-pci but have no effect). > > Please do not add more flag parsing in qdemu-options, net and vl.c > I think it is OK that we don't support this new feature for the old > style '-net' option and only implement it for qdev / -device? I think so, too. > >To summarize, just add a qdev bit option and check > >the bit. > > > In general, we will rework the patch and use all new qdev features. > There are also some memory leaks as Chris told us, because of the > usage of strdup. > > This rework might take 2 weeks because of vacation. > > Thanks > Bernhard Sounds good. -- MST