diff mbox

[05/11] vga-isa: fix migration by breaking it

Message ID 1300839376-22520-6-git-send-email-aliguori@us.ibm.com
State New
Headers show

Commit Message

Anthony Liguori March 23, 2011, 12:16 a.m. UTC
This is pretty sad.  We use the same section name for vga-isa as we do for
vga-pci even though we use separate formats.  This breaks the live migration
protocol because we may misinterpret the vga-isa as a vga-pci device.

vga-isa should use it's own wrapper just like vga-pci does.  That's what we do
in this patch.

Signed-by-off: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/vga-isa.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Comments

Juan Quintela March 23, 2011, 9:54 a.m. UTC | #1
Anthony Liguori <aliguori@us.ibm.com> wrote:
> This is pretty sad.  We use the same section name for vga-isa as we do for
> vga-pci even though we use separate formats.  This breaks the live migration
> protocol because we may misinterpret the vga-isa as a vga-pci device.
>
> vga-isa should use it's own wrapper just like vga-pci does.  That's what we do
> in this patch.
>
> Signed-by-off: Anthony Liguori <aliguori@us.ibm.com>
> ---
>  hw/vga-isa.c |   13 +++++++++++--
>  1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/hw/vga-isa.c b/hw/vga-isa.c
> index 5f1ef76..eaae2e0 100644
> --- a/hw/vga-isa.c
> +++ b/hw/vga-isa.c
> @@ -72,10 +72,19 @@ static int vga_initfn(ISADevice *dev)
>      return 0;
>  }
>  
> +static const VMStateDescription vmstate_vga_isa = {
> +    .name = "isa-vga",
> +    .version_id = 1,
> +    .fields = (VMStateField []) {
> +        VMSTATE_STRUCT(state, ISAVGAState, 0, vmstate_vga_common, VGACommonState),
> +        VMSTATE_END_OF_LIST(),
> +    },
> +};
> +
>  static ISADeviceInfo vga_info = {
>      .qdev.name     = "isa-vga",
>      .qdev.size     = sizeof(ISAVGAState),
> -    .qdev.vmsd     = &vmstate_vga_common,
> +    .qdev.vmsd     = &vmstate_vga_isa,
>      .qdev.reset     = vga_reset_isa,
>      .qdev.no_user  = 1,
>      .init          = vga_initfn,
> @@ -84,7 +93,7 @@ static ISADeviceInfo vga_info = {
>  /* Register the VMState Description to support VMState introspection */
>  static void init_vmstate_description_0(void)
>  {
> -    register_vmstate_description(&vmstate_vga_common);
> +    register_vmstate_description(&vmstate_vga_isa);
>  }
>  
>  vmstate_init(init_vmstate_description_0);

This was done that way when I ported this device.

This define is also always setup CONFIG_BOCHS_VBE, and at some point it
didn't worked without it.

But this is a different problem that doing the tests.

Later, JUan.
diff mbox

Patch

diff --git a/hw/vga-isa.c b/hw/vga-isa.c
index 5f1ef76..eaae2e0 100644
--- a/hw/vga-isa.c
+++ b/hw/vga-isa.c
@@ -72,10 +72,19 @@  static int vga_initfn(ISADevice *dev)
     return 0;
 }
 
+static const VMStateDescription vmstate_vga_isa = {
+    .name = "isa-vga",
+    .version_id = 1,
+    .fields = (VMStateField []) {
+        VMSTATE_STRUCT(state, ISAVGAState, 0, vmstate_vga_common, VGACommonState),
+        VMSTATE_END_OF_LIST(),
+    },
+};
+
 static ISADeviceInfo vga_info = {
     .qdev.name     = "isa-vga",
     .qdev.size     = sizeof(ISAVGAState),
-    .qdev.vmsd     = &vmstate_vga_common,
+    .qdev.vmsd     = &vmstate_vga_isa,
     .qdev.reset     = vga_reset_isa,
     .qdev.no_user  = 1,
     .init          = vga_initfn,
@@ -84,7 +93,7 @@  static ISADeviceInfo vga_info = {
 /* Register the VMState Description to support VMState introspection */
 static void init_vmstate_description_0(void)
 {
-    register_vmstate_description(&vmstate_vga_common);
+    register_vmstate_description(&vmstate_vga_isa);
 }
 
 vmstate_init(init_vmstate_description_0);