thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
218e99
From c5760d0c0f29b8ae540b3ca553f461874447c32f Mon Sep 17 00:00:00 2001
218e99
From: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
Date: Wed, 6 Nov 2013 16:32:32 +0100
218e99
Subject: [PATCH 73/81] pvpanic: fix fwcfg for big endian hosts
218e99
218e99
RH-Author: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
Message-id: <1383755557-21590-5-git-send-email-marcel.a@redhat.com>
218e99
Patchwork-id: 55549
218e99
O-Subject: [RHEL-7 qemu-kvm PATCH v3 4/9] pvpanic: fix fwcfg for big endian hosts
218e99
Bugzilla: 990601
218e99
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
218e99
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
218e99
218e99
From: "Michael S. Tsirkin" <mst@redhat.com>
218e99
218e99
Convert port number to little endian when
218e99
exposing it in fw cfg.
218e99
218e99
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
218e99
(cherry picked from commit fea7d5966a54a5e5400cd38897a95ea576b5af4d)
218e99
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
218e99
---
218e99
 hw/misc/pvpanic.c | 7 ++++---
218e99
 1 file changed, 4 insertions(+), 3 deletions(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 hw/misc/pvpanic.c |    7 ++++---
218e99
 1 files changed, 4 insertions(+), 3 deletions(-)
218e99
218e99
diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
218e99
index 8263225..1aab787 100644
218e99
--- a/hw/misc/pvpanic.c
218e99
+++ b/hw/misc/pvpanic.c
218e99
@@ -99,10 +99,11 @@ static int pvpanic_isa_initfn(ISADevice *dev)
218e99
 static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)
218e99
 {
218e99
     PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
218e99
+    uint16_t *pvpanic_port = g_malloc(sizeof(*pvpanic_port));
218e99
+    *pvpanic_port = cpu_to_le16(s->ioport);
218e99
 
218e99
-    fw_cfg_add_file(fw_cfg, "etc/pvpanic-port",
218e99
-                    g_memdup(&s->ioport, sizeof(s->ioport)),
218e99
-                    sizeof(s->ioport));
218e99
+    fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port,
218e99
+                    sizeof(*pvpanic_port));
218e99
 }
218e99
 
218e99
 void pvpanic_init(ISABus *bus)
218e99
-- 
218e99
1.7.1
218e99