From nobody Mon Nov 10 12:52:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=163.com ARC-Seal: i=1; a=rsa-sha256; t=1556115827; cv=none; d=zoho.com; s=zohoarc; b=WPYkHPyPHTOW6sFsIw9xJBZ4OEWiZKPHsLrDtsf+sxYGG37scZgD20FmnBQpSFf+9uSYgUrRpO2z/z/4y406y5FHrIR0vRTcqcjwnrnc5ZRPtXrgpodCkn4pXZ4J5cvE9s95T+lh/cHhJ/V5RlalKr16HQjwF73vjdLxvummO0A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556115827; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=BBctNjDbfh7h2nNE/VnZPLT9nVBtuY81kv5/qyNenhU=; b=jGUM79kLJ+GIw87wSQJK78wuE858YOHT+YEXkQxtlItsxsdCA3fxfwHYd3jL6Wqy5pY54YfIl19qp1Iz/8CyORR25sWveX1P/QMppH4ByWoWYEXFpOcnNdVVSYNFkJJ7S4OedsD71VSKvGKqcJb8tAnPPIjOAVqxjCjNjAlcjuI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556115827390859.4355118675843; Wed, 24 Apr 2019 07:23:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:42491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJIoJ-0000j4-Ci for importer@patchew.org; Wed, 24 Apr 2019 10:23:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJIfe-0002aF-9o for qemu-devel@nongnu.org; Wed, 24 Apr 2019 10:14:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJIY2-0006hS-OE for qemu-devel@nongnu.org; Wed, 24 Apr 2019 10:06:56 -0400 Received: from m12-14.163.com ([220.181.12.14]:54537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJIY1-0006fH-8q for qemu-devel@nongnu.org; Wed, 24 Apr 2019 10:06:54 -0400 Received: from localhost.localdomain (unknown [115.200.201.0]) by smtp10 (Coremail) with SMTP id DsCowAC3Ayl0bcBcrks9CA--.5531S5; Wed, 24 Apr 2019 22:06:51 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=BBctNjDbfh7h2nNE/V nZPLT9nVBtuY81kv5/qyNenhU=; b=E9B7PVevEE46QOVsoSuKAu2BWPUWTKmFIL KCs1c+wGZyuVOcecxS8LW/UjeuUIzzreCsRxcMIpGgVTa30lPO2z/unRoMK0XEHl rDzJCFqdZcj2LqLwBOJ7hUfuDYwb/8t0xPeb54vByUS/1rzR59DElpDGSy4ya0x+ Ioa3xRn0w= From: Li Qiang To: philmd@redhat.com, lersek@redhat.com, kraxel@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com Date: Wed, 24 Apr 2019 07:06:41 -0700 Message-Id: <20190424140643.62457-4-liq3ea@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190424140643.62457-1-liq3ea@163.com> References: <20190424140643.62457-1-liq3ea@163.com> X-CM-TRANSID: DsCowAC3Ayl0bcBcrks9CA--.5531S5 X-Coremail-Antispam: 1Uf129KBjvdXoWrKr45Wr1DZF17CFyxJr45Awb_yoWfCFc_uF W3Aw1rW3y7AwnFkF9YyF15Aw15Ka4UXF9Ikrn7KFyqy34UX39Fkw4Iqa9F9w1rWFWUCr9x Ca95Xr1DCa1v9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8IzuJUUUUU== X-Originating-IP: [115.200.201.0] X-CM-SenderInfo: 5oltjvrd6rljoofrz/xtbBLxWgbVUMI+dgjQAAsH X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 220.181.12.14 Subject: [Qemu-devel] [PATCH v2 3/5] fw_cfg: reboot: store reboot-timeout as little endian X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , liq3ea@gmail.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" So that if the guest and host endianess does not match it can still work as expection. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 5c3a46ce6f..df4242fc9c 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -178,6 +178,7 @@ static void fw_cfg_reboot(FWCfgState *s) { const char *reboot_timeout =3D NULL; int64_t rt_val =3D -1; + uint32_t rt_le32; =20 /* get user configuration */ QemuOptsList *plist =3D qemu_find_opts("boot-opts"); @@ -194,7 +195,8 @@ static void fw_cfg_reboot(FWCfgState *s) } } =20 - fw_cfg_add_file(s, "etc/boot-fail-wait", g_memdup(&rt_val, 4), 4); + rt_le32 =3D cpu_to_le32(rt_val); + fw_cfg_add_file(s, "etc/boot-fail-wait", g_memdup(&rt_le32, 4), 4); } =20 static void fw_cfg_write(FWCfgState *s, uint8_t value) --=20 2.17.1