diff mbox

[v4,4/7] hw/i386: Improve some of the warning messages

Message ID e81d6354fe83b9c870097428214f400f020f24ea.1499866456.git.alistair.francis@xilinx.com
State New
Headers show

Commit Message

Alistair Francis July 12, 2017, 1:57 p.m. UTC
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
---
V3:
 - Improve the messages

 hw/i386/acpi-build.c | 15 ++++++++++-----
 hw/i386/pc.c         |  7 +++----
 hw/i386/pc_q35.c     |  8 +++++---
 3 files changed, 18 insertions(+), 12 deletions(-)

Comments

Markus Armbruster July 12, 2017, 4:32 p.m. UTC | #1
Alistair Francis <alistair.francis@xilinx.com> writes:

> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
[...]
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index 1653a47f0a..c915719b0c 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -101,9 +101,11 @@ static void pc_q35_init(MachineState *machine)
>          lowmem = pcms->max_ram_below_4g;
>          if (machine->ram_size - lowmem > lowmem &&
>              lowmem & ((1ULL << 30) - 1)) {
> -            warn_report("Large machine and max_ram_below_4g(%"PRIu64
> -                        ") not a multiple of 1G; possible bad performance.",
> -                        pcms->max_ram_below_4g);
> +            warn_report("Large machine as the ram size (0x%" PRIx64 ") is more"
> +                        " then twice the size of the internal limit"

than

> +                        " (0x%" PRIx64 ") and max_ram_below_4g (%"PRIu64")"

Space between string literal and PRIu64, please.

> +                        " note a multiple of 1G; possible bad performance.",
> +                        machine->ram_size, lowmem, pcms->max_ram_below_4g);
>          }
>      }
Markus Armbruster July 12, 2017, 4:47 p.m. UTC | #2
Cc'ing maintainers.

Alistair Francis <alistair.francis@xilinx.com> writes:

> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> V3:
>  - Improve the messages
>
>  hw/i386/acpi-build.c | 15 ++++++++++-----
>  hw/i386/pc.c         |  7 +++----
>  hw/i386/pc_q35.c     |  8 +++++---
>  3 files changed, 18 insertions(+), 12 deletions(-)
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 6b7bade183..7130c7409d 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -2766,17 +2766,22 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine)
>                       ACPI_BUILD_ALIGN_SIZE);
>          if (tables_blob->len > legacy_table_size) {
>              /* Should happen only with PCI bridges and -M pc-i440fx-2.0.  */
> -            warn_report("migration may not work.");
> +            warn_report("ACPI table size %u exceeds %d bytes,"
> +                        " migration may not work",
> +                        tables_blob->len, legacy_table_size);
> +            error_printf("Try removing CPUs, NUMA nodes, memory slots"
> +                         " or PCI bridges.");
>          }
>          g_array_set_size(tables_blob, legacy_table_size);
>      } else {
>          /* Make sure we have a buffer in case we need to resize the tables. */
>          if (tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) {
>              /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots.  */
> -            warn_report("ACPI tables are larger than 64k.");
> -            warn_report("migration may not work.");
> -            warn_report("please remove CPUs, NUMA nodes, "
> -                        "memory slots or PCI bridges.");
> +            warn_report("ACPI table size %u exceeds %d bytes,"
> +                        " migration may not work",
> +                        tables_blob->len, ACPI_BUILD_TABLE_SIZE / 2);
> +            error_printf("Try removing CPUs, NUMA nodes, memory slots"
> +                         " or PCI bridges.");
>          }
>          acpi_align_size(tables_blob, ACPI_BUILD_TABLE_SIZE);
>      }
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index 465e91cc5b..36b2bb9b53 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -384,7 +384,7 @@ ISADevice *pc_find_fdc0(void)
>          warn_report("multiple floppy disk controllers with "
>                      "iobase=0x3f0 have been found");
>          error_printf("the one being picked for CMOS setup might not reflect "
> -                     "your intent\n");
> +                     "your intent");
>      }
>  
>      return state.floppy;
> @@ -2087,9 +2087,8 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
>      }
>  
>      if (value < (1ULL << 20)) {
> -        warn_report("small max_ram_below_4g(%"PRIu64
> -                    ") less than 1M.  BIOS may not work..",
> -                    value);
> +        warn_report("Only %" PRIu64 " bytes of RAM below the 4GiB boundary,"
> +                    "BIOS may not work with less than 1MiB", value);
>      }
>  
>      pcms->max_ram_below_4g = value;
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index 1653a47f0a..c915719b0c 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -101,9 +101,11 @@ static void pc_q35_init(MachineState *machine)
>          lowmem = pcms->max_ram_below_4g;
>          if (machine->ram_size - lowmem > lowmem &&
>              lowmem & ((1ULL << 30) - 1)) {
> -            warn_report("Large machine and max_ram_below_4g(%"PRIu64
> -                        ") not a multiple of 1G; possible bad performance.",
> -                        pcms->max_ram_below_4g);
> +            warn_report("Large machine as the ram size (0x%" PRIx64 ") is more"
> +                        " then twice the size of the internal limit"
> +                        " (0x%" PRIx64 ") and max_ram_below_4g (%"PRIu64")"
> +                        " note a multiple of 1G; possible bad performance.",
> +                        machine->ram_size, lowmem, pcms->max_ram_below_4g);
>          }
>      }
diff mbox

