[libvirt] [PATCH] Fix QEMU tunnelled migration FD handling
Eric Blake
eblake at redhat.com
Thu Apr 21 16:04:16 UTC 2011
On 04/21/2011 09:05 AM, Daniel P. Berrange wrote:
> The two ends of the pipe used for feeding QEMU tunnelled
> migration data were interchanged, so QEMU got given the
> "write" end instead of the "read" end.
>
> The qemuMigrationPrepareTunnel method was also immediately
> closing the "write" end of the pipe, so the stream failed
> to actually write anything.
>
> * src/qemu/qemu_migration.c: Swap tunnelled migration
> pipe FDs & don't close pipe given to stream
> ---
> src/qemu/qemu_migration.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
ACK - fixes regression introduced in commit c7af07ac.
>
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index bba76d5..7f4b111 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -301,7 +301,7 @@ qemuMigrationPrepareTunnel(struct qemud_driver *driver,
> vm->def->id = -1;
>
> if (pipe(dataFD) < 0 ||
> - virSetCloseExec(dataFD[0]) < 0) {
> + virSetCloseExec(dataFD[1]) < 0) {
And sorry for botching it. socketpair() is a bit nicer than pipe() in
that it's bi-directional and you don't have to think about which end is
the write end.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110421/7687cc75/attachment-0001.sig>
More information about the libvir-list
mailing list