[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: |
Thu, 25 Jul 2019 11:33:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 25/07/19 11:04, Thomas Huth wrote:
>> @@ -797,6 +832,9 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...)
>>
>> const char *qtest_get_arch(void)
>> {
>> +#ifdef CONFIG_FUZZ
>> + return "i386";
>> +#endif
>
> Hard-coding "i386" is quite ugly ... it's ok for an RFC patch, but I
> think this should be fixed in the final version of the patches. Maybe
> you could use TARGET_NAME instead?
Yes, TARGET_NAME is the one. Also I would just split the file in two:
the common bits that are used for both libqtest and fuzz in one file, so
the libqtest and fuzz "drivers" can be in completely separate file
without #ifdefs.
Paolo
>
>> const char *qemu = qtest_qemu_binary();
>> const char *end = strrchr(qemu, '/');
>>
>> @@ -1339,3 +1377,16 @@ void qmp_assert_error_class(QDict *rsp, const char
>> *class)
>>
>> qobject_unref(rsp);
>> }
>> +#ifdef CONFIG_FUZZ
>> +void qtest_clear_rxbuf(QTestState *s){
>
> For functions, the curly brace should start on a new line.
>
>> + g_string_set_size(recv_str,0);
>> +}
>
> Thomas
>
- [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