qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 4/9] MSI-X state save/load invocations moved


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH v4 4/9] MSI-X state save/load invocations moved to PCI Device save/load callbacks to avoid code duplication in MSI-X-enabled devices that support live migration
Date: Fri, 16 Mar 2012 01:00:13 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Mar 15, 2012 at 11:09:03PM +0200, Dmitry Fleytman wrote:
> Signed-off-by: Dmitry Fleytman <address@hidden>
> Signed-off-by: Yan Vugenfirer <address@hidden>

I'm working on a higher level API that will
handle all capabilities. For now, pls just put
these calls in your device.


> ---
>  hw/pci.c        |    5 +++++
>  hw/virtio-pci.c |    2 --
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index bf046bf..9146d3f 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -31,6 +31,7 @@
>  #include "loader.h"
>  #include "range.h"
>  #include "qmp-commands.h"
> +#include "msix.h"
>  
>  //#define DEBUG_PCI
>  #ifdef DEBUG_PCI
> @@ -387,6 +388,8 @@ static int get_pci_irq_state(QEMUFile *f, void *pv, 
> size_t size)
>          pci_set_irq_state(s, i, irq_state[i]);
>      }
>  
> +    msix_load(s, f);
> +
>      return 0;
>  }
>  
> @@ -398,6 +401,8 @@ static void put_pci_irq_state(QEMUFile *f, void *pv, 
> size_t size)
>      for (i = 0; i < PCI_NUM_PINS; ++i) {
>          qemu_put_be32(f, pci_irq_state(s, i));
>      }
> +
> +    msix_save(s, f);
>  }
>  
>  static VMStateInfo vmstate_info_pci_irq_state = {
> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
> index a0fb7c1..2f3cb1f 100644
> --- a/hw/virtio-pci.c
> +++ b/hw/virtio-pci.c
> @@ -110,7 +110,6 @@ static void virtio_pci_save_config(void * opaque, 
> QEMUFile *f)
>  {
>      VirtIOPCIProxy *proxy = opaque;
>      pci_device_save(&proxy->pci_dev, f);
> -    msix_save(&proxy->pci_dev, f);
>      if (msix_present(&proxy->pci_dev))
>          qemu_put_be16(f, proxy->vdev->config_vector);
>  }
> @@ -130,7 +129,6 @@ static int virtio_pci_load_config(void * opaque, QEMUFile 
> *f)
>      if (ret) {
>          return ret;
>      }
> -    msix_load(&proxy->pci_dev, f);
>      if (msix_present(&proxy->pci_dev)) {
>          qemu_get_be16s(f, &proxy->vdev->config_vector);
>      } else {
> -- 
> 1.7.7.6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]