[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 43/50] multi-process/mig: Load VMSD in the proxy object
From: |
Jagannathan Raman |
Subject: |
[PATCH v5 43/50] multi-process/mig: Load VMSD in the proxy object |
Date: |
Mon, 24 Feb 2020 15:55:34 -0500 |
From: Elena Ufimtseva <address@hidden>
The Proxy object loads the VMSD of remote process in source
and send it to the remote process in the destination
Signed-off-by: Elena Ufimtseva <address@hidden>
Signed-off-by: John G Johnson <address@hidden>
Signed-off-by: Jagannathan Raman <address@hidden>
---
hw/proxy/qemu-proxy.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++
include/io/mpqemu-link.h | 1 +
2 files changed, 51 insertions(+)
diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c
index 19f0dbb..1649f60 100644
--- a/hw/proxy/qemu-proxy.c
+++ b/hw/proxy/qemu-proxy.c
@@ -581,12 +581,62 @@ static int proxy_post_save(void *opaque)
return 0;
}
+static int proxy_post_load(void *opaque, int version_id)
+{
+ MigrationIncomingState *mis = migration_incoming_get_current();
+ PCIProxyDev *pdev = opaque;
+ QEMUFile *f_remote;
+ MPQemuMsg msg = {0};
+ Error *err = NULL;
+ QIOChannel *ioc;
+ uint64_t size;
+ uint8_t byte;
+ int fd[2];
+
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) {
+ return -1;
+ }
+
+ ioc = qio_channel_new_fd(fd[0], &err);
+ if (err) {
+ error_report_err(err);
+ return -1;
+ }
+
+ qio_channel_set_name(QIO_CHANNEL(ioc), "proxy-migration-channel");
+
+ f_remote = qemu_fopen_channel_output(ioc);
+
+ msg.cmd = START_MIG_IN;
+ msg.bytestream = 0;
+ msg.num_fds = 1;
+ msg.fds[0] = fd[1];
+
+ mpqemu_msg_send(&msg, pdev->mpqemu_link->com);
+
+ size = pdev->migsize;
+
+ while (size) {
+ byte = qemu_get_byte(mis->from_src_file);
+ qemu_put_byte(f_remote, byte);
+ size--;
+ }
+
+ qemu_fflush(f_remote);
+ qemu_fclose(f_remote);
+
+ close(fd[1]);
+
+ return 0;
+}
+
const VMStateDescription vmstate_pci_proxy_device = {
.name = "PCIProxyDevice",
.version_id = 2,
.minimum_version_id = 1,
.pre_save = proxy_pre_save,
.post_save = proxy_post_save,
+ .post_load = proxy_post_load,
.fields = (VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_dev, PCIProxyDev),
VMSTATE_UINT64(migsize, PCIProxyDev),
diff --git a/include/io/mpqemu-link.h b/include/io/mpqemu-link.h
index b42c003..01371fc 100644
--- a/include/io/mpqemu-link.h
+++ b/include/io/mpqemu-link.h
@@ -64,6 +64,7 @@ typedef enum {
MMIO_RETURN,
DEVICE_RESET,
START_MIG_OUT,
+ START_MIG_IN,
MAX,
} mpqemu_cmd_t;
--
1.8.3.1
- [PATCH v5 27/50] multi-process: add remote option, (continued)
- [PATCH v5 27/50] multi-process: add remote option, Jagannathan Raman, 2020/02/24
- [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 <=
- [PATCH v5 42/50] multi-process/mig: Send VMSD of remote to the Proxy object, Jagannathan Raman, 2020/02/24
- [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