summaryrefslogtreecommitdiffstats
path: root/hw/s390x/s390-stattrib.c
diff options
context:
space:
mode:
authorClaudio Imbrenda2018-07-05 12:39:30 +0200
committerCornelia Huck2018-07-11 14:36:54 +0200
commit17f4566657df51c5e0cb40f30491e058d74d63c8 (patch)
tree921daafe563ac787dbd4b0033ebfe9617f7fe1b8 /hw/s390x/s390-stattrib.c
parentUpdate version for v3.0.0-rc0 release (diff)
downloadqemu-17f4566657df51c5e0cb40f30491e058d74d63c8.tar.gz
qemu-17f4566657df51c5e0cb40f30491e058d74d63c8.tar.xz
qemu-17f4566657df51c5e0cb40f30491e058d74d63c8.zip
s390x/storage attributes: fix CMMA_BLOCK_SIZE usage
The macro CMMA_BLOCK_SIZE was defined but not used, and a hardcoded value was instead used in the code. This patch fixes the value of CMMA_BLOCK_SIZE and uses it in the appropriate place in the code, and fixes another case of hardcoded value in the KVM backend, replacing it with the more appropriate constant KVM_S390_CMMA_SIZE_MAX. Signed-off-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> Message-Id: <1530787170-3101-1-git-send-email-imbrenda@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/s390x/s390-stattrib.c')
-rw-r--r--hw/s390x/s390-stattrib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c
index 5161a1659b..766f2015a4 100644
--- a/hw/s390x/s390-stattrib.c
+++ b/hw/s390x/s390-stattrib.c
@@ -21,7 +21,8 @@
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
-#define CMMA_BLOCK_SIZE (1 * KiB)
+/* 512KiB cover 2GB of guest memory */
+#define CMMA_BLOCK_SIZE (512 * KiB)
#define STATTR_FLAG_EOS 0x01ULL
#define STATTR_FLAG_MORE 0x02ULL
@@ -203,7 +204,7 @@ static int cmma_save(QEMUFile *f, void *opaque, int final)
S390StAttribClass *sac = S390_STATTRIB_GET_CLASS(sas);
uint8_t *buf;
int r, cx, reallen = 0, ret = 0;
- uint32_t buflen = 1 << 19; /* 512kB cover 2GB of guest memory */
+ uint32_t buflen = CMMA_BLOCK_SIZE;
uint64_t start_gfn = sas->migration_cur_gfn;
buf = g_try_malloc(buflen);