Skip to contentSkip to conversation

physmem: improve ram size error messages

PATCH Applied Pankaj Gupta 3 participants 4 messages Oct 22, 2020 – Nov 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 physmem: improve ram size error messages

Ram size mismatch condition logs below message.

"Length mismatch: pc.ram: 0x80000000 in != 0x180000000: Invalid argument"

This patch improves the readability of error messages. Removed the superflous "in" and changed "Length" to "Size".

---
 softmmu/physmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
softmmu/physmem.c +3 -3
index e319fb2a1e..8da184f4a6 100644
@@ -1756,15 +1756,15 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp)
 
     if (!(block->flags & RAM_RESIZEABLE)) {
         error_setg_errno(errp, EINVAL,
-                         "Length mismatch: %s: 0x" RAM_ADDR_FMT
-                         " in != 0x" RAM_ADDR_FMT, block->idstr,
+                         "Size mismatch: %s: 0x" RAM_ADDR_FMT
+                         " != 0x" RAM_ADDR_FMT, block->idstr,
                          newsize, block->used_length);
         return -EINVAL;
     }
 
     if (block->max_length < newsize) {
         error_setg_errno(errp, EINVAL,
-                         "Length too large: %s: 0x" RAM_ADDR_FMT
+                         "Size too large: %s: 0x" RAM_ADDR_FMT
                          " > 0x" RAM_ADDR_FMT, block->idstr,
                          newsize, block->max_length);
         return -EINVAL;
Signature · 1 line
2.20.1
#1 lore raw

Ping

Quoted 39 lines

Ram size mismatch condition logs below message.

   "Length mismatch: pc.ram: 0x80000000 in != 0x180000000: Invalid argument"

This patch improves the readability of error messages. Removed the superflous "in" and changed "Length" to "Size".

---
 softmmu/physmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
softmmu/physmem.c +3 -4
index e319fb2a1e..8da184f4a6 100644
@@ -1756,15 +1756,15 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp)
 
     if (!(block->flags & RAM_RESIZEABLE)) {
         error_setg_errno(errp, EINVAL,
-                         "Length mismatch: %s: 0x" RAM_ADDR_FMT
-                         " in != 0x" RAM_ADDR_FMT, block->idstr,
+                         "Size mismatch: %s: 0x" RAM_ADDR_FMT
+                         " != 0x" RAM_ADDR_FMT, block->idstr,
                          newsize, block->used_length);
         return -EINVAL;
     }
 
     if (block->max_length < newsize) {
         error_setg_errno(errp, EINVAL,
-                         "Length too large: %s: 0x" RAM_ADDR_FMT
+                         "Size too large: %s: 0x" RAM_ADDR_FMT
                          " > 0x" RAM_ADDR_FMT, block->idstr,
                          newsize, block->max_length);
         return -EINVAL;
--

2.20.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Pankaj Gupta
Quoted 4 lines · Pankaj Gupta

Ram size mismatch condition logs below message.

   "Length mismatch: pc.ram: 0x80000000 in != 0x180000000: Invalid argument"
Quoted 8 lines

This patch improves the readability of error messages. Removed the superflous "in" and changed "Length" to "Size".

---
 softmmu/physmem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
#3 lore raw
In reply to Pankaj Gupta
Quoted 27 lines · Pankaj Gupta

Ram size mismatch condition logs below message.

    "Length mismatch: pc.ram: 0x80000000 in != 0x180000000: Invalid argument"

This patch improves the readability of error messages. Removed the superflous "in" and changed "Length" to "Size".

---
  softmmu/physmem.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
softmmu/physmem.c +2 -2
index e319fb2a1e..8da184f4a6 100644
@@ -1756,15 +1756,15 @@ int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp)
 
      if (!(block->flags & RAM_RESIZEABLE)) {
          error_setg_errno(errp, EINVAL,
-                         "Length mismatch: %s: 0x" RAM_ADDR_FMT
-                         " in != 0x" RAM_ADDR_FMT, block->idstr,
+                         "Size mismatch: %s: 0x" RAM_ADDR_FMT
+                         " != 0x" RAM_ADDR_FMT, block->idstr,
                           newsize, block->used_length);

softmmu/physmem.c int qemu_ram_resize(RAMBlock *block, ram_addr_t newsize, Error **errp) · line 1770

Quoted 10 lines
softmmu/physmem.c +1 -1
          return -EINVAL;
      }
 
      if (block->max_length < newsize) {
          error_setg_errno(errp, EINVAL,
-                         "Length too large: %s: 0x" RAM_ADDR_FMT
+                         "Size too large: %s: 0x" RAM_ADDR_FMT
                           " > 0x" RAM_ADDR_FMT, block->idstr,
                           newsize, block->max_length);
          return -EINVAL;

Queued, thanks.

Paolo