[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/15] tests/libqos: Add io_fw_cfg_uninit() and mm_fw
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PULL 08/15] tests/libqos: Add io_fw_cfg_uninit() and mm_fw_cfg_uninit() |
Date: |
Thu, 23 May 2019 14:43:13 +0200 |
The mm_fw_cfg_init() allocates a QFWCFG object,
add mm_fw_cfg_uninit() to deallocate it.
Similarly with io_fw_cfg_init(), add io_fw_cfg_uninit().
Signed-off-by: Li Qiang <address@hidden>
Tested-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
[PMD: Split patch, filled commit description]
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
---
tests/libqos/fw_cfg.c | 10 ++++++++++
tests/libqos/fw_cfg.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c
index d0889d1e22..c6839c53c8 100644
--- a/tests/libqos/fw_cfg.c
+++ b/tests/libqos/fw_cfg.c
@@ -81,6 +81,11 @@ QFWCFG *mm_fw_cfg_init(QTestState *qts, uint64_t base)
return fw_cfg;
}
+void mm_fw_cfg_uninit(QFWCFG *fw_cfg)
+{
+ g_free(fw_cfg);
+}
+
static void io_fw_cfg_select(QFWCFG *fw_cfg, uint16_t key)
{
qtest_outw(fw_cfg->qts, fw_cfg->base, key);
@@ -107,3 +112,8 @@ QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base)
return fw_cfg;
}
+
+void io_fw_cfg_uninit(QFWCFG *fw_cfg)
+{
+ g_free(fw_cfg);
+}
diff --git a/tests/libqos/fw_cfg.h b/tests/libqos/fw_cfg.h
index 0353416af0..391669031a 100644
--- a/tests/libqos/fw_cfg.h
+++ b/tests/libqos/fw_cfg.h
@@ -33,7 +33,9 @@ uint32_t qfw_cfg_get_u32(QFWCFG *fw_cfg, uint16_t key);
uint64_t qfw_cfg_get_u64(QFWCFG *fw_cfg, uint16_t key);
QFWCFG *mm_fw_cfg_init(QTestState *qts, uint64_t base);
+void mm_fw_cfg_uninit(QFWCFG *fw_cfg);
QFWCFG *io_fw_cfg_init(QTestState *qts, uint16_t base);
+void io_fw_cfg_uninit(QFWCFG *fw_cfg);
static inline QFWCFG *pc_fw_cfg_init(QTestState *qts)
{
--
2.20.1
- [Qemu-devel] [PULL 00/15] Fw cfg 20190523 patches, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 15/15] tests: fw_cfg: add 'splash-time' test case, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 14/15] tests: fw_cfg: add 'reboot-timeout' test case, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 13/15] hw/nvram/fw_cfg: Store 'reboot-timeout' as little endian, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 12/15] tests: fw_cfg: add a function to get the fw_cfg file, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 11/15] tests: refactor fw_cfg_test, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 10/15] tests/fw_cfg: Free QFWCFG object after qtest has run, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 09/15] tests/libqos: Add pc_fw_cfg_uninit() and use it, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 08/15] tests/libqos: Add io_fw_cfg_uninit() and mm_fw_cfg_uninit(),
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PULL 06/15] hw/sparc: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 07/15] hw/sparc64: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 05/15] hw/ppc: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 02/15] hw/nvram/fw_cfg: Add fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 04/15] hw/i386: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 03/15] hw/i386: Extract fw_cfg definitions to local "fw_cfg.h", Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-devel] [PULL 01/15] hw/nvram/fw_cfg: Add trace events, Philippe Mathieu-Daudé, 2019/05/23
- Re: [Qemu-devel] [PULL 00/15] Fw cfg 20190523 patches, Peter Maydell, 2019/05/23