mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
fw_cfg: add API to find FW cfg object
Remove some code duplication by adding a function to look up the fw cfg file. This way, we don't need to duplicate same strings everywhere. Use by both fw cfg and pvpanic device. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
45936c8b79
commit
600c60b76d
3 changed files with 15 additions and 4 deletions
|
@ -96,7 +96,7 @@ static int pvpanic_isa_initfn(ISADevice *dev)
|
|||
isa_register_ioport(dev, &s->io, s->ioport);
|
||||
|
||||
if (!port_configured) {
|
||||
fw_cfg = object_resolve_path("/machine/fw_cfg", NULL);
|
||||
fw_cfg = fw_cfg_find();
|
||||
if (fw_cfg) {
|
||||
fw_cfg_add_file(fw_cfg, "etc/pvpanic-port",
|
||||
g_memdup(&s->ioport, sizeof(s->ioport)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue