[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 21/46] tests/qtest: add a test case for pvpanic-pci
From: |
Peter Maydell |
Subject: |
Re: [PULL 21/46] tests/qtest: add a test case for pvpanic-pci |
Date: |
Fri, 29 Jan 2021 15:57:08 +0000 |
On Fri, 29 Jan 2021 at 11:00, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> From: Mihai Carabas <mihai.carabas@oracle.com>
>
> Add a test case for pvpanic-pci device. The scenario is the same as pvpanic
> ISA device, but is using the PCI bus.
>
> Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
> Acked-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This turns out to trigger the oss-fuzz build's leak-sanitizer:
https://gitlab.com/qemu-project/qemu/-/jobs/995177788
> +static void test_panic_nopause(void)
> +{
> + uint8_t val;
> + QDict *response, *data;
> + QTestState *qts;
> + QPCIBus *pcibus;
> + QPCIDevice *dev;
> + QPCIBar bar;
> +
> + qts = qtest_init("-device pvpanic-pci,addr=04.0 -action panic=none");
> + pcibus = qpci_new_pc(qts, NULL);
> + dev = qpci_device_find(pcibus, QPCI_DEVFN(0x4, 0x0));
> + qpci_device_enable(dev);
> + bar = qpci_iomap(dev, 0, NULL);
> +
> + qpci_memread(dev, bar, 0, &val, sizeof(val));
> + g_assert_cmpuint(val, ==, 3);
> +
> + val = 1;
> + qpci_memwrite(dev, bar, 0, &val, sizeof(val));
> +
> + response = qtest_qmp_eventwait_ref(qts, "GUEST_PANICKED");
> + g_assert(qdict_haskey(response, "data"));
> + data = qdict_get_qdict(response, "data");
> + g_assert(qdict_haskey(data, "action"));
> + g_assert_cmpstr(qdict_get_str(data, "action"), ==, "run");
> + qobject_unref(response);
> +
I'm going to squash in the trivial fix, which is to add
g_free(dev);
qpci_free_pc(pcibus);
here and similarly in the test_panic() function.
> + qtest_quit(qts);
> + }
thanks
-- PMM
- [PULL 13/46] darwin: fix cross-compiling for Darwin, (continued)
- [PULL 13/46] darwin: fix cross-compiling for Darwin, Peter Maydell, 2021/01/29
- [PULL 10/46] configure: cross-compiling with empty cross_prefix, Peter Maydell, 2021/01/29
- [PULL 12/46] darwin: remove redundant dependency declaration, Peter Maydell, 2021/01/29
- [PULL 14/46] configure: cross compile should use x86_64 cpu_family, Peter Maydell, 2021/01/29
- [PULL 16/46] darwin: remove 64-bit build detection on 32-bit OS, Peter Maydell, 2021/01/29
- [PULL 19/46] hw/misc/pvpanic: add PCI interface support, Peter Maydell, 2021/01/29
- [PULL 18/46] hw/misc/pvpanic: split-out generic and bus dependent code, Peter Maydell, 2021/01/29
- [PULL 15/46] darwin: detect CoreAudio for build, Peter Maydell, 2021/01/29
- [PULL 17/46] hvf: Add hypervisor entitlement to output binaries, Peter Maydell, 2021/01/29
- [PULL 21/46] tests/qtest: add a test case for pvpanic-pci, Peter Maydell, 2021/01/29
- Re: [PULL 21/46] tests/qtest: add a test case for pvpanic-pci,
Peter Maydell <=
- [PULL 22/46] ptimer: Add new ptimer_set_period_from_clock() function, Peter Maydell, 2021/01/29
- [PULL 27/46] hw/timer/cmsdk-apb-timer: Rename CMSDKAPBTIMER struct to CMSDKAPBTimer, Peter Maydell, 2021/01/29
- [PULL 29/46] hw/timer/cmsdk-apb-dualtimer: Add Clock input, Peter Maydell, 2021/01/29
- [PULL 20/46] pvpanic : update pvpanic spec document, Peter Maydell, 2021/01/29
- [PULL 24/46] tests: Add a simple test of the CMSDK APB timer, Peter Maydell, 2021/01/29
- [PULL 23/46] clock: Add new clock_has_source() function, Peter Maydell, 2021/01/29
- [PULL 26/46] tests: Add a simple test of the CMSDK APB dual timer, Peter Maydell, 2021/01/29
- [PULL 25/46] tests: Add a simple test of the CMSDK APB watchdog, Peter Maydell, 2021/01/29
- [PULL 32/46] hw/arm/armsse: Wire up clocks, Peter Maydell, 2021/01/29