[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [PATCH v2 6/6] tests/device-plug: Add memory unplug req
From: |
Greg Kurz |
Subject: |
Re: [qemu-s390x] [PATCH v2 6/6] tests/device-plug: Add memory unplug request test for spapr |
Date: |
Fri, 15 Feb 2019 17:03:59 +0100 |
On Fri, 15 Feb 2019 14:30:05 +0100
David Hildenbrand <address@hidden> wrote:
> We can easily test this, just like PCI.
>
> Signed-off-by: David Hildenbrand <address@hidden>
> ---
Reviewed-by: Greg Kurz <address@hidden>
> tests/device-plug-test.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/tests/device-plug-test.c b/tests/device-plug-test.c
> index ec6cb5de7b..4c581319c0 100644
> --- a/tests/device-plug-test.c
> +++ b/tests/device-plug-test.c
> @@ -116,6 +116,22 @@ static void test_spapr_cpu_unplug_request(void)
> qtest_quit(qtest);
> }
>
> +static void test_spapr_memory_unplug_request(void)
> +{
> + QTestState *qtest;
> +
> + qtest = qtest_initf("-m 1G,slots=1,maxmem=2G "
> + "-object memory-backend-ram,id=mem0,size=1G "
> + "-device pc-dimm,id=dev0,memdev=mem0");
> +
> + /* similar to test_pci_unplug_request */
> + device_del_request(qtest, "dev0");
> + system_reset(qtest);
> + wait_device_deleted_event(qtest, "dev0");
> +
> + qtest_quit(qtest);
> +}
> +
> int main(int argc, char **argv)
> {
> const char *arch = qtest_get_arch();
> @@ -140,5 +156,10 @@ int main(int argc, char **argv)
> test_spapr_cpu_unplug_request);
> }
>
> + if (!strcmp(arch, "ppc64")) {
> + qtest_add_func("/device-plug/spapr_memory_unplug_request",
> + test_spapr_memory_unplug_request);
> + }
> +
> return g_test_run();
> }
- Re: [qemu-s390x] [PATCH v2 3/6] tests/device-plug: Add a simple PCI unplug request test, (continued)