On Wed, Aug 26, 2015 at 06:04:08PM +0800, Jason Wang wrote:
> Test fast mmio by using zero size eventfd.
> 
> Signed-off-by: Jason Wang <jasow...@redhat.com>

wildcard is not the same as ignoring length.
I think I have a nicer patch, will post now.

> ---
>  hw/misc/pci-testdev.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
> index 26b9b86..7bf67ed 100644
> --- a/hw/misc/pci-testdev.c
> +++ b/hw/misc/pci-testdev.c
> @@ -261,8 +261,12 @@ static void pci_testdev_realize(PCIDevice *pci_dev, 
> Error **errp)
>          memcpy(test->hdr->name, name, strlen(name) + 1);
>          g_free(name);
>          test->hdr->offset = cpu_to_le32(IOTEST_SIZE(i) + i * 
> IOTEST_ACCESS_WIDTH);
> -        test->size = IOTEST_ACCESS_WIDTH;
>          test->match_data = strcmp(IOTEST_TEST(i), "wildcard-eventfd");
> +        if (!test->match_data && !strcmp(IOTEST_TYPE(i), "mmio")) {
> +            test->size = 0;
> +        } else {
> +            test->size = IOTEST_ACCESS_WIDTH;
> +        }
>          test->hdr->test = i;
>          test->hdr->data = test->match_data ? IOTEST_DATAMATCH : 
> IOTEST_NOMATCH;
>          test->hdr->width = IOTEST_ACCESS_WIDTH;
> -- 
> 2.1.4

Reply via email to