From patchwork Fri Oct 2 19:09:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 525732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E7A581402D5 for ; Sat, 3 Oct 2015 05:25:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=a5YeUP5z; dkim-atps=neutral Received: from localhost ([::1]:34600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi5xO-00026X-Lm for incoming@patchwork.ozlabs.org; Fri, 02 Oct 2015 15:25:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi5iX-0007Pi-Cu for qemu-devel@nongnu.org; Fri, 02 Oct 2015 15:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi5iR-0006jh-E2 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 15:10:05 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:38533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi5iR-0006jW-7x for qemu-devel@nongnu.org; Fri, 02 Oct 2015 15:09:59 -0400 Received: by wiclk2 with SMTP id lk2so43227121wic.1 for ; Fri, 02 Oct 2015 12:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=vFl5gNR3UFDUWfCh2XvmZtcnJzw2qfmE/oespljv9eo=; b=a5YeUP5zs3TZWVjoLKg4FdCCUh9Nmen0gYaQjgJd6Rijs8WeB7qBaqCJdhjfhvc5Ui 8PUmcvapCscIKfMa5egYwB9vZOFfrQA7tpS+O6rrH8e0q0VMNHkrdJ1T/JKs9oGFRBnB LW9jop8/bdDwS/C1BsTZXP6fadtMfM6utyfA765gpoJV5SV8JF9MxA+etJxooX+yDm5Z b9OHzWKR5Y/MIwTAuCyCiffgnmgoUWPr/tsxe3TJHKvBUjAo0dN9OftIDOwukzFAX7oP TvLrswKqZctkL8gpfxjpCEo04ZON4jy8DSZMcpTMBo33d3d/pYYI+VQsd7ady8Smi5Yk N17w== X-Received: by 10.194.5.135 with SMTP id s7mr21026036wjs.153.1443812998521; Fri, 02 Oct 2015 12:09:58 -0700 (PDT) Received: from localhost (bne75-h02-31-39-163-232.dsl.sta.abo.bbox.fr. [31.39.163.232]) by smtp.gmail.com with ESMTPSA id ft3sm380268wib.17.2015.10.02.12.09.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 12:09:57 -0700 (PDT) From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Date: Fri, 2 Oct 2015 21:09:05 +0200 Message-Id: <1443812991-17356-3-git-send-email-marcandre.lureau@redhat.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1443812991-17356-1-git-send-email-marcandre.lureau@redhat.com> References: <1443812991-17356-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22f Cc: drjones@redhat.com, claudio.fontana@huawei.com, stefanha@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com, cam@cs.ualberta.ca Subject: [Qemu-devel] [PATCH v5 02/48] msix: add VMSTATE_MSIX_TEST X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau ivshmem is going to use MSIX state conditionally. Signed-off-by: Marc-André Lureau Reviewed-by: Claudio Fontana --- 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