pvpanic: fix fwcfg for big endian hosts
Convert port number to little endian when exposing it in fw cfg. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
		
							parent
							
								
									bc3e6a0d6c
								
							
						
					
					
						commit
						fea7d5966a
					
				| 
						 | 
					@ -104,10 +104,11 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp)
 | 
				
			||||||
static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)
 | 
					static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
 | 
					    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",
 | 
					    fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port,
 | 
				
			||||||
                    g_memdup(&s->ioport, sizeof(s->ioport)),
 | 
					                    sizeof(*pvpanic_port));
 | 
				
			||||||
                    sizeof(s->ioport));
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pvpanic_init(ISABus *bus)
 | 
					void pvpanic_init(ISABus *bus)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue