On 14 June 2011 18:53, Jan Kiszka <jan.kis...@siemens.com> wrote:
> Fixes cold reset in vmware graphic modes.
>
> CC: Andrzej Zaborowski <bal...@zabor.org>
> Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
Reviewed-by: Andrzej Zaborowski <balr...@gmail.com>
> ---
> hw/vmware_vga.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
> index 93b8811..c20f154 100644
> --- a/hw/vmware_vga.c
> +++ b/hw/vmware_vga.c
> @@ -966,8 +966,12 @@ static void vmsvga_update_display(void *opaque)
> }
> }
>
> -static void vmsvga_reset(struct vmsvga_state_s *s)
> +static void vmsvga_reset(DeviceState *dev)
> {
> + struct pci_vmsvga_state_s *pci =
> + DO_UPCAST(struct pci_vmsvga_state_s, card.qdev, dev);
> + struct vmsvga_state_s *s = &pci->chip;
> +
> s->index = 0;
> s->enable = 0;
> s->config = 0;
> @@ -1117,8 +1121,6 @@ static void vmsvga_init(struct vmsvga_state_s *s, int
> vga_ram_size)
> vga_common_init(&s->vga, vga_ram_size);
> vga_init(&s->vga);
> vmstate_register(NULL, 0, &vmstate_vga_common, &s->vga);
> -
> - vmsvga_reset(s);
> }
>
> static void pci_vmsvga_map_ioport(PCIDevice *pci_dev, int region_num,
> @@ -1207,6 +1209,7 @@ static PCIDeviceInfo vmsvga_info = {
> .qdev.name = "vmware-svga",
> .qdev.size = sizeof(struct pci_vmsvga_state_s),
> .qdev.vmsd = &vmstate_vmware_vga,
> + .qdev.reset = vmsvga_reset,
> .no_hotplug = 1,
> .init = pci_vmsvga_initfn,
> .romfile = "vgabios-vmware.bin",
> --
> 1.7.1
>
>
>