70114f9
From 83bb87c00e9970a1771ddcad3fd99091f5b2719c Mon Sep 17 00:00:00 2001
70114f9
From: "Michael S. Tsirkin" <mst@redhat.com>
70114f9
Date: Thu, 3 Apr 2014 19:52:21 +0300
70114f9
Subject: [PATCH] vmstate: s/VMSTATE_INT32_LE/VMSTATE_INT32_POSITIVE_LE/
70114f9
70114f9
As the macro verifies the value is positive, rename it
70114f9
to make the function clearer.
70114f9
70114f9
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
70114f9
Signed-off-by: Juan Quintela <quintela@redhat.com>
70114f9
(cherry picked from commit 3476436a44c29725efef0cabf5b3ea4e70054d57)
70114f9
---
70114f9
 hw/pci/pci.c                | 4 ++--
70114f9
 include/migration/vmstate.h | 2 +-
70114f9
 target-arm/machine.c        | 2 +-
70114f9
 3 files changed, 4 insertions(+), 4 deletions(-)
70114f9
70114f9
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
70114f9
index 2a9f08e..517ff2a 100644
70114f9
--- a/hw/pci/pci.c
70114f9
+++ b/hw/pci/pci.c
70114f9
@@ -475,7 +475,7 @@ const VMStateDescription vmstate_pci_device = {
70114f9
     .minimum_version_id = 1,
70114f9
     .minimum_version_id_old = 1,
70114f9
     .fields      = (VMStateField []) {
70114f9
-        VMSTATE_INT32_LE(version_id, PCIDevice),
70114f9
+        VMSTATE_INT32_POSITIVE_LE(version_id, PCIDevice),
70114f9
         VMSTATE_BUFFER_UNSAFE_INFO(config, PCIDevice, 0,
70114f9
                                    vmstate_info_pci_config,
70114f9
                                    PCI_CONFIG_SPACE_SIZE),
70114f9
@@ -492,7 +492,7 @@ const VMStateDescription vmstate_pcie_device = {
70114f9
     .minimum_version_id = 1,
70114f9
     .minimum_version_id_old = 1,
70114f9
     .fields      = (VMStateField []) {
70114f9
-        VMSTATE_INT32_LE(version_id, PCIDevice),
70114f9
+        VMSTATE_INT32_POSITIVE_LE(version_id, PCIDevice),
70114f9
         VMSTATE_BUFFER_UNSAFE_INFO(config, PCIDevice, 0,
70114f9
                                    vmstate_info_pci_config,
70114f9
                                    PCIE_CONFIG_SPACE_SIZE),
70114f9
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
70114f9
index 5b71370..7e45048 100644
70114f9
--- a/include/migration/vmstate.h
70114f9
+++ b/include/migration/vmstate.h
70114f9
@@ -601,7 +601,7 @@ extern const VMStateInfo vmstate_info_bitmap;
70114f9
 #define VMSTATE_UINT64_EQUAL(_f, _s)                                  \
70114f9
     VMSTATE_UINT64_EQUAL_V(_f, _s, 0)
70114f9
 
70114f9
-#define VMSTATE_INT32_LE(_f, _s)                                   \
70114f9
+#define VMSTATE_INT32_POSITIVE_LE(_f, _s)                             \
70114f9
     VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t)
70114f9
 
70114f9
 #define VMSTATE_UINT8_TEST(_f, _s, _t)                               \
70114f9
diff --git a/target-arm/machine.c b/target-arm/machine.c
70114f9
index 7ced87a..5746ffd 100644
70114f9
--- a/target-arm/machine.c
70114f9
+++ b/target-arm/machine.c
70114f9
@@ -246,7 +246,7 @@ const VMStateDescription vmstate_arm_cpu = {
70114f9
         /* The length-check must come before the arrays to avoid
70114f9
          * incoming data possibly overflowing the array.
70114f9
          */
70114f9
-        VMSTATE_INT32_LE(cpreg_vmstate_array_len, ARMCPU),
70114f9
+        VMSTATE_INT32_POSITIVE_LE(cpreg_vmstate_array_len, ARMCPU),
70114f9
         VMSTATE_VARRAY_INT32(cpreg_vmstate_indexes, ARMCPU,
70114f9
                              cpreg_vmstate_array_len,
70114f9
                              0, vmstate_info_uint64, uint64_t),