All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: James Song <jsong@novell.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: usb device haven't save&&restore in ioemu-remote
Date: Fri, 20 Mar 2009 10:46:13 +0000	[thread overview]
Message-ID: <49C373F5.7060308@eu.citrix.com> (raw)
In-Reply-To: <49C3DB91020000200000FFA4@lucius.provo.novell.com>

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);
>  }

      reply	other threads:[~2009-03-20 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-20  7:08 usb device haven't save&&restore in ioemu-remote James Song
2009-03-20 10:46 ` Stefano Stabellini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C373F5.7060308@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=jsong@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.