From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKLzx-0002zT-7C for qemu-devel@nongnu.org; Wed, 29 Jul 2015 03:41:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKLzt-0002xg-VZ for qemu-devel@nongnu.org; Wed, 29 Jul 2015 03:41:57 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:34175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKLzt-0002xR-Nm for qemu-devel@nongnu.org; Wed, 29 Jul 2015 03:41:53 -0400 Received: by wibud3 with SMTP id ud3so208932778wib.1 for ; Wed, 29 Jul 2015 00:41:53 -0700 (PDT) Sender: Paolo Bonzini References: <1438043577-28636-1-git-send-email-marcandre.lureau@redhat.com> <1438043577-28636-3-git-send-email-marcandre.lureau@redhat.com> From: Paolo Bonzini Message-ID: <55B883BE.6040509@redhat.com> Date: Wed, 29 Jul 2015 09:41:50 +0200 MIME-Version: 1.0 In-Reply-To: <1438043577-28636-3-git-send-email-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v2 02/45] msix: add VMSTATE_MSIX_TEST List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: drjones@redhat.com, cam@cs.ualberta.ca, =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , stefanha@redhat.com On 28/07/2015 02:32, Marc-André Lureau wrote: > From: Marc-André Lureau > > ivshmem is going to use MSIX state conditionally. > > Signed-off-by: Marc-André Lureau > --- > include/hw/pci/msix.h | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h > index 954d82b..72e5f93 100644 > --- a/include/hw/pci/msix.h > +++ b/include/hw/pci/msix.h > @@ -46,12 +46,16 @@ 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), \ > +#define VMSTATE_MSIX_TEST(_field, _state, _test) { \ > + .name = (stringify(_field)), \ > + .size = sizeof(PCIDevice), \ > + .vmsd = &vmstate_msix, \ > + .flags = VMS_STRUCT, \ > + .offset = vmstate_offset_value(_state, _field, PCIDevice), \ > + .field_exists = (_test) \ > } > > +#define VMSTATE_MSIX(_f, _s) \ > + VMSTATE_MSIX_TEST(_f, _s, NULL) > + > #endif > Why can't it be saved unconditionally? Paolo