[RFC 2/7] migration: No save_live_pending() method uses the QEMUFile parameter

2022-10-02 Thread Juan Quintela
So remove it everywhere. Signed-off-by: Juan Quintela --- include/migration/register.h | 6 ++ migration/savevm.h | 2 +- hw/s390x/s390-stattrib.c | 2 +- hw/vfio/migration.c| 6 ++ migration/block-dirty-bitmap.c | 5 ++--- migration/block.c

[RFC 3/7] migration: Block migration comment or code is wrong

2022-10-02 Thread Juan Quintela
And it appears that what is wrong is the code. During bulk stage we need to make sure that some block is dirty, but no games with max_size at all. Signed-off-by: Juan Quintela --- migration/block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/block.c

[RFC 7/7] migration: call qemu_savevm_state_pending_exact() with the guest stopped

2022-10-02 Thread Juan Quintela
HACK ahead. There are devices that require the guest to be stopped to tell us what is the size of its state. So we need to stop the vm "before" we cal the functions. It is a hack because: - we are "starting" the guest again to stop it in migration_complete() I know, I know, but it is not

[RFC 6/7] migration: simplify migration_iteration_run()

2022-10-02 Thread Juan Quintela
Signed-off-by: Juan Quintela --- migration/migration.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 97fefd579e..35e512887a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@

[RFC 5/7] migration: Remove unused threshold_size parameter

2022-10-02 Thread Juan Quintela
Until previous commit, save_live_pending() was used for ram. Now with the split into state_pending_estimate() and state_pending_exact() it is not needed anymore, so remove them. Signed-off-by: Juan Quintela --- include/migration/register.h | 7 +++ migration/savevm.h | 6

[RFC 4/7] migration: Split save_live_pending() into state_pending_*

2022-10-02 Thread Juan Quintela
We split the function into to: - state_pending_estimate: We estimate the remaining state size without stopping the machine. - state pending_exact: We calculate the exact amount of remaining state. The only "device" that implements different functions for _estimate() and _exact() is ram.

[RFC 1/7] migration: Remove res_compatible parameter

2022-10-02 Thread Juan Quintela
It was only used for RAM, and in that case, it means that this amount of data was sent for memory. Just delete the field in all callers. Signed-off-by: Juan Quintela --- include/migration/register.h | 20 ++-- migration/savevm.h | 4 +--- hw/s390x/s390-stattrib.c

[RFC 0/7] migration patches for VFIO

2022-10-02 Thread Juan Quintela
Hi VFIO migration has several requirements: - the size of the state is only known when the guest is stopped - they need to send possible lots of data. this series only address the 1st set of problems. What they do: - res_compatible parameter was not used anywhere, just add that information to

Re: [PATCH v5 2/2] block: Refactor get_tmp_filename()

2022-10-02 Thread Bin Meng
Hi Kevin, On Fri, Sep 30, 2022 at 6:13 PM Kevin Wolf wrote: > > Am 28.09.2022 um 16:41 hat Bin Meng geschrieben: > > From: Bin Meng > > > > At present there are two callers of get_tmp_filename() and they are > > inconsistent. > > > > One does: > > > > /* TODO: extra byte is a hack to ensure