提交 fea7d596 编写于 作者: M Michael S. Tsirkin

pvpanic: fix fwcfg for big endian hosts

Convert port number to little endian when
exposing it in fw cfg.
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 bc3e6a0d
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册