From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvmOi-0004T5-Hp for qemu-devel@nongnu.org; Thu, 08 Oct 2009 02:22:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvmOd-0004Qc-JJ for qemu-devel@nongnu.org; Thu, 08 Oct 2009 02:22:44 -0400 Received: from [199.232.76.173] (port=32804 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvmOd-0004QX-F4 for qemu-devel@nongnu.org; Thu, 08 Oct 2009 02:22:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50058) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MvmOd-0006Ha-15 for qemu-devel@nongnu.org; Thu, 08 Oct 2009 02:22:39 -0400 Date: Thu, 8 Oct 2009 08:22:35 +0200 From: Gleb Natapov Message-ID: <20091008062235.GC16702@redhat.com> References: <1254932211-28010-1-git-send-email-gleb@redhat.com> <1254932211-28010-2-git-send-email-gleb@redhat.com> <20091007235326.GD15407@morn.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091007235326.GD15407@morn.localdomain> Subject: [Qemu-devel] Re: [PATCH 2/2] Load SMBIOS entries and files from qemu List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor Cc: qemu-devel@nongnu.org On Wed, Oct 07, 2009 at 07:53:26PM -0400, Kevin O'Connor wrote: > On Wed, Oct 07, 2009 at 06:16:51PM +0200, Gleb Natapov wrote: > > Allow SMBIOS fields to be overridden and entries replaced by those > > read from qemu. > > > > This is port of commit f4a09e759469be74e2598758bfae623b555c4cae > > from qemu pc-bios tree. > > > > Signed-off-by: Gleb Natapov > > Two comments: > > The smbios code is allocating 2K of high ram for the full table. Now > that tables can be pulled in from qemu, is it assured that the space > wont overflow? No it is not. We should check this is and stop table loading on overflow. > > [...] > > +#define load_str_field_with_default(type, field, def) \ > [...] > > These macros are really ugly - isn't there a better way to do this? > This is direct port from qemu pcbios, so there the code is exactly the same if it makes you feel better :) Otherwise I agree with you that smbios table could have been done easier, but existing qemu-to-bios interface dictates this complex implementation. I don't see how can we get rid of this macros. Without them we will have to open code the same logic in every place they are used. -- Gleb.