James Song wrote:
> usb device haven't save&&restore in ioemu-remote.
> patch for that:
Could you please rediff the patch against the current qemu-xen-unstable?
You'll find that portions of this patch are already in, in particular
there is no need for:
> void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
> diff -r 21508368a9db tools/ioemu-remote/hw/usb-uhci.c
> --- a/tools/ioemu-remote/hw/usb-uhci.c Fri Feb 20 21:14:55 2009 +0800
> +++ b/tools/ioemu-remote/hw/usb-uhci.c Wed Mar 04 11:55:39 2009 +0800
> @@ -902,6 +902,57 @@
> register_ioport_read(addr, 32, 1, uhci_ioport_readb, s);
> }
>
> +void uhci_usb_save(QEMUFile *f, void *opaque)
> +{
> + int i;
> + UHCIState *s = (UHCIState*)opaque;
> +
> + pci_device_save(&s->dev,f);
> +
> + qemu_put_be16s(f, &s->cmd);
> + qemu_put_be16s(f, &s->status);
> + qemu_put_be16s(f, &s->intr);
> + qemu_put_be16s(f, &s->frnum);
> + qemu_put_be32s(f, &s->fl_base_addr);
> + qemu_put_8s(f, &s->sof_timing);
> + qemu_put_8s(f, &s->status2);
> +
> + for(i = 0; i < NB_PORTS; i++) {
> + qemu_put_be16s(f, &s->ports[i].ctrl);
> + }
> +
> + qemu_put_timer(f, s->frame_timer);
> +}
> +
> +int uhci_usb_load(QEMUFile *f, void *opaque, int version_id)
> +{
> + int i,ret;
> + UHCIState *s = (UHCIState*)opaque;
> +
> + if (version_id != 1)
> + return -EINVAL;
> +
> + ret = pci_device_load(&s->dev, f);
> + if (ret < 0)
> + return ret;
> +
> + qemu_get_be16s(f, &s->cmd);
> + qemu_get_be16s(f, &s->status);
> + qemu_get_be16s(f, &s->intr);
> + qemu_get_be16s(f, &s->frnum);
> + qemu_get_be32s(f, &s->fl_base_addr);
> + qemu_get_8s(f, &s->sof_timing);
> + qemu_get_8s(f, &s->status2);
> +
> + for(i = 0; i < NB_PORTS; i++) {
> + qemu_get_be16s(f, &s->ports[i].ctrl);
> + }
> +
> + qemu_get_timer(f, s->frame_timer);
> +
> + return 0;
> +}
> +
> void usb_uhci_piix3_init(PCIBus *bus, int devfn)
> {
> UHCIState *s;
> @@ -935,6 +986,7 @@
> to rely on this. */
> pci_register_io_region(&s->dev, 4, 0x20,
> PCI_ADDRESS_SPACE_IO, uhci_map);
> + register_savevm("UHCI_usb_controller", 0, 1, uhci_usb_save,
> uhci_usb_load, s);
> }
>
> void usb_uhci_piix4_init(PCIBus *bus, int devfn)
> @@ -970,4 +1022,5 @@
> to rely on this. */
> pci_register_io_region(&s->dev, 4, 0x20,
> PCI_ADDRESS_SPACE_IO, uhci_map);
> + register_savevm("UHCI_usb_controller", 0, 1, uhci_usb_save,
> uhci_usb_load, s);
> }
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|