summaryrefslogtreecommitdiff
path: root/savevm.c
diff options
context:
space:
mode:
authorChris Lalancette <clalance@redhat.com>2009-05-25 16:38:23 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-27 09:46:07 -0500
commit8a43b1ea7fd02a8e9a5c5ef58017b1bd059663bb (patch)
tree267c6df69d20628c38875715e1f8c97551b4834b /savevm.c
parentc16b5a2ca0b186de618654a576bdad9cdd2d1ab2 (diff)
Allow monitor interaction when using migrate -exec
All, I've recently been playing around with migration via exec. Unfortunately, when starting the incoming qemu process with "-incoming exec:cmd", it suffers the same problem that -incoming tcp used to suffer; namely, that you can't interact with the monitor until after the migration has happened. This causes problems for libvirt usage of -incoming exec, since libvirt expects to be able to access the monitor ahead of time. This fairly simple patch allows you to access the monitor both before and after the migration has completed using exec. (note: developed/tested with qemu-kvm, but applies perfectly fine to qemu) Signed-off-by: Chris Lalancette <clalance@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'savevm.c')
-rw-r--r--savevm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/savevm.c b/savevm.c
index 68ffd03e6e..248aea3edf 100644
--- a/savevm.c
+++ b/savevm.c
@@ -244,7 +244,6 @@ QEMUFile *qemu_popen(FILE *popen_file, const char *mode)
} else {
s->file = qemu_fopen_ops(s, popen_put_buffer, NULL, popen_close, NULL, NULL);
}
- fprintf(stderr, "qemu_popen: returning result of qemu_fopen_ops\n");
return s->file;
}
@@ -260,6 +259,17 @@ QEMUFile *qemu_popen_cmd(const char *command, const char *mode)
return qemu_popen(popen_file, mode);
}
+int qemu_popen_fd(QEMUFile *f)
+{
+ QEMUFilePopen *p;
+ int fd;
+
+ p = (QEMUFilePopen *)f->opaque;
+ fd = fileno(p->popen_file);
+
+ return fd;
+}
+
QEMUFile *qemu_fopen_socket(int fd)
{
QEMUFileSocket *s = qemu_mallocz(sizeof(QEMUFileSocket));