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:
Eric Blake 2011-03-01 21:37:30 -07:00
parent 8e42c50bd4
commit 100bba0647
2 changed files with 35 additions and 0 deletions

View File

@ -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,

View File

@ -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,