aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2024-11-26 14:06:31 +0000
committerPeter Maydell <peter.maydell@linaro.org>2024-11-26 14:06:31 +0000
commit1af7cba50c58efc207c368cbc8b61166889873b2 (patch)
treed167345256d2d191ca637fc582b25ab69ddf7637
parentb8ee011e40e4b83a32ea0e7dca24e1ab089f1e7f (diff)
parent59c390d95b4984c87db0deda2b8dad0c9595156e (diff)
downloadqemu-1af7cba50c58efc207c368cbc8b61166889873b2.zip
qemu-1af7cba50c58efc207c368cbc8b61166889873b2.tar.gz
qemu-1af7cba50c58efc207c368cbc8b61166889873b2.tar.bz2
Merge tag 'migration-20241125-pull-request' of https://gitlab.com/peterx/qemu into staging
Migration pull for 9.2-rc2 - Fabiano's patch to remove double vmstate cleanup in postcopy - Peter's patch to whitelist pipes in fd migration URIs # -----BEGIN PGP SIGNATURE----- # # iIgEABYKADAWIQS5GE3CDMRX2s990ak7X8zN86vXBgUCZ0TqmRIccGV0ZXJ4QHJl # ZGhhdC5jb20ACgkQO1/MzfOr1waJ7AD8Cb8tHkjFG25Q3ufRrkj3d05oVZDRU4lx # 6bgku9xbUQ0A/1ruu96sy89q9t9facPHn+y/0xmmpBJMB5EJ1Jxunm0M # =2Ctw # -----END PGP SIGNATURE----- # gpg: Signature made Mon 25 Nov 2024 21:22:33 GMT # gpg: using EDDSA key B9184DC20CC457DACF7DD1A93B5FCCCDF3ABD706 # gpg: issuer "peterx@redhat.com" # gpg: Good signature from "Peter Xu <xzpeter@gmail.com>" [marginal] # gpg: aka "Peter Xu <peterx@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: B918 4DC2 0CC4 57DA CF7D D1A9 3B5F CCCD F3AB D706 * tag 'migration-20241125-pull-request' of https://gitlab.com/peterx/qemu: migration: Fix extra cleanup at postcopy listen migration: Allow pipes to keep working for fd migrations Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--migration/fd.c27
-rw-r--r--migration/savevm.c1
2 files changed, 25 insertions, 3 deletions
diff --git a/migration/fd.c b/migration/fd.c
index aab5189..9bf9be6 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -25,6 +25,29 @@
#include "io/channel-util.h"
#include "trace.h"
+static bool fd_is_pipe(int fd)
+{
+ struct stat statbuf;
+
+ if (fstat(fd, &statbuf) == -1) {
+ return false;
+ }
+
+ return S_ISFIFO(statbuf.st_mode);
+}
+
+static bool migration_fd_valid(int fd)
+{
+ if (fd_is_socket(fd)) {
+ return true;
+ }
+
+ if (fd_is_pipe(fd)) {
+ return true;
+ }
+
+ return false;
+}
void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp)
{
@@ -34,7 +57,7 @@ void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **
return;
}
- if (!fd_is_socket(fd)) {
+ if (!migration_fd_valid(fd)) {
warn_report("fd: migration to a file is deprecated."
" Use file: instead.");
}
@@ -68,7 +91,7 @@ void fd_start_incoming_migration(const char *fdname, Error **errp)
return;
}
- if (!fd_is_socket(fd)) {
+ if (!migration_fd_valid(fd)) {
warn_report("fd: migration to a file is deprecated."
" Use file: instead.");
}
diff --git a/migration/savevm.c b/migration/savevm.c
index f4e4876..98821c8 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2057,7 +2057,6 @@ static void *postcopy_ram_listen_thread(void *opaque)
* got a bad migration state).
*/
migration_incoming_state_destroy();
- qemu_loadvm_state_cleanup();
rcu_unregister_thread();
mis->have_listen_thread = false;