[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 09/15] tests/libqos: Add pc_fw_cfg_uninit() and use it
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-ppc] [PULL 09/15] tests/libqos: Add pc_fw_cfg_uninit() and use it |
Date: |
Thu, 23 May 2019 14:43:14 +0200 |
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: Li Qiang <address@hidden>
Tested-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: Split patch, fill commit description, call uninit in malloc-pc.c]
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
---
tests/libqos/fw_cfg.h | 5 +++++
tests/libqos/malloc-pc.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/libqos/fw_cfg.h b/tests/libqos/fw_cfg.h
index 391669031a..60de81e863 100644
--- a/tests/libqos/fw_cfg.h
+++ b/tests/libqos/fw_cfg.h
@@ -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
diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
index 949a99361d..6f92ce4135 100644
--- a/tests/libqos/malloc-pc.c
+++ b/tests/libqos/malloc-pc.c
@@ -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);
}
--
2.20.1
- [Qemu-ppc] [PULL 00/15] Fw cfg 20190523 patches, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 15/15] tests: fw_cfg: add 'splash-time' test case, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 10/15] tests/fw_cfg: Free QFWCFG object after qtest has run, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 14/15] tests: fw_cfg: add 'reboot-timeout' test case, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 13/15] hw/nvram/fw_cfg: Store 'reboot-timeout' as little endian, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 12/15] tests: fw_cfg: add a function to get the fw_cfg file, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 11/15] tests: refactor fw_cfg_test, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 07/15] hw/sparc64: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 09/15] tests/libqos: Add pc_fw_cfg_uninit() and use it,
Philippe Mathieu-Daudé <=
- [Qemu-ppc] [PULL 08/15] tests/libqos: Add io_fw_cfg_uninit() and mm_fw_cfg_uninit(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 01/15] hw/nvram/fw_cfg: Add trace events, Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 02/15] hw/nvram/fw_cfg: Add fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 06/15] hw/sparc: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 04/15] hw/i386: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 05/15] hw/ppc: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/05/23
- [Qemu-ppc] [PULL 03/15] hw/i386: Extract fw_cfg definitions to local "fw_cfg.h", Philippe Mathieu-Daudé, 2019/05/23
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/15] Fw cfg 20190523 patches, Peter Maydell, 2019/05/23