From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoKAg-0008TW-84 for qemu-devel@nongnu.org; Sun, 16 Jun 2013 17:07:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoKAY-0000rZ-5w for qemu-devel@nongnu.org; Sun, 16 Jun 2013 17:07:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoK2T-0006Nx-I2 for qemu-devel@nongnu.org; Sun, 16 Jun 2013 16:59:05 -0400 Date: Sun, 16 Jun 2013 23:59:49 +0300 From: "Michael S. Tsirkin" Message-ID: <1371416189-29563-2-git-send-email-mst@redhat.com> References: <1371416189-29563-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1371416189-29563-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] pvpanic: fix fwcfg for big endian hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hu Tao , Anthony Liguori , Markus Armbruster Convert port number to little endian when exposing it in fw cfg. Signed-off-by: Michael S. Tsirkin --- hw/misc/pvpanic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c index 9ed9897..151eefe 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -106,12 +106,13 @@ int pvpanic_init(ISABus *bus) ISADevice *dev = isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE); PVPanicState *s = ISA_PVPANIC_DEVICE(dev); FWCfgState *fw_cfg = fw_cfg_find(); + uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port)); + *pvpanic_port = cpu_to_le16(s->ioport); assert(fw_cfg); - fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", - g_memdup(&s->ioport, sizeof(s->ioport)), - sizeof(s->ioport)); + fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port, + sizeof(*pvpanic_port)); return 0; } -- MST