From patchwork Sun Jul 7 20:20:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 257425 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DA63C2C009A for ; Mon, 8 Jul 2013 06:42:53 +1000 (EST) Received: from localhost ([::1]:34012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvvQg-0006nK-QJ for incoming@patchwork.ozlabs.org; Sun, 07 Jul 2013 16:19:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvvQ4-0006dz-KM for qemu-devel@nongnu.org; Sun, 07 Jul 2013 16:18:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UvvQ2-00037M-5M for qemu-devel@nongnu.org; Sun, 07 Jul 2013 16:18:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UvvQ1-00037B-Te for qemu-devel@nongnu.org; Sun, 07 Jul 2013 16:18:50 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r67KIl19002932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 7 Jul 2013 16:18:47 -0400 Received: from redhat.com (vpn1-7-187.ams2.redhat.com [10.36.7.187]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id r67KIiBj009734; Sun, 7 Jul 2013 16:18:45 -0400 Date: Sun, 7 Jul 2013 23:20:00 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1373228271-31223-9-git-send-email-mst@redhat.com> References: <1373228271-31223-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1373228271-31223-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Hu Tao , Anthony Liguori , Markus Armbruster Subject: [Qemu-devel] [PULL v4 08/18] pvpanic: fix fwcfg for big endian hosts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 83ed226..792d8e4 100644 --- a/hw/misc/pvpanic.c +++ b/hw/misc/pvpanic.c @@ -104,10 +104,11 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp) static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg) { PVPanicState *s = ISA_PVPANIC_DEVICE(dev); + uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port)); + *pvpanic_port = cpu_to_le16(s->ioport); - 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)); } void pvpanic_init(ISABus *bus)