From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPXUj-0007bE-G8 for qemu-devel@nongnu.org; Tue, 09 Apr 2013 08:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPXUi-0001GO-BM for qemu-devel@nongnu.org; Tue, 09 Apr 2013 08:17:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPXUi-0001GH-3F for qemu-devel@nongnu.org; Tue, 09 Apr 2013 08:17:48 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r39CHlP8013944 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Apr 2013 08:17:47 -0400 From: Juan Quintela In-Reply-To: <516401A5.1020707@redhat.com> (Paolo Bonzini's message of "Tue, 09 Apr 2013 13:55:17 +0200") References: <1365420597-5506-1-git-send-email-pbonzini@redhat.com> <1365420597-5506-4-git-send-email-pbonzini@redhat.com> <878v4sdj6q.fsf@elfo.elfo> <516401A5.1020707@redhat.com> Date: Tue, 09 Apr 2013 14:17:54 +0200 Message-ID: <87sj2zdhjh.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/4] migration: drop is_write complications Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, owasserm@redhat.com, qemu-devel@nongnu.org Paolo Bonzini wrote: > Il 09/04/2013 13:42, Juan Quintela ha scritto: >>> > @@ -556,11 +557,7 @@ static void qemu_fill_buffer(QEMUFile *f) >>> > int len; >>> > int pending; >>> > >>> > - if (!f->ops->get_buffer) >>> > - return; >> Why are we removing this test? this has nothing to do with the is_write >> removal? > > This test assumes that it makes sense to call qemu_get_byte on a > write-opened QEMUFile. This is not true anymore after this patch. > After eliminating is_write, the right thing to do is abort. But this would not abort, it would do a segmenation fault! I would not complain to a: assert(!f->ops->get_buffer); It would told us from where we got the "invalid" call, but this removal will change a "silent fail" (that I don't like either) to a segmentation fault (that is even worse). Later, Juan.