On 03/10/2011 05:01 AM, Daniel P. Berrange wrote:
On Wed, Mar 09, 2011 at 06:45:44PM -0700, Eric Blake wrote:
> * src/qemu/qemu_monitor.h (qemuMonitorMigrateToFd): New
> prototype.
> * src/qemu/qemu_monitor.c (qemuMonitorMigrateToFd): New function.
> ---
> src/qemu/qemu_monitor.c | 31 +++++++++++++++++++++++++++++++
> src/qemu/qemu_monitor.h | 4 ++++
> 2 files changed, 35 insertions(+), 0 deletions(-)
ACK
Thanks; pushed.
> + 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;
> +}
It is a nice idea todo the SendFileHAndle/CloseFileHandle
calls from here, rather than in the qemu_driver code
itself. It makes the latter much clearer - we should think
about whether it makes sense to rewrite the NIC hotplug
code to work this way too.
Agreed; I'll submit a patch for that shortly.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org