From nobody Sun May 19 12:45:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1691183053; cv=none; d=zohomail.com; s=zohoarc; b=YC6vAQ76uiOSxx6eQVxIidxt5lmQ3J9mI1Eme+WOg/S/GHOXw9f1CN7I61vxmj6g9hpE+a+DRZtHi7/ecKIXcQOIlzmId4yK+UvgcOK//GCsrY9l4atHGlixh6yjIIBgolluyWA3W9NVX0yWdcaG1ESxAE+o+EetNaxArkANcz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691183053; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=zFpch+8P3tV3H5HfrDlQXc1T5jeaQVV8OZf/WDGUGCc=; b=XCffBVeUzuCo+VQNEsMQWcIR2V9b7KSYau7oLuU8HpnMBpaXJc/FD1Bl6blmZlC+fMZg8voORB2u4LOCylAx2jDterW25hzWddvs/rMCBMWcNaAIwRlalfQj06JwjuTCqEp3pOZt3asLZCqRxbCzvjCGd0TP3qdOfayD3n7MAaI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1691183053311412.7660624237096; Fri, 4 Aug 2023 14:04:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qS1xm-00028o-QR; Fri, 04 Aug 2023 17:03:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qS02y-00046R-0s for qemu-devel@nongnu.org; Fri, 04 Aug 2023 15:01:12 -0400 Received: from mail-il1-x12b.google.com ([2607:f8b0:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qS02v-0001RR-2t for qemu-devel@nongnu.org; Fri, 04 Aug 2023 15:01:11 -0400 Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3492c49c649so8666645ab.3 for ; Fri, 04 Aug 2023 12:01:08 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id c16-20020a92d3d0000000b00342093347d8sm814048ilh.76.2023.08.04.12.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 12:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691175666; x=1691780466; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zFpch+8P3tV3H5HfrDlQXc1T5jeaQVV8OZf/WDGUGCc=; b=EKjMW6KLlXqiudELoM4kboJ+S9E4avUoi+6m6Sf/Z3oHXQzoECAr/rhB700UOuUuiv l/921Om6qJG8XngSkCBHqMg5GHkLHbXzIv3PUjAsd2fKklIXo21/N3eBHqzWQMxdrDW/ fSUMDHZJ75xGO5L5UwJOpbSn9ofuh1Dv/79KH5SlKH3PeiKxsJLRMP8rexGbHkOopkea Vy/5vQoSmWJSbTgXeuhm5KzxcMEIJ2AiBEv/AbuPwfbf6bq4tJ3yZ21vEl6cnmso1TQw BYvfaDVFJaXW2FFW4WNiGOca8Q1hVdwmf+fF7CarfqzGzYy0zrAFhMugbiasYEa/6hI0 L3aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691175666; x=1691780466; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zFpch+8P3tV3H5HfrDlQXc1T5jeaQVV8OZf/WDGUGCc=; b=LA9Sezd0ryNuE93Mq8meiJpeO+T2RC5sT+Fy0SZR63opwGOH7YCr7XbdOggxKWDL1c ENTz++EBlDCHGYpyuaiRCozxCr93+3ZtETjYSRx+oGWOOaMIlsaLnXYdOe2Gc/PfqLtT deX+kfDkrPHEnpDGz96xQwCDns+A53Mz9CaROzXO36lfWXCmRlwEyFiHi+hsF0aKCLzr CBWEkWf0n1ga5eVz42kFUb/SVOUyOqKkyAYG2uBAD7SORihd4e3KOA9sdypPfYXRqtf3 BKPs3/hnAVyyqS3HENQqWxJLwc64Dr1SFspwsmrRblMCVZs8lCfdF6bn1ANxvKKwHVqu KtiQ== X-Gm-Message-State: AOJu0Ywgr/OmY9hbquNmwhnaz/jc4LF0kFWzoed+JD+TjtFqDYKuvofn I4QWsF8lvv/WvJ1fl3ozGUkhFkBn8vj6zw== X-Google-Smtp-Source: AGHT+IHpb1Q4xU6qbK+YnfGS+qE+Q16JDY7S2YlRKf0CPzv6ytDTCqa//vu/JrVqo26KB96O0I3lmw== X-Received: by 2002:a92:cdaf:0:b0:348:d0e5:dbc8 with SMTP id g15-20020a92cdaf000000b00348d0e5dbc8mr4191817ild.31.1691175666120; Fri, 04 Aug 2023 12:01:06 -0700 (PDT) From: Jim Cromie To: qemu-devel@nongnu.org Cc: Jim Cromie Subject: [PATCH] print memory in MB units in initrd-too-large errmsg Date: Fri, 4 Aug 2023 13:01:01 -0600 Message-ID: <20230804190101.759753-1-jim.cromie@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::12b; envelope-from=jim.cromie@gmail.com; helo=mail-il1-x12b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 04 Aug 2023 17:03:56 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1691183054172100001 Content-Type: text/plain; charset="utf-8" Change 2 error messages to display sizes in MB, not bytes. qemu: initrd is too large, cannot support this. (max: 2047 MB, need 5833 MB) Also, distinguish 2 sites by adding "it" and "this" respectively. This tells a careful reader that the error above is from the 2nd size check. With MB displayed, I have to ask: is it coincidence that max =3D=3D 2048-1 ? Signed-off-by: Jim Cromie --- hw/i386/x86.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index a88a126123..0677fe2fd1 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -878,9 +878,9 @@ void x86_load_linux(X86MachineState *x86ms, initrd_size =3D g_mapped_file_get_length(mapped_file); initrd_max =3D x86ms->below_4g_mem_size - acpi_data_size -= 1; if (initrd_size >=3D initrd_max) { - fprintf(stderr, "qemu: initrd is too large, cannot sup= port." - "(max: %"PRIu32", need %"PRId64")\n", - initrd_max, (uint64_t)initrd_size); + fprintf(stderr, "qemu: initrd is too large, cannot sup= port it. " + "(max: %"PRIu32" MB, need %"PRId64" MB)\n", + initrd_max>>20, (uint64_t)initrd_size>>20); exit(1); } =20 @@ -1023,9 +1023,9 @@ void x86_load_linux(X86MachineState *x86ms, initrd_data =3D g_mapped_file_get_contents(mapped_file); initrd_size =3D g_mapped_file_get_length(mapped_file); if (initrd_size >=3D initrd_max) { - fprintf(stderr, "qemu: initrd is too large, cannot support." - "(max: %"PRIu32", need %"PRId64")\n", - initrd_max, (uint64_t)initrd_size); + fprintf(stderr, "qemu: initrd is too large, cannot support thi= s. " + "(max: %"PRIu32" MB, need %"PRId64" MB)\n", + initrd_max>>20, (uint64_t)initrd_size>>20); exit(1); } =20 --=20 2.41.0