[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 05/19] fuzz: expose qemu_savevm_state & skip state
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [RFC 05/19] fuzz: expose qemu_savevm_state & skip state header |
Date: |
Thu, 25 Jul 2019 14:22:34 +0100 |
User-agent: |
Mutt/1.12.0 (2019-05-25) |
* Oleinik, Alexander (address@hidden) wrote:
> Signed-off-by: Alexander Oleinik <address@hidden>
> ---
> migration/savevm.c | 8 ++++++--
> migration/savevm.h | 3 +++
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 79ed44d475..80c00ea560 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1404,8 +1404,11 @@ void qemu_savevm_state_cleanup(void)
> }
> }
> }
> -
> +#ifdef CONFIG_FUZZ
> +int qemu_savevm_state(QEMUFile *f, Error **errp)
> +#else
> static int qemu_savevm_state(QEMUFile *f, Error **errp)
> +#endif
If it's useful to you, I'd rather you just dropped the 'static'
rather than add the ifdef.
> {
> int ret;
> MigrationState *ms = migrate_get_current();
> @@ -1471,11 +1474,12 @@ void qemu_savevm_live_state(QEMUFile *f)
> int qemu_save_device_state(QEMUFile *f)
> {
> SaveStateEntry *se;
> -
> +#ifndef CONFIG_FUZZ
> if (!migration_in_colo_state()) {
> qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
> qemu_put_be32(f, QEMU_VM_FILE_VERSION);
> }
> +#endif
Can you explain why you want to skip the header?
Dave
> cpu_synchronize_all_states();
>
> QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> diff --git a/migration/savevm.h b/migration/savevm.h
> index 51a4b9caa8..30315d0cfd 100644
> --- a/migration/savevm.h
> +++ b/migration/savevm.h
> @@ -64,4 +64,7 @@ void qemu_loadvm_state_cleanup(void);
> int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
> int qemu_load_device_state(QEMUFile *f);
>
> +#ifdef CONFIG_FUZZ
> +int qemu_savevm_state(QEMUFile *f, Error **errp);
> +#endif
> #endif
> --
> 2.20.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] [RFC 07/19] fuzz: Modify libqtest to directly invoke qtest.c, (continued)
- [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
- Re: [Qemu-devel] [RFC 05/19] fuzz: expose qemu_savevm_state & skip state header,
Dr. David Alan Gilbert <=
- [Qemu-devel] [RFC 06/19] fuzz: Add ramfile for fast vmstate/vmload, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 04/19] fuzz: Add qos support to fuzz targets, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 12/19] fuzz: hard-code all of the needed files for build, Oleinik, Alexander, 2019/07/24
- [Qemu-devel] [RFC 09/19] fuzz: use mtree_info to find mapped addresses, Oleinik, Alexander, 2019/07/24