[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] Fix QEMU tunnelled migration FD handling



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]