WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] usb device haven't save&&restore in ioemu-remote

To: James Song <jsong@xxxxxxxxxx>
Subject: Re: [Xen-devel] usb device haven't save&&restore in ioemu-remote
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Fri, 20 Mar 2009 10:46:13 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 20 Mar 2009 03:50:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <49C3DB91020000200000FFA4@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <49C3DB91020000200000FFA4@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080505)
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

<Prev in Thread] Current Thread [Next in Thread>