[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 42/50] multi-process/mig: Send VMSD of remote to the Proxy obj
From: |
Jagannathan Raman |
Subject: |
[PATCH v5 42/50] multi-process/mig: Send VMSD of remote to the Proxy object |
Date: |
Mon, 24 Feb 2020 15:55:33 -0500 |
The remote process sends the VMSD to the Proxy object, on the source
side
Signed-off-by: Elena Ufimtseva <address@hidden>
Signed-off-by: John G Johnson <address@hidden>
Signed-off-by: Jagannathan Raman <address@hidden>
---
migration/savevm.c | 27 +++++++++++++++++++++++++++
migration/savevm.h | 2 ++
remote/remote-main.c | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+)
diff --git a/migration/savevm.c b/migration/savevm.c
index 1d4220e..09af14d 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2942,3 +2942,30 @@ bool vmstate_check_only_migratable(const
VMStateDescription *vmsd)
return !(vmsd && vmsd->unmigratable);
}
+
+int qemu_remote_savevm(QEMUFile *f)
+{
+ SaveStateEntry *se;
+ int ret;
+
+ QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
+ if (!se->vmsd || !vmstate_save_needed(se->vmsd, se->opaque)) {
+ continue;
+ }
+
+ save_section_header(f, se, QEMU_VM_SECTION_FULL);
+
+ ret = vmstate_save(f, se, NULL);
+ if (ret) {
+ qemu_file_set_error(f, ret);
+ return ret;
+ }
+
+ save_section_footer(f, se);
+ }
+
+ qemu_put_byte(f, QEMU_VM_EOF);
+ qemu_fflush(f);
+
+ return 0;
+}
diff --git a/migration/savevm.h b/migration/savevm.h
index ba64a7e..0491d3a 100644
--- a/migration/savevm.h
+++ b/migration/savevm.h
@@ -65,4 +65,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_remote_savevm(QEMUFile *f);
+
#endif
diff --git a/remote/remote-main.c b/remote/remote-main.c
index 58d9905..e97eb76 100644
--- a/remote/remote-main.c
+++ b/remote/remote-main.c
@@ -53,6 +53,16 @@
#include "qemu/log.h"
#include "qemu/cutils.h"
#include "remote-opts.h"
+#include "qapi/error.h"
+#include "io/channel-util.h"
+
+#include "io/channel.h"
+#include "io/channel-socket.h"
+#include "migration/qemu-file-types.h"
+#include "migration/savevm.h"
+#include "migration/qemu-file-channel.h"
+#include "migration/qemu-file.h"
+
#include "monitor/monitor.h"
#include "chardev/char.h"
#include "sysemu/reset.h"
@@ -322,6 +332,36 @@ static int setup_device(MPQemuMsg *msg, Error **errp)
}
+static void process_start_mig_out(MPQemuMsg *msg)
+{
+ int wait = msg->fds[1];
+ Error *err = NULL;
+ QIOChannel *ioc;
+ QEMUFile *f;
+
+ ioc = qio_channel_new_fd(msg->fds[0], &err);
+ if (err) {
+ error_report_err(err);
+ return;
+ }
+
+ qio_channel_set_name(QIO_CHANNEL(ioc), "remote-migration-channel");
+
+ f = qemu_fopen_channel_output(ioc);
+
+ bdrv_drain_all();
+ (void)bdrv_flush_all();
+
+ (void)qemu_remote_savevm(f);
+
+ qemu_fflush(f);
+
+ notify_proxy(wait, (uint64_t)qemu_ftell(f));
+ PUT_REMOTE_WAIT(wait);
+
+ qemu_fclose(f);
+}
+
static void process_msg(GIOCondition cond, MPQemuChannel *chan)
{
MPQemuMsg *msg = NULL;
@@ -411,6 +451,9 @@ static void process_msg(GIOCondition cond, MPQemuChannel
*chan)
notify_proxy(msg->fds[0], 0);
}
break;
+ case START_MIG_OUT:
+ process_start_mig_out(msg);
+ break;
default:
error_setg(&err, "Unknown command");
goto finalize_loop;
--
1.8.3.1
- [PATCH v5 29/50] multi-process: add parse_cmdline in remote process, (continued)
- [PATCH v5 29/50] multi-process: add parse_cmdline in remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 28/50] multi-process: add remote options parser, Jagannathan Raman, 2020/02/24
- [PATCH v5 32/50] multi-process: Use separate MMIO communication channel, Jagannathan Raman, 2020/02/24
- [PATCH v5 33/50] multi-process: perform device reset in the remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 34/50] multi-process/mon: choose HMP commands based on target, Jagannathan Raman, 2020/02/24
- [PATCH v5 35/50] multi-process/mon: stub functions to enable QMP module for remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 30/50] multi-process: send heartbeat messages to remote, Jagannathan Raman, 2020/02/24
- [PATCH v5 31/50] multi-process: handle heartbeat messages in remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 38/50] multi-process/mon: Initialize QMP module for remote processes, Jagannathan Raman, 2020/02/24
- [PATCH v5 43/50] multi-process/mig: Load VMSD in the proxy object, Jagannathan Raman, 2020/02/24
- [PATCH v5 42/50] multi-process/mig: Send VMSD of remote to the Proxy object,
Jagannathan Raman <=
- [PATCH v5 37/50] multi-process/mon: Refactor monitor/chardev functions out of vl.c, Jagannathan Raman, 2020/02/24
- [PATCH v5 36/50] multi-process/mon: enable QMP module support in the remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 45/50] multi-process/mig: Synchronize runstate of remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 46/50] multi-process/mig: Restore the VMSD in remote process, Jagannathan Raman, 2020/02/24
- [PATCH v5 39/50] multi-process: prevent duplicate memory initialization in remote, Jagannathan Raman, 2020/02/24
- [PATCH v5 48/50] multi-process: Validate incoming commands from Proxy, Jagannathan Raman, 2020/02/24
- [PATCH v5 41/50] multi-process/mig: Enable VMSD save in the Proxy object, Jagannathan Raman, 2020/02/24
- [PATCH v5 50/50] multi-process: add configure and usage information, Jagannathan Raman, 2020/02/24