mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
qemu: support migration to fd
* src/qemu/qemu_monitor.h (qemuMonitorMigrateToFd): New prototype. * src/qemu/qemu_monitor.c (qemuMonitorMigrateToFd): New function.
This commit is contained in:
parent
8e42c50bd4
commit
100bba0647
@ -1396,6 +1396,37 @@ int qemuMonitorGetMigrationStatus(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
int qemuMonitorMigrateToFd(qemuMonitorPtr mon,
|
||||
unsigned int flags,
|
||||
int fd)
|
||||
{
|
||||
int ret;
|
||||
VIR_DEBUG("mon=%p fd=%d flags=%u",
|
||||
mon, fd, flags);
|
||||
|
||||
if (!mon) {
|
||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("monitor must not be NULL"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (qemuMonitorSendFileHandle(mon, "migrate", fd) < 0)
|
||||
return -1;
|
||||
|
||||
if (mon->json)
|
||||
ret = qemuMonitorJSONMigrate(mon, flags, "fd:migrate");
|
||||
else
|
||||
ret = qemuMonitorTextMigrate(mon, flags, "fd:migrate");
|
||||
|
||||
if (ret < 0) {
|
||||
if (qemuMonitorCloseFileHandle(mon, "migrate") < 0)
|
||||
VIR_WARN0("failed to close migration handle");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
|
||||
unsigned int flags,
|
||||
const char *hostname,
|
||||
|
@ -266,6 +266,10 @@ typedef enum {
|
||||
QEMU_MONITOR_MIGRATION_FLAGS_LAST
|
||||
} QEMU_MONITOR_MIGRATE;
|
||||
|
||||
int qemuMonitorMigrateToFd(qemuMonitorPtr mon,
|
||||
unsigned int flags,
|
||||
int fd);
|
||||
|
||||
int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
|
||||
unsigned int flags,
|
||||
const char *hostname,
|
||||
|
Loading…
x
Reference in New Issue
Block a user