mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
migration/multifd: Support incoming mapped-ram stream format
For the incoming mapped-ram migration we need to read the ramblock headers, get the pages bitmap and send the host address of each non-zero page to the multifd channel thread for writing. Usage on HMP is: (qemu) migrate_set_capability multifd on (qemu) migrate_set_capability mapped-ram on (qemu) migrate_incoming file:migfile (the ram.h include needs to move because we've been previously relying on it being included from migration.c. Now file.h will start including multifd.h before migration.o is processed) Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20240229153017.2221-22-farosas@suse.de Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
#include "channel.h"
|
||||
#include "file.h"
|
||||
#include "migration.h"
|
||||
#include "multifd.h"
|
||||
#include "io/channel-file.h"
|
||||
#include "io/channel-util.h"
|
||||
#include "options.h"
|
||||
@@ -204,3 +203,20 @@ int file_write_ramblock_iov(QIOChannel *ioc, const struct iovec *iov,
|
||||
|
||||
return (ret < 0) ? ret : 0;
|
||||
}
|
||||
|
||||
int multifd_file_recv_data(MultiFDRecvParams *p, Error **errp)
|
||||
{
|
||||
MultiFDRecvData *data = p->data;
|
||||
size_t ret;
|
||||
|
||||
ret = qio_channel_pread(p->c, (char *) data->opaque,
|
||||
data->size, data->file_offset, errp);
|
||||
if (ret != data->size) {
|
||||
error_prepend(errp,
|
||||
"multifd recv (%u): read 0x%zx, expected 0x%zx",
|
||||
p->id, ret, data->size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user