[{"id":1765180,"web_url":"http://patchwork.ozlabs.org/comment/1765180/","msgid":"<877ex9im6t.fsf@dusky.pond.sub.org>","list_archive_url":null,"date":"2017-09-08T09:17:30","subject":"Re: [Qemu-devel] [PATCH v3 5/7] General warn report fixups","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/","name":"Markus Armbruster","email":"armbru@redhat.com"},"content":"Alistair Francis <alistair.francis@xilinx.com> writes:\n\n> Tidy up some of the warn_report() messages after having converted them\n> to use warn_report().\n>\n> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>\n> ---\n>\n>  block/vvfat.c               | 3 +--\n>  hw/arm/vexpress.c           | 2 +-\n>  hw/i386/xen/xen-mapcache.c  | 2 +-\n>  hw/mips/mips_malta.c        | 4 ++--\n>  hw/mips/mips_r4k.c          | 3 +--\n>  hw/s390x/s390-virtio.c      | 7 ++++---\n>  net/hub.c                   | 6 ++----\n>  net/net.c                   | 5 +++--\n>  target/i386/hax-mem.c       | 5 ++---\n>  target/ppc/translate_init.c | 3 +--\n>  ui/keymaps.c                | 3 +--\n>  11 files changed, 19 insertions(+), 24 deletions(-)\n>\n> diff --git a/block/vvfat.c b/block/vvfat.c\n> index 04801f3136..55f416868a 100644\n> --- a/block/vvfat.c\n> +++ b/block/vvfat.c\n> @@ -1227,8 +1227,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,\n>  \n>      switch (s->fat_type) {\n>      case 32:\n> -        warn_report(\"FAT32 has not been tested. \"\n> -                    \"You are welcome to do so!\");\n> +        warn_report(\"FAT32 has not been tested. You are welcome to do so!\");\n>          break;\n>      case 16:\n>      case 12:\n> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c\n> index 2445eb4408..fa53cf96b4 100644\n> --- a/hw/arm/vexpress.c\n> +++ b/hw/arm/vexpress.c\n> @@ -492,7 +492,7 @@ static void vexpress_modify_dtb(const struct arm_boot_info *info, void *fdt)\n>           * happen with older device tree blobs.\n>           */\n>          warn_report(\"couldn't find interrupt controller in \"\n> -                    \"dtb; will not include virtio-mmio devices in the dtb.\");\n> +                    \"dtb; will not include virtio-mmio devices in the dtb\");\n>      } else {\n>          int i;\n>          const hwaddr *map = daughterboard->motherboard_map;\n> diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c\n> index 91a4fd6984..baab93b614 100644\n> --- a/hw/i386/xen/xen-mapcache.c\n> +++ b/hw/i386/xen/xen-mapcache.c\n> @@ -127,7 +127,7 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque)\n>  \n>          if (rlimit_as.rlim_max != RLIM_INFINITY) {\n>              warn_report(\"QEMU's maximum size of virtual\"\n> -                        \" memory is not infinity.\");\n> +                        \" memory is not infinity\");\n>          }\n>          if (rlimit_as.rlim_max < MCACHE_MAX_SIZE + NON_MCACHE_MEMORY_SIZE) {\n>              mapcache->max_mcache_size = rlimit_as.rlim_max -\n> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c\n> index 233e2ee802..b8ba684c93 100644\n> --- a/hw/mips/mips_malta.c\n> +++ b/hw/mips/mips_malta.c\n> @@ -216,8 +216,8 @@ static void generate_eeprom_spd(uint8_t *eeprom, ram_addr_t ram_size)\n>      }\n>  \n>      if (ram_size) {\n> -        warn_report(\"SPD cannot represent final %dMB\"\n> -                    \" of SDRAM\", (int)ram_size);\n> +        warn_report(\"SPD cannot represent final \"RAM_ADDR_FMT\"MB\"\n> +                    \" of SDRAM\", ram_size);\n\nStyle nitpick: easier to read with spaces around RAM_ADDR_FMT.\n\n>      }\n>  \n>      /* fill in SPD memory information */\n> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c\n> index 6ffb88fd70..b48a4d72ac 100644\n> --- a/hw/mips/mips_r4k.c\n> +++ b/hw/mips/mips_r4k.c\n> @@ -254,8 +254,7 @@ void mips_r4k_init(MachineState *machine)\n>  \t}\n>      } else if (!qtest_enabled()) {\n>          /* not fatal */\n> -        warn_report(\"could not load MIPS bios '%s'\",\n> -                    bios_name);\n> +        warn_report(\"could not load MIPS bios '%s'\", bios_name);\n>      }\n>      g_free(filename);\n>  \n> diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c\n> index 964df517b4..946f23fc23 100644\n> --- a/hw/s390x/s390-virtio.c\n> +++ b/hw/s390x/s390-virtio.c\n> @@ -146,9 +146,10 @@ void gtod_save(QEMUFile *f, void *opaque)\n>  \n>      r = s390_get_clock(&tod_high, &tod_low);\n>      if (r) {\n> -        warn_report(\"Unable to get guest clock for migration. \"\n> -                    \"Error code %d. Guest clock will not be migrated \"\n> -                    \"which could cause the guest to hang.\", r);\n> +        warn_report(\"Unable to get guest clock for migration: %s\",\n> +                    strerror(-r));\n> +        error_printf(\"Guest clock will not be migrated \"\n> +                     \"which could cause the guest to hang.\");\n>          qemu_put_byte(f, S390_TOD_CLOCK_VALUE_MISSING);\n>          return;\n>      }\n\ngtod_load() needs a similar improvement.\n\n> diff --git a/net/hub.c b/net/hub.c\n> index 745a2168a1..14b4eec68f 100644\n> --- a/net/hub.c\n> +++ b/net/hub.c\n> @@ -310,8 +310,7 @@ void net_hub_check_clients(void)\n>          QLIST_FOREACH(port, &hub->ports, next) {\n>              peer = port->nc.peer;\n>              if (!peer) {\n> -                warn_report(\"hub port %s has no peer\",\n> -                            port->nc.name);\n> +                warn_report(\"hub port %s has no peer\", port->nc.name);\n>                  continue;\n>              }\n>  \n> @@ -334,8 +333,7 @@ void net_hub_check_clients(void)\n>              warn_report(\"vlan %d with no nics\", hub->id);\n>          }\n>          if (has_nic && !has_host_dev) {\n> -            warn_report(\"vlan %d is not connected to host network\",\n> -                        hub->id);\n> +            warn_report(\"vlan %d is not connected to host network\", hub->id);\n>          }\n>      }\n>  }\n> diff --git a/net/net.c b/net/net.c\n> index 45ab2a1a02..5e5e27f7e0 100644\n> --- a/net/net.c\n> +++ b/net/net.c\n> @@ -1482,8 +1482,9 @@ void net_check_clients(void)\n>      QTAILQ_FOREACH(nc, &net_clients, next) {\n>          if (!nc->peer) {\n>              warn_report(\"%s %s has no peer\",\n> -                        nc->info->type == NET_CLIENT_DRIVER_NIC ?\n> -                        \"nic\" : \"netdev\", nc->name);\n> +                        nc->info->type == NET_CLIENT_DRIVER_NIC\n> +                        ? \"nic\" : \"netdev\",\n> +                        nc->name);\n>          }\n>      }\n>  \n> diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c\n> index 756f2dd268..ad1248fece 100644\n> --- a/target/i386/hax-mem.c\n> +++ b/target/i386/hax-mem.c\n> @@ -178,9 +178,8 @@ static void hax_process_section(MemoryRegionSection *section, uint8_t flags)\n>      if (!memory_region_is_ram(mr)) {\n>          if (memory_region_is_romd(mr)) {\n>              /* HAXM kernel module does not support ROMD yet  */\n> -            warn_report(\"Ignoring ROMD region 0x%016\" PRIx64\n> -                        \"->0x%016\" PRIx64 \"\", __func__, start_pa,\n> -                        start_pa + size);\n> +            warn_report(\"Ignoring ROMD region 0x%016\"PRIx64\"->0x%016\"PRIx64\"\",\n> +                        start_pa, start_pa + size);\n\nThe last \"\" is useless.  Suggest to drop it.\n\nWould be easier to read with spaces around PRIx64.\n\n>          }\n>          return;\n>      }\n> diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c\n> index 989c104b76..be09aadfd9 100644\n> --- a/target/ppc/translate_init.c\n> +++ b/target/ppc/translate_init.c\n> @@ -9230,8 +9230,7 @@ static void init_ppc_proc(PowerPCCPU *cpu)\n>      }\n>  #endif\n>      if (env->check_pow == NULL) {\n> -        warn_report(\"no power management check handler \"\n> -                    \"registered.\"\n> +        warn_report(\"no power management check handler registered.\"\n>                      \" Attempt QEMU to crash very soon !\");\n>      }\n>  }\n> diff --git a/ui/keymaps.c b/ui/keymaps.c\n> index a6cefdaff9..f9762d1497 100644\n> --- a/ui/keymaps.c\n> +++ b/ui/keymaps.c\n> @@ -198,8 +198,7 @@ int keysym2scancode(void *kbd_layout, int keysym)\n>      if (keysym < MAX_NORMAL_KEYCODE) {\n>          if (k->keysym2keycode[keysym] == 0) {\n>              trace_keymap_unmapped(keysym);\n> -            warn_report(\"no scancode found for keysym %d\",\n> -                        keysym);\n> +            warn_report(\"no scancode found for keysym %d\", keysym);\n>          }\n>          return k->keysym2keycode[keysym];\n>      } else {\n\nImprove gtod_load() like you improved gtod_save() to earn my\nReviewed-by: Markus Armbruster <armbru@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=armbru@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xpWvx1wDKz9s82\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 19:18:37 +1000 (AEST)","from localhost ([::1]:44037 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dqFQp-0006Mw-3d\n\tfor incoming@patchwork.ozlabs.org; Fri, 08 Sep 2017 05:18:35 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52619)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1dqFPv-0006CM-Bg\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 05:17:44 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1dqFPq-0000hW-3q\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 05:17:39 -0400","from mx1.redhat.com ([209.132.183.28]:57970)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1dqFPp-0000ge-Qf\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 05:17:34 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D4126356DC;\n\tFri,  8 Sep 2017 09:17:32 +0000 (UTC)","from blackfin.pond.sub.org (ovpn-116-75.ams2.redhat.com\n\t[10.36.116.75])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 6DB535C8B2;\n\tFri,  8 Sep 2017 09:17:32 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid E885F1138645; Fri,  8 Sep 2017 11:17:30 +0200 (CEST)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D4126356DC","From":"Markus Armbruster <armbru@redhat.com>","To":"Alistair Francis <alistair.francis@xilinx.com>","References":"<cover.1504228916.git.alistair.francis@xilinx.com>\n\t<cbc16f480d26b40e12cd03a992d89830f271182a.1504228916.git.alistair.francis@xilinx.com>","Date":"Fri, 08 Sep 2017 11:17:30 +0200","In-Reply-To":"<cbc16f480d26b40e12cd03a992d89830f271182a.1504228916.git.alistair.francis@xilinx.com>\n\t(Alistair Francis's message of \"Fri, 1 Sep 2017 09:51:21 -0700\")","Message-ID":"<877ex9im6t.fsf@dusky.pond.sub.org>","User-Agent":"Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)","MIME-Version":"1.0","Content-Type":"text/plain","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tFri, 08 Sep 2017 09:17:33 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 5/7] General warn report fixups","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"alistair23@gmail.com, qemu-devel@nongnu.org, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]