[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 07/11] eeprom93xx: Use the new hack macro to avo
From: |
Juan Quintela |
Subject: |
[Qemu-devel] Re: [PATCH 07/11] eeprom93xx: Use the new hack macro to avoid duplicate field names |
Date: |
Wed, 23 Mar 2011 10:58:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Anthony Liguori <address@hidden> wrote:
> I don't fully understand this hack business but we need field to be unique
> so..
>
> Signed-off-by: Anthony Liguori <address@hidden>
> ---
> hw/eeprom93xx.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/eeprom93xx.c b/hw/eeprom93xx.c
> index cfa695d..f1d75ec 100644
> --- a/hw/eeprom93xx.c
> +++ b/hw/eeprom93xx.c
> @@ -114,7 +114,7 @@ static const VMStateInfo vmstate_hack_uint16_from_uint8 =
> {
> };
>
> #define VMSTATE_UINT16_HACK_TEST(_f, _s, _t) \
> - VMSTATE_SINGLE_TEST(_f, _s, _t, 0, vmstate_hack_uint16_from_uint8,
> uint16_t)
> + VMSTATE_SINGLE_TEST_HACK(_f, _s, _t, 0, vmstate_hack_uint16_from_uint8,
> uint16_t)
>
> static bool is_old_eeprom_version(void *opaque, int version_id)
> {
After the fact, we need to promote it as "full types".
Basically it is needed when we sent a field with a different size that
we use it on the struct.
if we have
struct FOOState {
int32_t bar;
....
}
and it is sent as
VMSTATE_INT8(bar, ....)
In this case, I went through the whole device, checed that int8_t was
enough and did the change.
But if we have:
struct FOOState {
int8_t bar;
....
}
and it is sent as
VMSTATE_INT32(bar, ....)
Then it is not trivial :-(
We change FOOState to int32 or we break migration format. Here is where
the _HACK suffix appeared.
I thought it was not going to be needed a lot, but there are several
devices that just sent everything over the wire as uint32, independently
of its type.
Later, Juan.
- [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, (continued)
- [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, Anthony Liguori, 2011/03/22
- Re: [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, Stefan Hajnoczi, 2011/03/23
- Re: [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, Roy Tam, 2011/03/23
- Re: [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, Stefan Hajnoczi, 2011/03/23
- Re: [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, Roy Tam, 2011/03/23
- [Qemu-devel] Re: [PATCH 01/11] Add hard build dependency on glib, Paolo Bonzini, 2011/03/23
- Re: [Qemu-devel] [PATCH 01/11] Add hard build dependency on glib, Stefan Hajnoczi, 2011/03/23
[Qemu-devel] [PATCH 08/11] fw_cfg: make sure all VMState fields are unique., Anthony Liguori, 2011/03/22
[Qemu-devel] [PATCH 06/11] fdc: fix migration of non-ISA fdc devices, Anthony Liguori, 2011/03/22
[Qemu-devel] [PATCH 07/11] eeprom93xx: Use the new hack macro to avoid duplicate field names, Anthony Liguori, 2011/03/22
- [Qemu-devel] Re: [PATCH 07/11] eeprom93xx: Use the new hack macro to avoid duplicate field names,
Juan Quintela <=
[Qemu-devel] [PATCH 02/11] vmstate: register all VMStateDescriptions, Anthony Liguori, 2011/03/22
[Qemu-devel] [PATCH 05/11] vga-isa: fix migration by breaking it, Anthony Liguori, 2011/03/22
[Qemu-devel] [PATCH 09/11] pckbd: make non-ISA pckbd use a unique name, Anthony Liguori, 2011/03/22