]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
fuzz: add an "opaque" to the FuzzTarget struct
authorAlexander Bulekov <alxndr@bu.edu>
Fri, 23 Oct 2020 15:07:42 +0000 (11:07 -0400)
committerThomas Huth <thuth@redhat.com>
Mon, 26 Oct 2020 08:53:53 +0000 (09:53 +0100)
It can be useful to register FuzzTargets that have nearly-identical
initialization handlers (e.g. for using the same fuzzing code, with
different configuration options). Add an opaque pointer to the
FuzzTarget struct, so that FuzzTargets can hold some data, useful for
storing target-specific configuration options, that can be read by the
get_init_cmdline function.

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20201023150746.107063-14-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/fuzz/fuzz.h

index ed9ce1715493938c53ec65a0481f9798d2cad246..08e9560a795c1c94633cd13e8cb71b19ade697c0 100644 (file)
@@ -100,6 +100,7 @@ typedef struct FuzzTarget {
                        uint8_t *out, size_t max_out_size,
                        unsigned int seed);
 
+    void *opaque;
 } FuzzTarget;
 
 void flush_events(QTestState *);