Commit 65461d12 authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé
Browse files

tests/libqos: Add pc_fw_cfg_uninit() and use it



The pc_fw_cfg_init() function allocates an IO QFWCFG object.
Add the pc_fw_cfg_uninit() function to deallocate it (and use it).

Signed-off-by: default avatarLi Qiang <liq3ea@163.com>
Tested-by: default avatarThomas Huth <thuth@redhat.com>
Message-Id: <20190424140643.62457-2-liq3ea@163.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
[PMD: Split patch, fill commit description, call uninit in malloc-pc.c]
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
parent 0729d833
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -42,4 +42,9 @@ static inline QFWCFG *pc_fw_cfg_init(QTestState *qts)
    return io_fw_cfg_init(qts, 0x510);
}

static inline void pc_fw_cfg_uninit(QFWCFG *fw_cfg)
{
    io_fw_cfg_uninit(fw_cfg);
}

#endif
+1 −1
Original line number Diff line number Diff line
@@ -29,5 +29,5 @@ void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), PAGE_SIZE);

    /* clean-up */
    g_free(fw_cfg);
    pc_fw_cfg_uninit(fw_cfg);
}