From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8JwI-00086l-Aq for qemu-devel@nongnu.org; Thu, 15 Mar 2012 19:18:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8JwG-0001Rm-Bw for qemu-devel@nongnu.org; Thu, 15 Mar 2012 19:18:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8JwG-0001Rh-3p for qemu-devel@nongnu.org; Thu, 15 Mar 2012 19:18:32 -0400 Date: Fri, 16 Mar 2012 01:00:13 +0200 From: "Michael S. Tsirkin" Message-ID: <20120315230012.GA12879@redhat.com> References: <1331845748-6026-1-git-send-email-dmitry.fleytman@ravellosystems.com> <1331845748-6026-5-git-send-email-dmitry.fleytman@ravellosystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1331845748-6026-5-git-send-email-dmitry.fleytman@ravellosystems.com> 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Fleytman Cc: Anthony Liguori , Alex Fishman , yvugenfi@redhat.com, Izik Eidus , qemu-devel@nongnu.org, Yan Vugenfirer , Dmitry Fleytman On Thu, Mar 15, 2012 at 11:09:03PM +0200, Dmitry Fleytman wrote: > Signed-off-by: Dmitry Fleytman > Signed-off-by: Yan Vugenfirer 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