mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
migration: Revert mapped-ram multifd support to fd: URI
This reverts commitdecdc76772
in full and also the relevant migration-tests from7a09f09283
. After the addition of the new QAPI-based migration address API in 8.2 we've been converting an "fd:" URI into a SocketAddress, missing the fact that the "fd:" syntax could also be used for a plain file instead of a socket. This is a problem because the SocketAddress is part of the API, so we're effectively asking users to create a "socket" channel to pass in a plain file. The easiest way to fix this situation is to deprecate the usage of both SocketAddress and "fd:" when used with a plain file for migration. Since this has been possible since 8.2, we can wait until 9.1 to deprecate it. For 9.0, however, we should avoid adding further support to migration to a plain file using the old "fd:" syntax or the new SocketAddress API, and instead require the usage of either the old-style "file:" URI or the FileMigrationArgs::filename field of the new API with the "/dev/fdset/NN" syntax, both of which are already supported. Signed-off-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20240319210941.1907-1-farosas@suse.de Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
853546f812
commit
bd4480b0d0
6 changed files with 8 additions and 127 deletions
|
@ -11,7 +11,6 @@
|
|||
#include "qemu/error-report.h"
|
||||
#include "qapi/error.h"
|
||||
#include "channel.h"
|
||||
#include "fd.h"
|
||||
#include "file.h"
|
||||
#include "migration.h"
|
||||
#include "io/channel-file.h"
|
||||
|
@ -55,27 +54,15 @@ bool file_send_channel_create(gpointer opaque, Error **errp)
|
|||
{
|
||||
QIOChannelFile *ioc;
|
||||
int flags = O_WRONLY;
|
||||
bool ret = false;
|
||||
int fd = fd_args_get_fd();
|
||||
|
||||
if (fd && fd != -1) {
|
||||
if (fd_is_socket(fd)) {
|
||||
error_setg(errp,
|
||||
"Multifd migration to a socket FD is not supported");
|
||||
goto out;
|
||||
}
|
||||
|
||||
ioc = qio_channel_file_new_dupfd(fd, errp);
|
||||
} else {
|
||||
ioc = qio_channel_file_new_path(outgoing_args.fname, flags, 0, errp);
|
||||
}
|
||||
bool ret = true;
|
||||
|
||||
ioc = qio_channel_file_new_path(outgoing_args.fname, flags, 0, errp);
|
||||
if (!ioc) {
|
||||
ret = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
multifd_channel_connect(opaque, QIO_CHANNEL(ioc));
|
||||
ret = true;
|
||||
|
||||
out:
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue