Patchwork i8254: Fix migration from older versions

login
register
mail settings
Submitter Jan Kiszka
Date March 6, 2011, 3:09 p.m.
Message ID <4D73A3BD.2000405@web.de>
Download mbox | patch
Permalink /patch/85580/
State New
Headers show

Comments

Jan Kiszka - March 6, 2011, 3:09 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

qdev conversion broke migration as the previous version used vmstate
instance IDs derived from the iobase. Fix it by registering a legacy
alias.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/i8254.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Jan Kiszka - March 18, 2011, 10:48 a.m.
On 2011-03-06 16:09, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> qdev conversion broke migration as the previous version used vmstate
> instance IDs derived from the iobase. Fix it by registering a legacy
> alias.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hw/i8254.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/i8254.c b/hw/i8254.c
> index eaf5d3e..47c9d73 100644
> --- a/hw/i8254.c
> +++ b/hw/i8254.c
> @@ -520,6 +520,8 @@ static int pit_initfn(ISADevice *dev)
>      register_ioport_read(pit->iobase, 3, 1, pit_ioport_read, pit);
>      isa_init_ioport(dev, pit->iobase);
>  
> +    qdev_set_legacy_instance_id(&dev->qdev, pit->iobase, 2);
> +
>      return 0;
>  }
>  

This bug is still open.

Jan
Blue Swirl - March 19, 2011, 8:38 a.m.
Thanks, applied.

On Fri, Mar 18, 2011 at 12:48 PM, Jan Kiszka <jan.kiszka@web.de> wrote:
> On 2011-03-06 16:09, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> qdev conversion broke migration as the previous version used vmstate
>> instance IDs derived from the iobase. Fix it by registering a legacy
>> alias.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>  hw/i8254.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/hw/i8254.c b/hw/i8254.c
>> index eaf5d3e..47c9d73 100644
>> --- a/hw/i8254.c
>> +++ b/hw/i8254.c
>> @@ -520,6 +520,8 @@ static int pit_initfn(ISADevice *dev)
>>      register_ioport_read(pit->iobase, 3, 1, pit_ioport_read, pit);
>>      isa_init_ioport(dev, pit->iobase);
>>
>> +    qdev_set_legacy_instance_id(&dev->qdev, pit->iobase, 2);
>> +
>>      return 0;
>>  }
>>
>
> This bug is still open.
>
> Jan
>
>

Patch

diff --git a/hw/i8254.c b/hw/i8254.c
index eaf5d3e..47c9d73 100644
--- a/hw/i8254.c
+++ b/hw/i8254.c
@@ -520,6 +520,8 @@  static int pit_initfn(ISADevice *dev)
     register_ioport_read(pit->iobase, 3, 1, pit_ioport_read, pit);
     isa_init_ioport(dev, pit->iobase);
 
+    qdev_set_legacy_instance_id(&dev->qdev, pit->iobase, 2);
+
     return 0;
 }