From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBEkn-0004PM-PJ for qemu-devel@nongnu.org; Tue, 04 Oct 2011 19:50:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBEkm-0004RH-Kh for qemu-devel@nongnu.org; Tue, 04 Oct 2011 19:50:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBEkm-0004RB-B5 for qemu-devel@nongnu.org; Tue, 04 Oct 2011 19:50:28 -0400 From: Juan Quintela In-Reply-To: <4E8B190B.9010802@codemonkey.ws> (Anthony Liguori's message of "Tue, 04 Oct 2011 09:32:43 -0500") References: <4E8B190B.9010802@codemonkey.ws> Date: Wed, 05 Oct 2011 01:50:18 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 21/23] migration: Don't use callback on file defining it Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony Liguori wrote: > On 09/23/2011 07:57 AM, Juan Quintela wrote: >> Signed-off-by: Juan Quintela > > I don't think this is better. It just eliminates the possibility of > having useful trace points in get_error. It's use is not consistent at all (same places use get_error() and the others the native ones). And after this change, it gets clear what get_error() does, just four uses: migration.c:266: } while (ret == -1 && ((s->get_error(s)) == EINTR)); migration.c:269: ret = -(s->get_error(s)); migration.c:341: } while (ret == -1 && (s->get_error(s)) == EINTR); migration.c:344: qemu_file_set_error(s->file, s->get_error(s)); The first two are the same one (just that we don't store the value in a variable), same for the other two. And everything uses errno for it, except migration-tcp on windows, that is the only valid case for windows. So, what we really need here is a way to get error of last system call, abstracted by OS, not by migration method, and another call that we can remove. After the patch, this is easy to find (before it is more complicated). So, patch stand and will search for a way to abstract for errno on migration code. (just using socket_error() will work. What do you think? Later, Juan.