Patch

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 6b7bade183..7130c7409d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2766,17 +2766,22 @@  void acpi_build(AcpiBuildTables *tables, MachineState *machine)
                      ACPI_BUILD_ALIGN_SIZE);
         if (tables_blob->len > legacy_table_size) {
             /* Should happen only with PCI bridges and -M pc-i440fx-2.0.  */
-            warn_report("migration may not work.");
+            warn_report("ACPI table size %u exceeds %d bytes,"
+                        " migration may not work",
+                        tables_blob->len, legacy_table_size);
+            error_printf("Try removing CPUs, NUMA nodes, memory slots"
+                         " or PCI bridges.");
         }
         g_array_set_size(tables_blob, legacy_table_size);
     } else {
         /* Make sure we have a buffer in case we need to resize the tables. */
         if (tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) {
             /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots.  */
-            warn_report("ACPI tables are larger than 64k.");
-            warn_report("migration may not work.");
-            warn_report("please remove CPUs, NUMA nodes, "
-                        "memory slots or PCI bridges.");
+            warn_report("ACPI table size %u exceeds %d bytes,"
+                        " migration may not work",
+                        tables_blob->len, ACPI_BUILD_TABLE_SIZE / 2);
+            error_printf("Try removing CPUs, NUMA nodes, memory slots"
+                         " or PCI bridges.");
         }
         acpi_align_size(tables_blob, ACPI_BUILD_TABLE_SIZE);
     }
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 465e91cc5b..36b2bb9b53 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -384,7 +384,7 @@  ISADevice *pc_find_fdc0(void)
         warn_report("multiple floppy disk controllers with "
                     "iobase=0x3f0 have been found");
         error_printf("the one being picked for CMOS setup might not reflect "
-                     "your intent\n");
+                     "your intent");
     }
 
     return state.floppy;
@@ -2087,9 +2087,8 @@  static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
     }
 
     if (value < (1ULL << 20)) {
-        warn_report("small max_ram_below_4g(%"PRIu64
-                    ") less than 1M.  BIOS may not work..",
-                    value);
+        warn_report("Only %" PRIu64 " bytes of RAM below the 4GiB boundary,"
+                    "BIOS may not work with less than 1MiB", value);
     }
 
     pcms->max_ram_below_4g = value;
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 1653a47f0a..c915719b0c 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -101,9 +101,11 @@  static void pc_q35_init(MachineState *machine)
         lowmem = pcms->max_ram_below_4g;
         if (machine->ram_size - lowmem > lowmem &&
             lowmem & ((1ULL << 30) - 1)) {
-            warn_report("Large machine and max_ram_below_4g(%"PRIu64
-                        ") not a multiple of 1G; possible bad performance.",
-                        pcms->max_ram_below_4g);
+            warn_report("Large machine as the ram size (0x%" PRIx64 ") is more"
+                        " then twice the size of the internal limit"
+                        " (0x%" PRIx64 ") and max_ram_below_4g (%"PRIu64")"
+                        " note a multiple of 1G; possible bad performance.",
+                        machine->ram_size, lowmem, pcms->max_ram_below_4g);
         }
     }