From 3a5c76baf312d83cb77c8faa72c5f7a477effed0 Mon Sep 17 00:00:00 2001 From: Gabriel L. Somlo Date: Thu, 19 Mar 2015 14:20:44 -0400 Subject: fw_cfg: factor out initialization of FW_CFG_ID (rev. number) The fw_cfg documentation says this of the revision key (0x0001, FW_CFG_ID): > A 32-bit little-endian unsigned int, this item is used as an interface > revision number, and is currently set to 1 by all QEMU architectures > which expose a fw_cfg device. arm/virt doesn't. It could be argued that that's an error in "hw/arm/virt.c"; on the other hand, all of the other fw_cfg providing boards set the interface version to 1 manually, despite the device coming from the same, shared implementation. Therefore, instead of adding fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1); to arm/virt, consolidate all such existing calls in the fw_cfg initialization code. Signed-off-by: Gabriel Somlo Message-Id: <1426789244-26318-1-git-send-email-somlo@cmu.edu> Reviewed-by: Laszlo Ersek Signed-off-by: Paolo Bonzini --- hw/nvram/fw_cfg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/nvram') diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 4caf5364da..68eff77983 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -614,6 +614,7 @@ static void fw_cfg_init1(DeviceState *dev) qdev_init_nofail(dev); fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (char *)"QEMU", 4); + fw_cfg_add_i32(s, FW_CFG_ID, 1); fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16); fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NOGRAPHIC)); fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); -- cgit v1.2.3-55-g7522