From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHslz-00054X-5Z for qemu-devel@nongnu.org; Tue, 19 Mar 2013 05:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHslx-0006iQ-SZ for qemu-devel@nongnu.org; Tue, 19 Mar 2013 05:23:59 -0400 Received: from mail-vb0-x233.google.com ([2607:f8b0:400c:c02::233]:40865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHslx-0006iA-Gu for qemu-devel@nongnu.org; Tue, 19 Mar 2013 05:23:57 -0400 Received: by mail-vb0-f51.google.com with SMTP id fq11so161716vbb.24 for ; Tue, 19 Mar 2013 02:23:57 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51482EA6.7020501@redhat.com> Date: Tue, 19 Mar 2013 10:23:50 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1363576743-6146-1-git-send-email-mrhines@linux.vnet.ibm.com> <1363576743-6146-10-git-send-email-mrhines@linux.vnet.ibm.com> <5146D4A8.7040500@redhat.com> <51477B1C.5060602@linux.vnet.ibm.com> In-Reply-To: <51477B1C.5060602@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH RDMA support v4: 09/10] check for QMP string and bypass nonblock() calls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael R. Hines" Cc: aliguori@us.ibm.com, mst@redhat.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com 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