Skip to contentSkip to conversation

s390x/storage attributes: fix CMMA_BLOCK_SIZE usage

PATCH Superseded Claudio Imbrenda 1 participant 1 message Jul 2, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 hw/s390x/s390-stattrib.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/s390x/s390-stattrib.c +3 -2
index 70b9555..a788cdb 100644
@@ -20,7 +20,8 @@
 #include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
 
-#define CMMA_BLOCK_SIZE  (1 << 10)
+/* 512kB cover 2GB of guest memory */
+#define CMMA_BLOCK_SIZE  (1 << 19)
 
 #define STATTR_FLAG_EOS     0x01ULL
 #define STATTR_FLAG_MORE    0x02ULL
@@ -202,7 +203,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);
Signature · 1 line
2.7.4