Il 18/03/2013 21:37, Michael R. Hines ha scritto:
>>
>> + if(!migrate_use_rdma(f)) {
>> + int fd = qemu_get_fd(f);
>> + assert(fd != -1);
>> + socket_set_nonblock(fd);
>> Is this because qemu_get_fd(f) returns -1 for RDMA? Then, you can
>> instead put socket_set_nonblock under an if(fd != -1).
>
> Yes, I proposed doing that check (for -1) in a previous RFC,
> but you told me to remove it and make a separate patch =)
>
> Is it OK to keep it in this patch?
Yes---this is a separate patch. Apologies if you had the if(fd != -1)
before. :) In fact, both the if(fd != -1) and the
if(!migrate_use_rdma(f)) are bad, but I prefer to eliminate as many uses
as possible of migrate_use_rdma.
The reason why they are bad, is that we try to operate on the socket in
a non-blocking manner, so that the monitor keeps working during incoming
migration. We do it with non-blocking sockets because incoming
migration does not (yet?) have a separate thread, and is not a
bottleneck (the VM is not running, so it's not a problem to hold the big
QEMU lock for extended periods of time).
Does librdmacm support non-blocking operation, similar to select() or
poll()? Perhaps we can add support for that later.
Paolo