[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qt
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c |
Date: |
Fri, 26 Jul 2019 23:50:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 26/07/19 14:56, Stefan Hajnoczi wrote:
> This should use indirection: a function pointer to dispatch to either
> the socket or the internal qtest_process_inbuf() call.
>
> With a bit of refactoring you can eliminate the #ifdefs and treat the
> socket fd as one backend and direct invocation as another backend.
My suggestion was a bit different (two files), but this also works. In
fact it can also be combined to have three files:
- one defining libqtest's qtest_init and associated struct of function
pointers
- one defining the fuzzer's qtest_init and associated struct of function
pointers
- one with the remaining libqtest code, modified to use the struct of
function pointers for everything that you're #ifdef-ing here, and a
function qtest_client_init that receives the struct of function pointers
and stores them in QTestState. The two qtest_init implementations in
the other files just call qtest_client_init.
Paolo
- [Qemu-devel] [RFC 00/19] Add virtual device fuzzing support, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 01/19] fuzz: add configure option and linker objects, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 02/19] fuzz: add FUZZ_TARGET type to qemu module system, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 08/19] fuzz: add shims to intercept libfuzzer init, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 03/19] fuzz: add fuzz accelerator, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 05/19] fuzz: expose qemu_savevm_state & skip state header, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 06/19] fuzz: Add ramfile for fast vmstate/vmload, Oleinik, Alexander, 2019/07/24