[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 08/17] fuzz: Export the qemu_savevm_live_
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 08/17] fuzz: Export the qemu_savevm_live_state function |
Date: |
Mon, 5 Aug 2019 11:54:32 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
* Oleinik, Alexander (address@hidden) wrote:
> Skip the header when saving device state, as the header isn't handled by
> qemu_load_device_state
>
> Signed-off-by: Alexander Oleinik <address@hidden>
> ---
> migration/savevm.c | 9 +++++++--
> migration/savevm.h | 2 ++
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/migration/savevm.c b/migration/savevm.c
> index 79ed44d475..5eac36e6ca 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1405,7 +1405,7 @@ void qemu_savevm_state_cleanup(void)
> }
> }
>
> -static int qemu_savevm_state(QEMUFile *f, Error **errp)
> +int qemu_savevm_state(QEMUFile *f, Error **errp)
> {
> int ret;
> MigrationState *ms = migrate_get_current();
> @@ -1471,11 +1471,16 @@ void qemu_savevm_live_state(QEMUFile *f)
> int qemu_save_device_state(QEMUFile *f)
> {
> SaveStateEntry *se;
> -
> + /*
> + * qemu_load_device_state doesn't load the header. Either skip writing
> the
> + * header or seek forward in the file, prior to loading device state
> + */
> +#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
I'd prefer if you just added a ', bool save_header' to the parameters
and then replace the '!migration_in_colo_state()' by 'save_header'
It's only called from two places at the moment,
'qmp_xen_save_devices_state' where I think it's always 'true'
and 'colo_do_checkpoint_transaction' where I think it's always false.
Dave
> cpu_synchronize_all_states();
>
> QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
> diff --git a/migration/savevm.h b/migration/savevm.h
> index 51a4b9caa8..5405215cb4 100644
> --- a/migration/savevm.h
> +++ b/migration/savevm.h
> @@ -64,4 +64,6 @@ void qemu_loadvm_state_cleanup(void);
> int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis);
> int qemu_load_device_state(QEMUFile *f);
>
> +int qemu_savevm_state(QEMUFile *f, Error **errp);
> +
> #endif
> --
> 2.20.1
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] [RFC PATCH v2 05/17] fuzz: Add direct receive function for qtest server, (continued)
- [Qemu-devel] [RFC PATCH v2 06/17] fuzz: Add FUZZ_TARGET module type, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 07/17] fuzz: Add ramfile qemu-file type, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 09/17] fuzz: hardcode needed objects into i386 target, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 08/17] fuzz: Export the qemu_savevm_live_state function, Oleinik, Alexander, 2019/08/05
- Re: [Qemu-devel] [RFC PATCH v2 08/17] fuzz: Export the qemu_savevm_live_state function,
Dr. David Alan Gilbert <=
- [Qemu-devel] [RFC PATCH v2 10/17] fuzz: qtest client directly interacts with server, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 11/17] fuzz: Move useful qos functions to separate object, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 14/17] fuzz: Add forking support to the fuzzer, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 13/17] fuzz: Add libqos support to the fuzzer, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 17/17] fuzz: Add fuzz accelerator type, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 12/17] fuzz: Add fuzzer skeleton, Oleinik, Alexander, 2019/08/05
- [Qemu-devel] [RFC PATCH v2 15/17] fuzz: Add general qtest fuzz-target, Oleinik, Alexander, 2019/08/05