qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/6] Use IO port for qemu<->guest BIOS communica


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 1/6] Use IO port for qemu<->guest BIOS communication.
Date: Sun, 24 Aug 2008 20:39:44 +0300

On 8/24/08, Gleb Natapov <address@hidden> wrote:
> Use PIO to get configuration info between qemu process and guest BIOS.

Could you make this a separate device, so that it could be used in
other machines? There is nothing PC-specific.

>  +static uint32_t bios_cfg_read(void *opaque, uint32_t addr)
>  +{
>  +    BIOSCfgEntry *e = &bios_params.entries[bios_params.entry];

You should use the opaque parameter and cast that to BIOSCfgState.

>  +    if (!e->data)
>  +        return 0;
>  +
>  +    return e->data[bios_params.cur_offset++ % e->len];

Instead of using modular arithmetic, zero should be returned for invalid values.

>  +static void bios_cfg_write(void *opaque, uint32_t addr, uint32_t value)
>  +{
>  +    bios_params.entry = value % BIOS_CFG_MAX_ENTRY;

Same here, its important for downward compatibility.

>  +    bios_cfg_add_data(BIOS_CFG_SIGNATURE, "QEMU", 4);

I'd add:
+    bios_cfg_add_data(BIOS_CFG_ID, 1, 4);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]