qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/6] pci: add VMSTATE_MSIX
Date: Tue, 7 May 2013 17:05:09 +0300	[thread overview]
Message-ID: <20130507140509.GA22422@redhat.com> (raw)
In-Reply-To: <1367933676-21854-2-git-send-email-kraxel@redhat.com>

On Tue, May 07, 2013 at 03:34:31PM +0200, Gerd Hoffmann wrote:
> Using a trick cut+pasted from vmstate_scsi_device
> to wind up msix_save and msix_load.

Any reason this is not signed-off by you?

> ---
>  hw/pci/msix.c         |   33 +++++++++++++++++++++++++++++++++
>  include/hw/pci/msix.h |   11 +++++++++++
>  2 files changed, 44 insertions(+)
> 
> diff --git a/hw/pci/msix.c b/hw/pci/msix.c
> index e231a0d..6da75ec 100644
> --- a/hw/pci/msix.c
> +++ b/hw/pci/msix.c
> @@ -569,3 +569,36 @@ void msix_unset_vector_notifiers(PCIDevice *dev)
>      dev->msix_vector_release_notifier = NULL;
>      dev->msix_vector_poll_notifier = NULL;
>  }
> +
> +static void put_msix_state(QEMUFile *f, void *pv, size_t size)
> +{
> +    msix_save(pv, f);
> +}
> +
> +static int get_msix_state(QEMUFile *f, void *pv, size_t size)
> +{
> +    msix_load(pv, f);
> +    return 0;
> +}
> +
> +static VMStateInfo vmstate_info_msix = {
> +    .name = "msix state",
> +    .get  = get_msix_state,
> +    .put  = put_msix_state,
> +};
> +
> +const VMStateDescription vmstate_msix = {
> +    .name = "msix",
> +    .fields = (VMStateField[]) {
> +        {
> +            .name         = "msix",
> +            .version_id   = 0,
> +            .field_exists = NULL,
> +            .size         = 0,   /* ouch */
> +            .info         = &vmstate_info_msix,
> +            .flags        = VMS_SINGLE,
> +            .offset       = 0,
> +        },
> +        VMSTATE_END_OF_LIST()
> +    }
> +};
> diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h
> index e648410..954d82b 100644
> --- a/include/hw/pci/msix.h
> +++ b/include/hw/pci/msix.h
> @@ -43,4 +43,15 @@ int msix_set_vector_notifiers(PCIDevice *dev,
>                                MSIVectorReleaseNotifier release_notifier,
>                                MSIVectorPollNotifier poll_notifier);
>  void msix_unset_vector_notifiers(PCIDevice *dev);
> +
> +extern const VMStateDescription vmstate_msix;
> +
> +#define VMSTATE_MSIX(_field, _state) {                               \
> +    .name       = (stringify(_field)),                               \
> +    .size       = sizeof(PCIDevice),                                 \
> +    .vmsd       = &vmstate_msix,                                     \
> +    .flags      = VMS_STRUCT,                                        \
> +    .offset     = vmstate_offset_value(_state, _field, PCIDevice),   \
> +}
> +
>  #endif
> -- 
> 1.7.9.7
> 

  reply	other threads:[~2013-05-07 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-07 13:34 [Qemu-devel] [PATCH 0/6] xhci: add live migration support Gerd Hoffmann
2013-05-07 13:34 ` [Qemu-devel] [PATCH 1/6] pci: add VMSTATE_MSIX Gerd Hoffmann
2013-05-07 14:05   ` Michael S. Tsirkin [this message]
2013-05-07 14:08     ` Gerd Hoffmann
2013-05-07 14:10       ` Michael S. Tsirkin
2013-05-07 13:34 ` [Qemu-devel] [PATCH 2/6] xhci: add XHCISlot->addressed Gerd Hoffmann
2013-05-07 13:34 ` [Qemu-devel] [PATCH 3/6] xhci: add xhci_alloc_epctx Gerd Hoffmann
2013-05-07 13:34 ` [Qemu-devel] [PATCH 4/6] xhci: add xhci_init_epctx Gerd Hoffmann
2013-05-07 13:34 ` [Qemu-devel] [PATCH 5/6] xhci: add vmstate Gerd Hoffmann
2013-05-07 14:06   ` Michael S. Tsirkin
2013-05-07 14:14     ` Gerd Hoffmann
2013-05-07 15:05       ` Michael S. Tsirkin
2013-05-07 13:34 ` [Qemu-devel] [PATCH 6/6] [debug] xhci: remove unmigratable flag Gerd Hoffmann

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=20130507140509.GA22422@redhat.com \
    --to=mst@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).