qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 18/20] fuzz: add virtio-net fuzz target


From: Stefan Hajnoczi
Subject: Re: [PATCH v7 18/20] fuzz: add virtio-net fuzz target
Date: Tue, 21 Jan 2020 16:42:55 +0000

On Mon, Jan 20, 2020 at 05:55:08AM +0000, Bulekov, Alexander wrote:
> diff --git a/tests/qtest/fuzz/virtio_net_fuzz.c 
> b/tests/qtest/fuzz/virtio_net_fuzz.c
> new file mode 100644
> index 0000000000..3b1b79fd93
> --- /dev/null
> +++ b/tests/qtest/fuzz/virtio_net_fuzz.c
> @@ -0,0 +1,190 @@
> +/*
> + * virtio-net Fuzzing Target
> + *
> + * Copyright Red Hat Inc., 2019
> + *
> + * Authors:
> + *  Alexander Bulekov   <address@hidden>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +
> +#include "qemu/osdep.h"
> +
> +#include "tests/qtest/libqtest.h"
> +#include "tests/qtest/libqos/virtio-net.h"
> +#include "fuzz.h"
> +#include "fork_fuzz.h"
> +#include "qos_fuzz.h"
> +
> +#define QVIRTIO_NET_TIMEOUT_US (30 * 1000 * 1000)
> +#define QVIRTIO_RX_VQ 0
> +#define QVIRTIO_TX_VQ 1
> +#define QVIRTIO_CTRL_VQ 2
> +
> +#define VIRTIO_CONFIG_S_NEEDS_RESET 0x40

Please use #include "standard-headers/linux/virtio_config.h" instead of
duplicating this constant.

> +
> +static int *sv;

Please make this easier to understand:

  /* The -netdev socketpair fds */
  static int sockfds[2];

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]