From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZKQq-00051x-SM for qemu-devel@nongnu.org; Tue, 17 Feb 2009 02:31:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZKQp-00050o-CM for qemu-devel@nongnu.org; Tue, 17 Feb 2009 02:31:52 -0500 Received: from [199.232.76.173] (port=55844 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZKQp-00050e-6y for qemu-devel@nongnu.org; Tue, 17 Feb 2009 02:31:51 -0500 Received: from mx2.redhat.com ([66.187.237.31]:35710) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LZKQo-0000FP-Q9 for qemu-devel@nongnu.org; Tue, 17 Feb 2009 02:31:51 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1H7VnSK015384 for ; Tue, 17 Feb 2009 02:31:49 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1H7VoS4030923 for ; Tue, 17 Feb 2009 02:31:50 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1H7Vm41011378 for ; Tue, 17 Feb 2009 02:31:48 -0500 Date: Tue, 17 Feb 2009 09:29:01 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH v2] Allow additions of ACPI tables from command line Message-ID: <20090217072901.GB26845@redhat.com> References: <20090209142832.GF28969@redhat.com> <499985DE.7010807@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <499985DE.7010807@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Feb 16, 2009 at 09:27:26AM -0600, Anthony Liguori wrote: > Gleb Natapov wrote: >> This is needed to dynamically add SLIC tables with Windows >> activation keys. >> >> Signed-off-by: Gleb Natapov >> diff --git a/hw/acpi.c b/hw/acpi.c >> index 4338d02..7175598 100644 >> --- a/hw/acpi.c >> +++ b/hw/acpi.c >> @@ -561,3 +561,170 @@ void qemu_system_powerdown(void) >> } >> } >> #endif >> + >> +struct acpi_table_header >> +{ >> + char signature [4]; /* ACPI signature (4 ASCII characters) */ >> + uint32_t length; /* Length of table, in bytes, including header */ >> + uint8_t revision; /* ACPI Specification minor version # */ >> + uint8_t checksum; /* To make sum of entire table == 0 */ >> + char oem_id [6]; /* OEM identification */ >> + char oem_table_id [8]; /* OEM table identification */ >> + uint32_t oem_revision; /* OEM revision number */ >> + char asl_compiler_id [4]; /* ASL compiler vendor ID */ >> + uint32_t asl_compiler_revision; /* ASL compiler revision number */ >> +}; >> > > I don't have a lot of confidence that this table is going to be padded > correctly by all compilers on all architectures. I'd suggest explicit > padding. > __attribute_((packed)) should be enough, no? >> + if (get_param_value(buf, sizeof(buf), "oem_id", t)) { >> + strncpy(acpi_hdr.oem_id, buf, 6); >> > > is oem_id supposed to be NULL terminated or just NULL padded? ACPI spec rev 3.0b 18.2.1: OEM ID of up to 6 characters. If the OEM ID is shorter than 6 characters, it can be terminated with a NULL character. -- Gleb.