All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <cminyard@mvista.com>
To: Bret Ketchum <bcketchum@gmail.com>, Corey Minyard <minyard@acm.org>
Cc: qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 15/16] smbios: Add a function to directly add an entry
Date: Wed, 13 Nov 2013 14:52:20 -0600	[thread overview]
Message-ID: <5283E684.2010308@mvista.com> (raw)
In-Reply-To: <CAGm6yaREWjyU8TbPRUNmFFM_ixghNVpt68baES4+49AuPp2Tmw@mail.gmail.com>

On 11/13/2013 08:37 AM, Bret Ketchum wrote:
>
>     Don't know if it matters much but this patch cannot be applied
> without the prototype definition in 16/16.

Thanks, I'll fix this.

-corey

>
>
> On Tue, Nov 12, 2013 at 10:33 AM, Corey Minyard <minyard@acm.org
> <mailto:minyard@acm.org>> wrote:
>
>     There was no way to directly add a table entry to the SMBIOS table,
>     even though the BIOS supports this.  So add a function to do this.
>     This is in preparation for the IPMI handler adding it's SMBIOS table
>     entry.
>
>     Signed-off-by: Corey Minyard <cminyard@mvista.com
>     <mailto:cminyard@mvista.com>>
>     ---
>      hw/i386/smbios.c | 27 +++++++++++++++++++++++++++
>      1 file changed, 27 insertions(+)
>
>     diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
>     index d3f1ee6..9c53131 100644
>     --- a/hw/i386/smbios.c
>     +++ b/hw/i386/smbios.c
>     @@ -277,6 +277,33 @@ static void save_opt(const char **dest,
>     QemuOpts *opts, const char *name)
>          }
>      }
>
>     +int smbios_table_entry_add(struct smbios_structure_header *entry)
>     +{
>     +    struct smbios_table *table;
>     +    struct smbios_structure_header *header;
>     +    unsigned int size = entry->length;
>     +
>     +    if (!smbios_entries) {
>     +        smbios_entries_len = sizeof(uint16_t);
>     +        smbios_entries = g_malloc0(smbios_entries_len);
>     +    }
>     +    smbios_entries = g_realloc(smbios_entries, smbios_entries_len +
>     +                              sizeof(*table) + size);
>     +    table = (struct smbios_table *)(smbios_entries +
>     smbios_entries_len);
>     +    table->header.type = SMBIOS_TABLE_ENTRY;
>     +    table->header.length = cpu_to_le16(sizeof(*table) + size);
>     +
>     +    header = (struct smbios_structure_header *)(table->data);
>     +    memcpy(header, entry, size);
>     +
>     +    smbios_check_collision(header->type, SMBIOS_TABLE_ENTRY);
>     +
>     +    smbios_entries_len += sizeof(*table) + size;
>     +    (*(uint16_t *)smbios_entries) =
>     +       cpu_to_le16(le16_to_cpu(*(uint16_t *)smbios_entries) + 1);
>     +    return 0;
>     +}
>     +
>      void smbios_entry_add(QemuOpts *opts)
>      {
>          Error *local_err = NULL;
>     --
>     1.8.3.1
>
>

  parent reply	other threads:[~2013-11-13 20:52 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 16:32 [Qemu-devel] [PATCH 00/16] Add an IPMI device to QEMU Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 01/16] qemu-char: Allocate CharDriverState in qemu_chr_new_from_opts Corey Minyard
2014-01-23 13:32   ` Andreas Färber
2014-01-23 13:58     ` Andreas Färber
2013-11-12 16:33 ` [Qemu-devel] [PATCH 02/16] qemu-char: Allow a chardev to reconnect if disconnected Corey Minyard
2013-11-12 16:43   ` Eric Blake
2013-11-12 17:08     ` Corey Minyard
2013-11-14  7:32       ` Michael S. Tsirkin
2013-11-14 13:29         ` Corey Minyard
2013-11-13  8:55   ` Gerd Hoffmann
2013-11-13 20:51     ` Corey Minyard
2013-11-14 13:56       ` Michael S. Tsirkin
2013-11-12 16:33 ` [Qemu-devel] [PATCH 03/16] qemu-char: remove free of chr from win_stdio_close Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 04/16] qemu-char: Close fd at end of file Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 05/16] Add a base IPMI interface Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 06/16] ipmi: Add a PC ISA type structure Corey Minyard
2014-01-29 14:58   ` Andreas Färber
2013-11-12 16:33 ` [Qemu-devel] [PATCH 07/16] ipmi: Add a KCS low-level interface Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 08/16] ipmi: Add a BT " Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 09/16] ipmi: Add a local BMC simulation Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 10/16] ipmi: Add an external connection simulation interface Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 11/16] ipmi: Add tests Corey Minyard
2013-11-13 14:12   ` Bret Ketchum
2013-11-13 20:51     ` Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 12/16] ipmi: Add documentation Corey Minyard
2013-11-13 16:08   ` Bret Ketchum
2013-11-12 16:33 ` [Qemu-devel] [PATCH 13/16] ipmi: Add migration capability to the IPMI device Corey Minyard
2013-11-12 16:33 ` [Qemu-devel] [PATCH 14/16] pc: Postpone adding ACPI and SMBIOS to fw_cfg Corey Minyard
2013-11-13 14:31   ` Bret Ketchum
2013-11-14  7:30   ` Michael S. Tsirkin
2013-11-14 13:28     ` Corey Minyard
2013-11-14 13:38       ` Michael S. Tsirkin
2013-11-14 13:40         ` Corey Minyard
2013-11-14 13:50           ` Michael S. Tsirkin
2013-11-26 10:03           ` Michael S. Tsirkin
2013-11-12 16:33 ` [Qemu-devel] [PATCH 15/16] smbios: Add a function to directly add an entry Corey Minyard
2013-11-13 14:37   ` Bret Ketchum
2013-11-13 16:22     ` Andreas Färber
2013-11-13 20:52     ` Corey Minyard [this message]
2013-11-12 16:33 ` [Qemu-devel] [PATCH 16/16] ipmi: Add SMBIOS table entry Corey Minyard
2013-11-14  7:46   ` Michael S. Tsirkin
2013-11-14 13:43     ` Corey Minyard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5283E684.2010308@mvista.com \
    --to=cminyard@mvista.com \
    --cc=afaerber@suse.de \
    --cc=bcketchum@gmail.com \
    --cc=minyard@acm.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.